mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
style: [css-nesting] Parse parent selector
This parses the ampersand as a parent selector behind an (off-by-default) selectors feature. The plan is to call replace_parent_selector while we're doing the CascadeData rebuilds, which is where we can have all the ancestor nesting information. No behavior change. Differential Revision: https://phabricator.services.mozilla.com/D167237
This commit is contained in:
parent
b024f5b2e7
commit
29c6094c80
5 changed files with 345 additions and 76 deletions
|
@ -811,6 +811,9 @@ 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::Scope => match context.shared.scope_element {
|
||||
Some(ref scope_element) => element.opaque() == *scope_element,
|
||||
None => element.is_root(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue