Closed
Description
Current WPT test for scoped styles' specificity seems to assume that an unscoped rule has the same specificity as the identically written out scoped rule.
However, the spec's example seems to imply that :scope <descendant-combinator>
is implicitly added, and that :scope
's specificity is equal to that of other pseudo-classes (i.e. class-like +1).
WebKit and Blink are shipping the behaviour matching the WPT.
This leads to behaviours where functionally-identical selectors with explicitly-added :scope
selector wins despite the ordering. In the example below, WebKit and Chrome both show .foo
being purple:
<!doctype html>
<style>
.foo { color: green }
@scope (:root) {
:scope .foo { color: purple }
.foo { color: blue }
}
</style>
<div class="foo">Color?</div>
Metadata
Metadata
Assignees
Type
Projects
Status
Tuesday afternoon