Commit Graph

6 Commits

Author SHA1 Message Date
thislooksfun
271f3c9bdd LibWeb/CSS: Evaluate media queries in shadow roots
This fixes a rendering issue on https://prodengi.kz/ that someone on
Discord reported. :^)

(cherry picked from commit 0b775da7c72a85c099f35d8caf2e7b66721a4483)
2024-11-25 08:50:54 -05:00
Andreas Kling
cfa323ed6e LibWeb: Let style elements remember which StyleSheetList they live in
Instead of trying to locate the relevant StyleSheetList on style element
removal from the DOM, we now simply keep a pointer to the list instead.

This fixes an issue where using attachShadow() on an element that had
a declarative shadow DOM would cause any style elements present to use
the wrong StyleSheetList when removing themselves from the tree.

(cherry picked from commit 8543b8ad6a4d96bd0c247052572b8c2abf3929a7)
2024-11-10 10:46:01 -05:00
Andreas Kling
ad90326a6c LibWeb: Make CSS :hover selector match shadow-inclusive ancestors
Before this change, :hover wouldn't match anything outside the shadow
boundary when hovering elements inside a shadow tree. This was most
noticeable when hovering the text inside an input element and hover
styles disappearing from the hosting input element itself.

(cherry picked from commit 84ab8bf7973147d054a99445943b9da930ceb0a2)
2024-11-09 07:29:52 -05:00
Andreas Kling
94c1066f68 LibWeb: Inherit CSS variables across shadow boundaries
This fixes a bunch of issues on https://wpt.fyi/

(cherry picked from commit de2b9eebe6012e321c85cdae0ca14b4be40de624)
2024-07-28 07:33:15 -04:00
Andreas Kling
c17f7c84ef LibWeb: Use correct scope when removing style sheet inside a shadow tree
Before this change, removing a style element from inside a shadow tree
would cause it to be unregistered with the document-level list of sheets
instead of the shadow-root-level list.

This would eventually lead to a verification failure if someone tried to
update the text contents of that style element, since it was still in
the shadow-root-level list, but now with a null owner element.

Fixes a crash on https://www.swedbank.se/

(cherry picked from commit 3b7534b3628641244b0998fd5061c6fa75a61cf5)
2024-07-23 08:15:57 -04:00
Andreas Kling
f1dcf567e4 Tests: Add a basic test for Declarative Shadow DOM
(cherry picked from commit 7ce350b8c069c13540c50631413b2150bab967d4)
2024-06-26 08:48:11 +02:00