Open dbaron opened 2 months ago
Ooh, didn't realize that was potentially possible. Yeah, I think just using shadow-including tree order is the way; that's a superset of the existing in/out relationship.
The CSS Working Group just discussed [css-cascade] may need to define cascading order between sibling encapsulation contexts
.
The cascading spec defines cascading by encapsulation context as:
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:
::part()
as a part-like pseudo-element in #10794 and thus allow it after::slotted()
/slotted/
combinator as discussed in #7922then 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.)