Bug 1838670 - Match parent selector like :scope. r=zrhoffman

https://drafts.csswg.org/css-nesting-1/#nest-selector:

    When used in any other context, it represents the same elements as
    :scope in that context (unless otherwise defined).

Differential Revision: https://phabricator.services.mozilla.com/D181119
This commit is contained in:
Emilio Cobos Álvarez 2023-06-16 15:22:31 +00:00
parent 61ab1463b6
commit 698a78bf91
2 changed files with 1 additions and 9 deletions

View File

@ -859,9 +859,7 @@ where
.nest(|context| matches_complex_selector(selector.iter(), element, context))
})
},
// These should only work at parse time, should be replaced with :is() at CascadeData build
// time.
Component::ParentSelector => false,
Component::ParentSelector |
Component::Scope => match context.shared.scope_element {
Some(ref scope_element) => element.opaque() == *scope_element,
None => element.is_root(),

View File

@ -1,6 +0,0 @@
[top-level-is-scope.html]
[& as direct ancestor]
expected: FAIL
[& matches scoped element only, not everything]
expected: FAIL