ladybird/Libraries
Andreas Kling c419bb526b LibWeb: Track connected SVG use elements in a per-document list
Every SVG element insertion, removal, attribute change, and children
change walked the entire document looking for use elements to notify
about possible referenced-subtree changes. On pages with large SVG
documents this is quadratic: loading chatgpt.com spent 7% of all CPU
samples in these full-document scans, nearly all of it while parsing
an SVG icon sprite sheet.

Instead, keep every use element connected to a document's node tree in
an intrusive list owned by that document, and only iterate that list
(usually empty or tiny) when an SVG element changes.

Subtleties:

- A use element inserted by the same subtree insertion as its
  referenced element, but after it in tree order, used to be found by
  the document-wide scan from the referenced element's insertion
  steps. Now SVGUseElement::inserted() re-resolves the reference if
  the shadow tree is still unpopulated. A new test covers both tree
  orders.

- Node.moveBefore() runs moving steps without insertion or removal
  hooks. Now SVGUseElement::moved_from() updates list membership when
  moving across document-tree and shadow-tree boundaries. A new test
  covers both directions.

- Removal hooks run after the subtree has been detached, so use
  elements being removed alongside the changed element may still be
  registered. Filter them out structurally via root().is_document(),
  since Node::is_connected() is a flag that is updated in hook order
  and can still be stale at this point.
2026-06-11 15:28:59 +02:00
..
LibCompress Meta: Enable exit-time destructor warnings for libraries 2026-06-04 19:20:49 +02:00
LibCore LibCore: Tighten EventLoop current-loop checks 2026-06-05 09:18:39 +02:00
LibCrypto LibCrypto: Restore cached tag when a failed ASN1 read is rolled back 2026-06-09 08:02:44 +01:00
LibDatabase Meta: Move most dependency checks to check_for_dependencies.cmake 2026-04-20 16:41:29 -06:00
LibDevTools LibWeb+LibDevTools: Link style rules to CSS sources 2026-06-04 20:54:33 +01:00
LibDiff CMake: Rename serenity_* helper functions/macros to ladybird_* 2025-07-03 23:19:41 +02:00
LibDNS LibWeb: Use direct references to main event loops 2026-06-05 09:18:39 +02:00
LibFileSystem LibFileSystem: Preserve copy flags when recursing into directories 2026-04-13 12:00:52 +02:00
LibGC Meta: Enable exit-time destructor warnings for libraries 2026-06-04 19:20:49 +02:00
LibGfx LibImageDecoders: Decode GIFs using wuffs 2026-06-10 20:29:11 +02:00
LibHTTP LibURL: Use libpsl for public suffix matching 2026-06-10 11:43:44 +02:00
LibImageDecoderClient LibImageDecoderClient: Remove sync id fetch from async decode request 2026-02-28 00:04:06 -06:00
LibImageDecoders LibImageDecoders: Decode GIFs using wuffs 2026-06-10 20:29:11 +02:00
LibIPC LibIPC: Remove unused Stub name member 2026-05-26 09:02:03 +02:00
LibJS LibJS: Isolate object property storage 2026-06-10 17:36:54 +02:00
LibMain AK: Expose helpers to invoke Windows runtime config directly in main() 2025-10-29 21:07:52 -06:00
LibMedia LibMedia+LibWeb: End media element playback based on the pipeline EOS 2026-06-11 05:49:14 -05:00
LibRegex LibURL: Implement URLPattern in Rust 2026-05-28 09:27:41 +02:00
LibRequests LibRequests+RequestServer: Send oversized ws frames via shared memory 2026-05-27 09:52:34 +02:00
LibSandbox LibSandbox: Add macOS service sandboxing 2026-06-10 21:16:41 +02:00
LibSync LibSync: Implement ConditionVariable::wait_for(Duration) 2026-05-22 09:30:10 -05:00
LibSyntax LibSyntax+LibJS+LibWebView: Port the syntax highlighter to UTF-8 2026-06-06 18:42:18 +02:00
LibTest LibGC: Defer per-block madvise to a global background worker 2026-05-07 20:09:05 +02:00
LibTextCodec LibJS: Hash encoded source identity in bytecode cache 2026-06-03 14:11:23 +02:00
LibThreading LibThreading: Remove BackgroundAction 2026-06-05 20:00:12 +02:00
LibTLS Meta: Move most dependency checks to check_for_dependencies.cmake 2026-04-20 16:41:29 -06:00
LibUnicode LibUnicode: Remove unused UTF-32 segmenter support 2026-06-06 18:42:18 +02:00
LibURL LibWebView: Add about:history to view, query and mangage browser history 2026-06-10 20:27:36 +02:00
LibWasm LibWasm: Require virtual storage for wasm32 memory 2026-06-10 17:34:16 +02:00
LibWeb LibWeb: Track connected SVG use elements in a per-document list 2026-06-11 15:28:59 +02:00
LibWebSocket LibWebSocket: Time out stalled close handshakes 2026-05-05 19:14:29 +02:00
LibWebView LibWebView+UI: Add a small history application menu 2026-06-10 20:27:36 +02:00
LibXML Meta: Move most dependency checks to check_for_dependencies.cmake 2026-04-20 16:41:29 -06:00
CMakeLists.txt LibGfx: Split image decoders into a separate library 2026-06-10 11:55:48 +02:00
RustAllocator.rs Rust: Set import granularity to Item 2026-05-28 06:52:18 +02:00