ladybird/Tests/LibWeb/Layout/input/host-pseudo-class-basic.html
Andreas Kling 4c326fc5f6 LibWeb: Implement :host and :host(<compound-selector>) selector matching
The :host family of pseudo class selectors select the shadow host
element when matching against a rule from within the element's shadow
tree.

This is a bit convoluted due to the fact that the document-level
StyleComputer keeps track of *all* style rules, and not just the
document-level ones.

In the future, we should refactor style storage so that shadow roots
have their own style scope, and we can simplify a lot of this.
2024-07-23 18:03:46 +02:00

4 lines
260 B
HTML

<!doctype html><body><template shadowrootmode="open"><main><div><template shadowrootmode="open"><style>
:host { display: inline-block; border: 5px solid red; }
:host(div) { padding: 10px; }
</style><span>hello :host and :host(&lt;compound-selector&gt;)</span>