ladybird/Libraries/LibWeb
sideshowbarker 4696a1ed97 LibWeb: Avoid a crash in Selection.containsNode() with a detached range
Problem: Selection.containsNode() crashes when the selection’s range
has boundary points in a tree that’s not connected — such as a shadow
tree whose host was removed. We also call that function internally for
content-visibility:auto elements during rendering — so it can cause a
page to crash even when the page itself doesn’t use the Selection API.

Cause: When a shadow host is removed, a selection range whose boundary
points are inside its shadow tree isn’t adjusted: live-range adjustment
matches ranges by regular-tree descendant and doesn’t reach into shadow
trees. The range is left pointing into the detached shadow tree.
contains_node() verifies only the passed node against the document — not
the range — then runs a boundary-point comparison that requires both
sides to share a shadow-including root.

Fix: Make contains_node() also confirm the range’s boundary points are
rooted at the document. If not, then return false — because a node can’t
be contained in a selection whose range is in a different tree.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/9469
2026-05-22 16:39:25 +02:00
..
Animations LibWeb: Dispatch events for CSS animations without timelines 2026-05-22 11:59:19 +01:00
ARIA
Bindings LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
Clipboard LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
Compositor LibWeb+WebContent: Route compositor through in-process IPC 2026-05-21 11:45:06 +01:00
Compression LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
ContentSecurityPolicy LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
CookieStore LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
CredentialManagement LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Crypto LibWeb: Treat raw-public key format as raw for all asymmetric algorithms 2026-05-12 13:58:38 +02:00
CSS LibWeb/CSS: Mark @scope as a supported at-rule 2026-05-22 13:12:27 +01:00
DOM LibWeb: Use correct event type for cancelled CSS transition 2026-05-22 11:59:19 +01:00
DOMURL LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Editing LibGC: Default-construct ConservativeVector from the global heap 2026-05-20 20:37:55 +02:00
Encoding LibTextCodec: Stop buffering invalid UTF-8 tails 2026-05-18 14:08:22 +02:00
EncryptedMediaExtensions LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
EntriesAPI LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
EventTiming LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Fetch LibWeb: Thread request context into ContentBlocker 2026-05-21 21:16:56 +02:00
FileAPI LibJS+LibWeb: Allow instantiating DataBlock with an external buffer 2026-05-10 16:41:42 +02:00
Fullscreen LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Gamepad LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
Geolocation LibWeb: Support Geolocation permission 2026-05-11 21:01:01 +02:00
Geometry LibWeb: Make TransformationSV::to_matrix infallible 2026-05-21 17:07:58 +01:00
GPC
HighResolutionTime LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
HTML LibWeb: Avoid relayout for definite-size image updates 2026-05-22 15:09:29 +02:00
IndexedDB LibGC: Default-construct ConservativeVector from the global heap 2026-05-20 20:37:55 +02:00
Infra
Internals LibWeb: Dispatch events for CSS animations without timelines 2026-05-22 11:59:19 +01:00
IntersectionObserver LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Layout LibWeb: Allow button content boxes to shrink below intrinsic height 2026-05-21 19:34:45 +01:00
Loader LibWeb: Add cosmetic rules to ContentBlocker 2026-05-21 21:16:56 +02:00
MathML LibWeb: Rename HTMLOrSVGElement to HTMLOrSVGOrMathMLElement 2026-05-06 17:42:36 +01:00
MediaCapabilitiesAPI LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
MediaCapture LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
MediaSourceExtensions LibMedia+LibWeb: Speculatively find keyframes near fast seek targets 2026-05-13 02:05:35 -05:00
MimeSniff
MixedContent LibWeb: Reduce recompilation impact of DOM/Document.h 2026-02-11 20:02:28 +01:00
NavigationTiming LibWeb: Fix PerformanceTiming getters producing wrong wall clock values 2026-05-19 19:22:11 +02:00
NotificationsAPI LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Page LibWeb: Update hover after async scrolling stops 2026-05-22 14:33:39 +02:00
Painting LibWeb: Avoid relayout for definite-size image updates 2026-05-22 15:09:29 +02:00
PerformanceTimeline LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
PermissionsAPI LibWeb: Support Geolocation permission 2026-05-11 21:01:01 +02:00
PermissionsPolicy LibWeb/PermissionsPolicy: Allow autoplay of file:// media from file:// 2026-03-01 01:04:10 +01:00
Platform LibWeb: Keep active platform timers alive during GC 2026-05-10 10:58:11 +02:00
ReferrerPolicy
RequestIdleCallback LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ResizeObserver LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
ResourceTiming LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Rust LibWeb: Replace the HTML tokenizer with Rust 2026-05-15 21:01:40 +02:00
SecureContexts LibWebView: Add bookmark import/export to about:bookmarks 2026-04-22 08:02:15 -04:00
Selection LibWeb: Avoid a crash in Selection.containsNode() with a detached range 2026-05-22 16:39:25 +02:00
Serial LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ServiceWorker LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
Speech LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
SRI
StorageAPI LibWeb: Implement legacy-clone of session storage shed on window.open 2026-05-18 16:38:15 +02:00
Streams LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
SVG LibWeb: Make TransformationSV::to_matrix infallible 2026-05-21 17:07:58 +01:00
TrustedTypes LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
UIEvents LibWeb: Populate platform mouse event data 2026-05-19 11:22:02 +02:00
URLPattern LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
UserTiming LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ViewTransition LibWeb: Make DOM::PseudoElement abstract 2026-05-21 14:26:22 +01:00
WebAssembly LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
WebAudio LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
WebDriver LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
WebGL LibJS+LibWeb: Allow instantiating DataBlock with an external buffer 2026-05-10 16:41:42 +02:00
WebIDL LibJS+LibWeb: Use the unified Visitor for Variant-holding members 2026-05-15 08:51:17 +02:00
WebSockets LibJS+LibWeb: Allow instantiating DataBlock with an external buffer 2026-05-10 16:41:42 +02:00
WebVTT LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
WebXR LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Worker LibWeb: Keep worker startup reachable until script load completes 2026-04-27 18:02:49 +02:00
XHR LibGC: Default-construct ConservativeVector from the global heap 2026-05-20 20:37:55 +02:00
XLink
XML LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
XPath LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
CMakeLists.txt LibWeb/CSS: Implement the @scope rule 2026-05-22 10:00:42 +01:00
Dump.cpp LibWeb: Rename use_pseudo_element 2026-05-21 14:26:22 +01:00
Dump.h LibWeb: Rename show_cascaded_properties flag in dump_tree() 2026-05-05 16:02:23 +02:00
Forward.h LibWeb/CSS: Implement the @scope rule 2026-05-22 10:00:42 +01:00
GraphemeEdgeTracker.cpp LibWeb: Use the ASCII line segmenter for eligible text 2026-05-05 18:59:07 +02:00
GraphemeEdgeTracker.h LibWeb: Expose GraphemeEdgeTracker's find_line_start/find_line_end 2026-02-06 14:18:10 +00:00
idl_files.cmake LibWeb/CSS: Implement the @scope rule 2026-05-22 10:00:42 +01:00
InvalidateDisplayList.h
Namespace.cpp
Namespace.h
PixelUnits.cpp LibIPC: Support DistinctNumeric serialization 2026-05-21 11:45:06 +01:00
PixelUnits.h LibIPC: Support DistinctNumeric serialization 2026-05-21 11:45:06 +01:00
RefCountedTreeNode.h LibWeb: Add RefCountedTreeNode 2026-05-07 15:03:44 +02:00
TraversalDecision.h
TraversalOrder.h
TreeNode.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00