ladybird/Tests/LibWeb/Crash/CSS
Andreas Kling 3cf24872c4 LibWeb: Fix crash removing link stylesheet nested in a shadow tree
HTMLLinkElement::removed_from() used `old_root` to find the
StyleSheetList to remove the link's stylesheet from. That's wrong
when the link element lives inside a shadow tree that is itself
nested within a larger removed subtree: Node::remove() hands every
shadow-including descendant the outer subtree's root as `old_root`,
not the descendant's own containing root. So we'd look in the
document's list while the sheet was actually in the shadow root's
list, failing the did_remove VERIFY in StyleSheetList::remove_sheet.

Fix by using the sheet's own owning-root tracking. A link-owned sheet
always has exactly one owning document or shadow root (only constructed
stylesheets can be adopted, and link sheets are never constructed), so
we can just read that entry.

Also make owning_documents_or_shadow_roots() return by const reference
instead of copying the HashTable on every call, which benefits existing
iterating callers too.

Fixes a crash on https://nytimes.com/.
2026-04-23 22:37:06 +02:00
..
animated-revert-shorthand.html LibWeb: Resolve CSS-wide keywords in keyframe properties 2025-08-27 14:50:58 +02:00
animation-duration-auto.html LibWeb: Propagate 'auto' value of animation-duration 2025-11-28 13:24:11 +00:00
animation-play-without-timeline.html LibWeb: Always use timeline time for animation pending task ready time 2025-12-23 14:54:22 +01:00
animation-subtree-append-unstyled-child.html LibWeb: Skip unstyled descendants in animation updates 2026-04-22 10:14:47 +02:00
backdrop-display-none.html LibWeb/Layout: Replace existing ::backdrop layout nodes when necessary 2026-01-22 13:52:31 +00:00
calculated-stroke-dash-array-with-percentage.html LibWeb: Resolve stroke-dasharray percentages as lengths 2025-10-07 10:19:26 +01:00
canvas-color-mix.html LibWeb: Normalize color-mix() percentages at resolution time 2026-03-31 21:02:57 +02:00
canvas-filter-relative-units.html LibWeb: Absolutize parsed canvas filter value 2026-02-16 12:09:23 +00:00
color-mix-with-no-color-space.html LibWeb/CSS: Don't assume that we consumed a color space token 2026-02-14 19:54:51 +00:00
counter-definition-with-relative-units.html LibWeb: Add absolutized method to CounterDefinitionsStyleValue 2025-10-07 10:50:01 +01:00
cubic-bezier-animation-reverse.html LibWeb: Use Newton-Raphson for cubic-bezier easing evaluation 2026-03-21 18:21:31 -05:00
details-slot-monospace-font-crash.html LibWeb: Fix crash in style inheritance for pseudo-element slots 2026-02-14 14:36:21 -05:00
font-face-dom-parser.html LibWeb: Resolve relative lengths in @font-face using correct viewport 2025-10-16 10:27:32 +01:00
font-face-set-loading-with-binary-data.html LibWeb: Ensure execution context exists for FontFace loading task 2026-03-03 11:25:49 +01:00
getComputedStyle-detached-document-body.html LibWeb: Avoid style computation if document is detached 2026-03-19 14:17:46 +01:00
getComputedStyle-detached-document.html LibWeb: Avoid style computation if document is detached 2026-03-19 14:17:46 +01:00
grid-shorthand-var.html LibWeb: Include grid-auto-* longhands in grid shorthand parsing 2026-02-09 17:36:12 +01:00
height-calc-infinity-result.html
imported-style-sheet-loading-font-without-document.html LibWeb: Dont load a style sheet's fonts until it has an owning document 2025-10-16 10:27:32 +01:00
interpolated-calculated-multi-argument-rotate.html LibWeb: Handle calc in multi-argument rotate property interpolation 2025-11-23 09:43:24 +01:00
IntersectionObserver-rootMargin-invalid-unit.html LibWeb: Don't crash if IntersectionObserver root margin has invalid unit 2025-12-16 11:22:59 +00:00
large-value-abspos-font-size.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-abspos-padding.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-abspos-transform.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-flex-margin.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-grid-padding.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-grid-spanning-tracks.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
large-value-table-border-box.html LibWeb: Clamp saturated CSSPixels values before make_definite() 2026-03-11 17:23:35 +01:00
link-pseudo-class-invalidation.html LibWeb: Do includes_properties_from_invalidation_set() for :link & co 2025-02-09 15:20:53 +01:00
link-stylesheet-in-shadow-root-removed-with-outer-subtree.html LibWeb: Fix crash removing link stylesheet nested in a shadow tree 2026-04-23 22:37:06 +02:00
mask-parsing-shorthand-multi-layer-mask-clip.html LibWeb/CSS: Do not crash when parsing some multi-layer mask shorthands 2025-10-28 23:50:46 -07:00
media-query-evaluation-without-window.html LibWeb: Avoid crash evaluating media query in document lacking window 2025-10-17 18:24:59 +02:00
negative-mathsize-border-width.html LibWeb: Reject negative mathsize presentational hint values 2026-03-17 09:43:59 +01:00
scrollbar-color-mix.html LibWeb: Absolutize ScrollbarColorStyleValue color values 2026-03-31 21:02:57 +02:00
shadow-color-mix.html LibWeb: Absolutize color in ShadowStyleValue 2026-03-31 21:02:57 +02:00
stroke-dasharray-calculated-number-value.html LibWeb: Support calculated number values for stroke-dasharray 2026-02-12 10:26:43 +00:00
table-border-spacing-calc.html LibWeb: Don't crash when border-spacing is set to a calc() value 2025-03-21 08:16:30 +00:00
transform-function-number-percentage-transition.html LibWeb: Handle calc percentages when interpolating scale function 2025-11-16 22:50:01 +01:00
transitioned-custom-property.html LibWeb: Dont try to transition custom properties 2025-11-11 07:53:41 +00:00
vertical-writing-mode-cursor.html LibWeb: Don't crash when painting cursor in a vertical writing mode 2026-02-11 00:29:50 +01:00
view-transition-crash.html LibWeb: Prevent view transition crashes due to lack of execution context 2025-11-19 10:58:29 -05:00
view-transition-skip-no-execution-context.html LibWeb: Ensure JS execution context exists in view transition callbacks 2026-02-15 02:49:56 +01:00
view-transition-throwing-callback.html LibWeb: Detect promise-returning IDL callbacks correctly 2026-03-12 10:38:43 +01:00
width-calc-infinity-result.html
word-spacing-percentage.html LibWeb: Support percentages in word-spacing 2025-08-05 11:43:55 +01:00