- From: L. David Baron via GitHub <sysbot+gh@w3.org>
- Date: Fri, 13 Sep 2024 20:45:14 +0000
- To: public-css-archive@w3.org
dbaron has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-cascade] may need to define cascading order between sibling encapsulation contexts == The cascading spec [defines](https://drafts.csswg.org/css-cascade-5/#cascade-sort) cascading by encapsulation context as: > When comparing two declarations that are sourced from different [encapsulation contexts](https://drafts.csswg.org/css-cascade-5/#encapsulation-contexts), then for [normal](https://drafts.csswg.org/css-cascade-5/#normal) rules the declaration from the outer context wins, and for [important](https://drafts.csswg.org/css-cascade-5/#important) rules the declaration from the inner context wins. For this purpose, [[DOM]](https://drafts.csswg.org/css-cascade-5/#biblio-dom) [tree contexts](https://drafts.csswg.org/css-scoping-1/#tree-context) are considered to be nested in [shadow-including tree order](https://dom.spec.whatwg.org/#concept-shadow-including-tree-order). This doesn't say what happens when comparing declarations from encapsulation contexts that are not directly inside or outside of each other. I don't think this is relevant in CSS today. However if either of the following happens: * we define `::part()` as a part-like pseudo-element in #10794 and thus allow it after `::slotted()` * we make a `/slotted/` combinator as discussed in #7922 then I think we need to define the cascading order between sibling encapsulation context. For example, if you have an element A (with a shadow DOM that exposes a part P) that is itself slotted into the shadow DOM of a different element B, then this would be needed to define how a regular style styling the P element inside the A shadow DOM cascades with a `::slotted()::part()` style inside of the B shadow DOM that styles the same element. Maybe the reference to shadow-including-tree-order is intended to define this, but if it is it probably needs language more specific than "inside" and "outside". (It might be both extra implementation complexity and possibly also a source of author confusion if the rules from sibling encapsulation contexts mix with each other as thought they're at the same "context" level.) Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10889 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 13 September 2024 20:45:15 UTC