aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko/selector_parser.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2023-05-17 18:18:29 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-11-24 08:57:14 +0100
commit7c4ec6e9cc2970df7cf127c42e5aa3165d15902f (patch)
tree8f4cd534d903df785a263d80cf0485251c1ceed5 /components/style/gecko/selector_parser.rs
parentb92440ef7c38a453ef76dba53ecd9ef90c4676af (diff)
downloadservo-7c4ec6e9cc2970df7cf127c42e5aa3165d15902f.tar.gz
servo-7c4ec6e9cc2970df7cf127c42e5aa3165d15902f.zip
style: [css-nesting] Do a first pass at parsing nested rules mixed with declarations
Plumb everything up. This factors out declaration and rule parsing so we share the code with the regular declaration parser. This could be made a bit nicer in the future. We need to decide what to do for @page and @keyframe (it seems conditional rules inside ought to work, but that's not so easy because per spec we create a nested style rule). But this is a first pass that passes a good chunk of the tests. There are other fixups to cssom, and I think some of the tests we fail are actually wrong... Differential Revision: https://phabricator.services.mozilla.com/D178266
Diffstat (limited to 'components/style/gecko/selector_parser.rs')
-rw-r--r--components/style/gecko/selector_parser.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs
index 3ec9fbd0c0e..9be8bf6623d 100644
--- a/components/style/gecko/selector_parser.rs
+++ b/components/style/gecko/selector_parser.rs
@@ -311,6 +311,10 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
type Impl = SelectorImpl;
type Error = StyleParseErrorKind<'i>;
+ fn parse_parent_selector(&self) -> bool {
+ static_prefs::pref!("layout.css.nesting.enabled")
+ }
+
#[inline]
fn parse_slotted(&self) -> bool {
true