-
Notifications
You must be signed in to change notification settings - Fork 730
Description
In describing scope proximity in terms of cascade precedence, the spec mentions:
When comparing declarations that appear in style rules with different scoping roots, then the declaration with the fewest generational or sibling-element hops between the scoping root and the scoped style rule subject wins.
Elements being in scope is a purely ancestor-descendant affair, so the mention of sibling hops doesn't make sense to me. Sibling of a scope root would, by definition, be not in scope. One possible interpretation would be to count sibling and ancestor hops for the matched selector, but I'm not sure how useful/intuitive that is. Also, I don't think any supported browser does that, given the below example always uses green:
<!DOCTYPE html>
<style>
@scope(.scope-start-1) {
.styled {
color: blue;
}
}
@scope(.scope-start-2) {
.sibling + .sibling + .sibling + .sibling + .styled {
color: green;
}
}
</style>
<div class="scope-start-1">
<div class="scope-start-2">
<div class="sibling"></div>
<div class="sibling"></div>
<div class="sibling"></div>
<div class="sibling"></div>
<div class="styled">What color?</div>
</div>
</div>
In short - Should the reference to "sibling hops" be removed?
Metadata
Metadata
Assignees
Type
Projects
Status