diff --git a/crates/swc_css_ast/src/base.rs b/crates/swc_css_ast/src/base.rs index 52057bd796f..a41d26fa0ad 100644 --- a/crates/swc_css_ast/src/base.rs +++ b/crates/swc_css_ast/src/base.rs @@ -4,7 +4,7 @@ use swc_common::{ast_node, EqIgnoreSpan, Span}; use crate::{ AlphaValue, AtRule, CalcSum, CmykComponent, Color, ComplexSelector, DashedIdent, Delimiter, Dimension, Hue, Ident, Integer, KeyframeBlock, LayerName, Number, Percentage, Ratio, - SelectorList, Str, TokenAndSpan, UnicodeRange, Url, + RelativeSelectorList, SelectorList, Str, TokenAndSpan, UnicodeRange, Url, }; #[ast_node("Stylesheet")] @@ -38,10 +38,12 @@ pub struct QualifiedRule { #[ast_node] #[derive(Eq, Hash, Is, EqIgnoreSpan)] pub enum QualifiedRulePrelude { - #[tag("ListOfComponentValues")] - ListOfComponentValues(ListOfComponentValues), #[tag("SelectorList")] SelectorList(SelectorList), + #[tag("RelativeSelectorList")] + RelativeSelectorList(RelativeSelectorList), + #[tag("ListOfComponentValues")] + ListOfComponentValues(ListOfComponentValues), } #[ast_node] diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index f493ab68ba5..b0e86054eec 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -93,6 +93,10 @@ where emit!(self, n); formatting_space!(self); } + QualifiedRulePrelude::RelativeSelectorList(n) => { + emit!(self, n); + formatting_space!(self); + } QualifiedRulePrelude::ListOfComponentValues(n) => { emit!( &mut *self.with_ctx(Ctx { diff --git a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/basic/output.css b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/basic/output.css index 23e36b1b1ef..2fc8cfa2078 100644 --- a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/basic/output.css +++ b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/basic/output.css @@ -24,8 +24,7 @@ .foo { color: red; @media (min-width: 480px) { - & h1, - & h2 { + & h1, & h2 { color: blue; } } diff --git a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.css b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.css index 33531f6609d..0ab2b0dba78 100644 --- a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.css +++ b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.css @@ -83,8 +83,8 @@ body:first-of-type .selector {} $property: value;color: red; } .selector { - color: red; - &property: value;} + &property: value;color: red; +} .selector { *property: value;color: red; } diff --git a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.min.css b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.min.css index face450d8f1..01650183d47 100644 --- a/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.min.css +++ b/crates/swc_css_codegen/tests/fixture/style-blocks-contents/hacks/output.min.css @@ -1 +1 @@ -.selector:not(*:root){}@media screen and (min-width:0\0){}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media \\0 screen {}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}body:empty .selector{}body:last-child .selector,x:-moz-any-link{}@media \0 all{}body:last-child .selector,x:-moz-any-link,x:default{}body:not(:-moz-handler-blocked) .selector{}@media screen and (-moz-images-in-menus:0){}@media screen and (min--moz-device-pixel-ratio:0){}_::-moz-progress-bar,body:last-child .selector{}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:.001dpcm){}@media all and (-moz-images-in-menus:0)and (min-resolution:.001dpcm){}@media all and (min--moz-device-pixel-ratio:0){@media(min-width:0px){}}@media all and (-moz-images-in-menus:0){@media(min-width:0px){}}@supports(-moz-appearance:meterbar){}_::-moz-range-track,body:last-child .selector{}@supports(-moz-appearance:meterbar)and (display:flex){}@supports(-moz-appearance:meterbar)and (cursor:zoom-in){}@supports(-moz-appearance:meterbar)and (background-attachment:local){}@supports(-moz-appearance:meterbar)and (image-orientation:90deg){}@supports(-moz-appearance:meterbar)and (all:initial){}@supports(-moz-appearance:meterbar)and (list-style-type:japanese-formal){}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:30dpcm){}@supports(-moz-appearance:meterbar)and (background-blend-mode:difference,normal){}_:-moz-tree-row(hover),.selector{}_::selection,.selector:not([attr*=""]){}@supports(-webkit-appearance:none){}* html .selector{}.unused-class.selector{}html>body .selector{}*:first-child+html .selector{}.selector,x:-ie7{}*+html .selector{}body *.selector{}.selector\ {}html>body .selector{}head~body .selector{}_::selection,.selector:not([attr*=""]){}:root .selector{}body:last-child .selector{}body:nth-of-type(1) .selector{}body:first-of-type .selector{}.selector:not([attr*=""]){}.selector{_property:value}.selector{-property:value}.selector{property:value\9}.selector{property:value\9}.selector{!property: value;color:red}.selector{$property: value;color:red}.selector{color:red;&property: value;}.selector{*property: value;color:red}.selector{)property: value;color:red}.selector{=property: value;color:red}.selector{%property: value;color:red}.selector{+property: value;color:red}.selector{color:red;@property: value;}.selector{,property: value;color:red}.selector{.property: value;color:red}.selector{/property: value;color:red}.selector{`property: value;color:red}.selector{]property: value;color:red}.selector{#property: value;color:red}.selector{~property: value;color:red}.selector{?property: value;color:red}.selector{:property: value;color:red}.selector{|property: value;color:red}.selector{property:value !ie}@media screen\9{}@media \0screen\,screen\9 {}@media \0screen{}@media screen and (min-width:0\0){}_:-ms-input-placeholder,:root .selector{}_:-ms-fullscreen,:root .selector{}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){}@media screen{@media(min-width:0px){}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}html:first-child .selector{}_:-o-prefocus,body:last-child .selector{}@media all and (-webkit-min-device-pixel-ratio:1e4),not all and (-webkit-min-device-pixel-ratio:0){}@media(min-resolution:.001dpcm){_:-o-prefocus,.selector{}}*|html[xmlns*=""] .selector{}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media screen and (min-width:0\0){}@media screen{@media(min-width:0px){}}html:first-child .selector{}html[xmlns*=""] body:last-child .selector{}html[xmlns*=""]:root .selector{}*|html[xmlns*=""] .selector{}_::-moz-svg-foreign-content,:root .selector{}@media \\0 screen {}a{*color : black;_background:white;font-size:big;$(var)-size: 100%;}a{*b:c}div{color:red}selector{property:value;property:normal-value}div{color:red} +.selector:not(*:root){}@media screen and (min-width:0\0){}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media \\0 screen {}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}body:empty .selector{}body:last-child .selector,x:-moz-any-link{}@media \0 all{}body:last-child .selector,x:-moz-any-link,x:default{}body:not(:-moz-handler-blocked) .selector{}@media screen and (-moz-images-in-menus:0){}@media screen and (min--moz-device-pixel-ratio:0){}_::-moz-progress-bar,body:last-child .selector{}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:.001dpcm){}@media all and (-moz-images-in-menus:0)and (min-resolution:.001dpcm){}@media all and (min--moz-device-pixel-ratio:0){@media(min-width:0px){}}@media all and (-moz-images-in-menus:0){@media(min-width:0px){}}@supports(-moz-appearance:meterbar){}_::-moz-range-track,body:last-child .selector{}@supports(-moz-appearance:meterbar)and (display:flex){}@supports(-moz-appearance:meterbar)and (cursor:zoom-in){}@supports(-moz-appearance:meterbar)and (background-attachment:local){}@supports(-moz-appearance:meterbar)and (image-orientation:90deg){}@supports(-moz-appearance:meterbar)and (all:initial){}@supports(-moz-appearance:meterbar)and (list-style-type:japanese-formal){}@media all and (min--moz-device-pixel-ratio:0)and (min-resolution:30dpcm){}@supports(-moz-appearance:meterbar)and (background-blend-mode:difference,normal){}_:-moz-tree-row(hover),.selector{}_::selection,.selector:not([attr*=""]){}@supports(-webkit-appearance:none){}* html .selector{}.unused-class.selector{}html>body .selector{}*:first-child+html .selector{}.selector,x:-ie7{}*+html .selector{}body *.selector{}.selector\ {}html>body .selector{}head~body .selector{}_::selection,.selector:not([attr*=""]){}:root .selector{}body:last-child .selector{}body:nth-of-type(1) .selector{}body:first-of-type .selector{}.selector:not([attr*=""]){}.selector{_property:value}.selector{-property:value}.selector{property:value\9}.selector{property:value\9}.selector{!property: value;color:red}.selector{$property: value;color:red}.selector{&property: value;color:red}.selector{*property: value;color:red}.selector{)property: value;color:red}.selector{=property: value;color:red}.selector{%property: value;color:red}.selector{+property: value;color:red}.selector{color:red;@property: value;}.selector{,property: value;color:red}.selector{.property: value;color:red}.selector{/property: value;color:red}.selector{`property: value;color:red}.selector{]property: value;color:red}.selector{#property: value;color:red}.selector{~property: value;color:red}.selector{?property: value;color:red}.selector{:property: value;color:red}.selector{|property: value;color:red}.selector{property:value !ie}@media screen\9{}@media \0screen\,screen\9 {}@media \0screen{}@media screen and (min-width:0\0){}_:-ms-input-placeholder,:root .selector{}_:-ms-fullscreen,:root .selector{}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){}@media screen{@media(min-width:0px){}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}html:first-child .selector{}_:-o-prefocus,body:last-child .selector{}@media all and (-webkit-min-device-pixel-ratio:1e4),not all and (-webkit-min-device-pixel-ratio:0){}@media(min-resolution:.001dpcm){_:-o-prefocus,.selector{}}*|html[xmlns*=""] .selector{}@media all and (-webkit-min-device-pixel-ratio:0)and (min-resolution:.001dpcm){.selector{}}.selector:not(*:root){}@supports(-webkit-appearance:none){}.selector{(;property: value;);}.selector{[;property: value;];}@media screen and (min-width:0\0){}@media screen{@media(min-width:0px){}}html:first-child .selector{}html[xmlns*=""] body:last-child .selector{}html[xmlns*=""]:root .selector{}*|html[xmlns*=""] .selector{}_::-moz-svg-foreign-content,:root .selector{}@media \\0 screen {}a{*color : black;_background:white;font-size:big;$(var)-size: 100%;}a{*b:c}div{color:red}selector{property:value;property:normal-value}div{color:red} diff --git a/crates/swc_css_compat/src/nesting.rs b/crates/swc_css_compat/src/nesting.rs index 6bf8cced273..45c09b1659b 100644 --- a/crates/swc_css_compat/src/nesting.rs +++ b/crates/swc_css_compat/src/nesting.rs @@ -1,12 +1,7 @@ use std::iter::once; use swc_common::{util::take::Take, DUMMY_SP}; -use swc_css_ast::{ - AtRule, AtRulePrelude, ComplexSelector, ComplexSelectorChildren, ComponentValue, - CompoundSelector, ForgivingComplexSelector, ForgivingSelectorList, PseudoClassSelector, - PseudoClassSelectorChildren, QualifiedRule, QualifiedRulePrelude, Rule, SelectorList, - SimpleBlock, StyleBlock, SubclassSelector, -}; +use swc_css_ast::*; use swc_css_visit::{VisitMut, VisitMutWith}; pub fn nesting() -> impl VisitMut { @@ -16,48 +11,6 @@ pub fn nesting() -> impl VisitMut { struct NestingHandler {} impl NestingHandler { - fn append_compound( - &mut self, - prelude: &SelectorList, - to: &mut ComplexSelector, - base: &ComplexSelector, - c: &CompoundSelector, - ) { - if c.nesting_selector.is_some() { - let len = base.children.len(); - - to.children - .extend( - base.children - .iter() - .cloned() - .enumerate() - .map(|(idx, mut children)| { - if idx == len - 1 { - if let ComplexSelectorChildren::CompoundSelector(compound) = - &mut children - { - if c.type_selector.is_some() { - compound.type_selector = c.type_selector.clone(); - } - - let mut subclass = c.subclass_selectors.clone(); - - self.process_subclass_selectors(prelude, &mut subclass); - - compound.subclass_selectors.extend(subclass); - } - } - - children - }), - ); - } else { - to.children - .push(ComplexSelectorChildren::CompoundSelector(c.clone())); - } - } - fn process_subclass_selectors( &mut self, prelude: &SelectorList, @@ -107,14 +60,11 @@ impl NestingHandler { ) { let mut new_selectors = vec![]; - // 'complex: for complex in selectors.take() { for compound in &complex.children { match compound { ComplexSelectorChildren::CompoundSelector(compound) => { if compound.nesting_selector.is_some() { - // - for prelude_children in &prelude.children { let mut new = ComplexSelector { span: Default::default(), @@ -150,14 +100,128 @@ impl NestingHandler { *selectors = new_selectors; } + fn append_compound( + &mut self, + prelude: &SelectorList, + to: &mut ComplexSelector, + base: &ComplexSelector, + c: &CompoundSelector, + ) { + if c.nesting_selector.is_some() { + let len = base.children.len(); + + to.children + .extend( + base.children + .iter() + .cloned() + .enumerate() + .map(|(idx, mut children)| { + if idx == len - 1 { + if let ComplexSelectorChildren::CompoundSelector(compound) = + &mut children + { + if c.type_selector.is_some() { + compound.type_selector = c.type_selector.clone(); + } + + let mut subclass = c.subclass_selectors.clone(); + + self.process_subclass_selectors(prelude, &mut subclass); + + compound.subclass_selectors.extend(subclass); + } + } + + children + }), + ); + } else { + to.children + .push(ComplexSelectorChildren::CompoundSelector(c.clone())); + } + } + + fn relative_selector_list_to_selector_list( + &mut self, + base: &SelectorList, + relative_selector_list: &RelativeSelectorList, + ) -> SelectorList { + let mut children = vec![]; + + for base_complex in &base.children { + for relative_selector in &relative_selector_list.children { + let mut complex_selector = ComplexSelector { + span: relative_selector.span, + children: Default::default(), + }; + + let is_non_relative = relative_selector.combinator.is_none() + && relative_selector.selector.children.iter().any(|s| match s { + ComplexSelectorChildren::CompoundSelector(s) => { + s.nesting_selector.is_some() + } + _ => false, + }); + + if let Some(combinator) = &relative_selector.combinator { + complex_selector + .children + .extend(base_complex.children.clone()); + complex_selector + .children + .push(ComplexSelectorChildren::Combinator(combinator.clone())) + } else if !is_non_relative { + complex_selector + .children + .extend(base_complex.children.clone()); + complex_selector + .children + .push(ComplexSelectorChildren::Combinator(Combinator { + span: DUMMY_SP, + value: CombinatorValue::Descendant, + })) + } + + for relative_complex_selector_children in &relative_selector.selector.children { + match relative_complex_selector_children { + ComplexSelectorChildren::CompoundSelector(compound) => { + self.append_compound( + base, + &mut complex_selector, + base_complex, + compound, + ); + } + ComplexSelectorChildren::Combinator(combinator) => { + complex_selector + .children + .push(ComplexSelectorChildren::Combinator(combinator.clone())); + } + } + } + + children.push(complex_selector); + } + } + + SelectorList { + span: relative_selector_list.span, + children, + } + } + /// Prepend current selector - fn process_prelude(&mut self, prelude: &QualifiedRulePrelude, to: &mut QualifiedRulePrelude) { + fn process_prelude(&mut self, base: &QualifiedRulePrelude, to: &mut QualifiedRulePrelude) { if let ( - QualifiedRulePrelude::SelectorList(prelude), - QualifiedRulePrelude::SelectorList(selectors), - ) = (prelude, to) + QualifiedRulePrelude::SelectorList(base), + QualifiedRulePrelude::RelativeSelectorList(relative_selector_list), + ) = (base, &to) { - self.process_complex_selectors(prelude, &mut selectors.children); + let selector_list = + self.relative_selector_list_to_selector_list(base, relative_selector_list); + + *to = QualifiedRulePrelude::SelectorList(selector_list); } } @@ -167,14 +231,21 @@ impl NestingHandler { for value in rule.block.value.take() { match value { - ComponentValue::StyleBlock(StyleBlock::QualifiedRule(mut q)) => { - self.process_prelude(&rule.prelude, &mut q.prelude); + ComponentValue::StyleBlock(StyleBlock::QualifiedRule(mut nested)) => { + self.process_prelude(&rule.prelude, &mut nested.prelude); + + nested_rules.push(Rule::QualifiedRule(nested)); - nested_rules.push(Rule::QualifiedRule(q)); continue; } ComponentValue::StyleBlock(StyleBlock::AtRule(ref at_rule)) => { - if let Some(AtRulePrelude::MediaPrelude(..)) = at_rule.prelude.as_deref() { + if let Some( + AtRulePrelude::MediaPrelude(..) + | AtRulePrelude::SupportsPrelude(..) + | AtRulePrelude::ContainerPrelude(..) + | AtRulePrelude::DocumentPrelude(..), + ) = at_rule.prelude.as_deref() + { if let Some(block) = &at_rule.block { let mut decls_of_media = vec![]; let mut nested_of_media = vec![]; @@ -183,6 +254,7 @@ impl NestingHandler { match n { ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n)) => { let mut q = n.clone(); + self.process_prelude(&rule.prelude, &mut q.prelude); let rules = self.extract_nested_rules(&mut q); @@ -209,6 +281,7 @@ impl NestingHandler { ..block.clone() }, }); + nested_of_media.insert( 0, ComponentValue::StyleBlock(StyleBlock::QualifiedRule(rule)), @@ -222,6 +295,7 @@ impl NestingHandler { }), ..*at_rule.clone() }))); + continue; } } @@ -231,6 +305,7 @@ impl NestingHandler { block_values.push(value); } + rule.block.value = block_values; nested_rules @@ -239,13 +314,15 @@ impl NestingHandler { impl VisitMut for NestingHandler { fn visit_mut_rules(&mut self, n: &mut Vec) { - n.visit_mut_children_with(self); - let mut new = vec![]; + for n in n.take() { match n { Rule::QualifiedRule(mut n) => { - let rules = self.extract_nested_rules(&mut n); + let mut rules = self.extract_nested_rules(&mut n); + + rules.visit_mut_with(self); + new.push(Rule::QualifiedRule(n)); new.extend(rules); } @@ -254,18 +331,20 @@ impl VisitMut for NestingHandler { } } } + *n = new; } fn visit_mut_component_values(&mut self, n: &mut Vec) { - n.visit_mut_children_with(self); - let mut new = vec![]; for n in n.take() { match n { ComponentValue::StyleBlock(StyleBlock::QualifiedRule(mut n)) => { - let rules = self.extract_nested_rules(&mut n); + let mut rules = self.extract_nested_rules(&mut n); + + rules.visit_mut_with(self); + new.push(ComponentValue::StyleBlock(StyleBlock::QualifiedRule(n))); new.extend(rules.into_iter().map(rule_to_component_value)); } @@ -275,6 +354,7 @@ impl VisitMut for NestingHandler { } } } + *n = new; } } diff --git a/crates/swc_css_compat/tests/nesting/basic/input.css b/crates/swc_css_compat/tests/nesting/basic/input.css index e6a3eb069a2..3c4fb2a8710 100644 --- a/crates/swc_css_compat/tests/nesting/basic/input.css +++ b/crates/swc_css_compat/tests/nesting/basic/input.css @@ -67,3 +67,242 @@ figure { color: blue; &__bar { color: red; } } + + +.foo { + color: red; + + > bar { + color: green; + + > baz { + color: blue; + } + } +} + +.foo { + color: red; + + & > bar { + color: green; + + & > baz { + color: blue; + } + } +} + +.foo { + color: red; + + &.bar { + color: green; + + &.one, &.two { + color: blue; + } + } +} + +.foo { + color: red; + + & > bar-1, & > bar-2 { + color: green; + + > baz-1, > baz-2 { + color: blue; + } + } +} + +.foo { + color: blue; + & > .bar { color: red; } + > .baz { color: green; } +} + +.foo { + color: blue; + &.bar { color: red; } +} + +.foo, .bar { + color: blue; + + .baz, &.qux { color: red; } +} + +.foo { + color: blue; + & .bar & .baz & .qux { color: red; } +} + +.foo { + color: red; + .parent & { + color: blue; + } +} + +/* TODO FIX ME */ +.foo { + color: red; + :not(&) { + color: blue; + } +} + +.foo { + color: red; + + .bar + & { color: blue; } +} + +.foo { + color: blue; + & { padding: 2ch; } +} + +.error, #id { + &:hover > .baz { color: red; } +} + +.ancestor .el { + .other-ancestor & { color: red; } +} + +figure { + margin: 0; + + > figcaption { + background: hsl(0 0% 0% / 50%); + + > p { + font-size: .9rem; + } + } +} + +/* TODO FIX ME */ +@layer base { + html { + block-size: 100%; + + & body { + min-block-size: 100%; + } + } +} + +/* TODO FIX ME */ +@layer base { + html { + block-size: 100%; + + @layer base.support { + & body { + min-block-size: 100%; + } + } + } +} + +.foo { + display: grid; + + @media (orientation: landscape) { + grid-auto-flow: column; + } +} + +/* TODO FIX ME */ +.foo { + display: grid; + + @media (orientation: landscape) { + grid-auto-flow: column; + + @media (min-width > 1024px) { + max-inline-size: 1024px; + } + } +} + +.foo { + display: grid; + + @supports (grid-auto-flow: column) { + grid-auto-flow: column; + } +} + +/* TODO FIX ME */ +.foo { + display: grid; + + @supports (grid-auto-flow: column) { + grid-auto-flow: column; + + @supports (max-inline-size: 1024px) { + max-inline-size: 1024px; + } + } +} + +.foo { + display: grid; + + @container (min-width: 700px) { + grid-auto-flow: column; + } +} + +/* TODO FIX ME */ +.foo { + display: grid; + + @container (min-width: 700px) { + grid-auto-flow: column; + + @container (min-width: 400px) { + max-inline-size: 1024px; + } + } +} + +article { + color: green; + & { color: blue; } + color: red; +} + +/* TODO FIX ME */ +.foo, .foo::before, .foo::after { + color: red; + + &:hover { color: blue; } +} + +.foo { + color: red; + + .bar { + color: blue; + } +} + +.foo { + color: red; + + [test="test"] { + color: blue; + } +} + +.foo { + color: red; + + #id { + color: blue; + } +} diff --git a/crates/swc_css_compat/tests/nesting/basic/output.css b/crates/swc_css_compat/tests/nesting/basic/output.css index a060dd237cd..3542ee38d43 100644 --- a/crates/swc_css_compat/tests/nesting/basic/output.css +++ b/crates/swc_css_compat/tests/nesting/basic/output.css @@ -31,8 +31,8 @@ table.colortable th { color: blue; } .foo + .baz, -.bar + .baz, .foo.qux, +.bar + .baz, .bar.qux { color: red; } @@ -73,3 +73,228 @@ figure > figcaption > p { __bar.foo { color: red; } +.foo { + color: red; +} +.foo > bar { + color: green; +} +.foo > bar > baz { + color: blue; +} +.foo { + color: red; +} +.foo > bar { + color: green; +} +.foo > bar > baz { + color: blue; +} +.foo { + color: red; +} +.foo.bar { + color: green; +} +.foo.bar.one, +.foo.bar.two { + color: blue; +} +.foo { + color: red; +} +.foo > bar-1, +.foo > bar-2 { + color: green; +} +.foo > bar-1 > baz-1, +.foo > bar-1 > baz-2, +.foo > bar-2 > baz-1, +.foo > bar-2 > baz-2 { + color: blue; +} +.foo { + color: blue; +} +.foo > .bar { + color: red; +} +.foo > .baz { + color: green; +} +.foo { + color: blue; +} +.foo.bar { + color: red; +} +.foo, +.bar { + color: blue; +} +.foo + .baz, +.foo.qux, +.bar + .baz, +.bar.qux { + color: red; +} +.foo { + color: blue; +} +.foo .bar .foo .baz .foo .qux { + color: red; +} +.foo { + color: red; +} +.parent .foo { + color: blue; +} +.foo { + color: red; +} +.foo :not(&) { + color: blue; +} +.foo { + color: red; +} +.foo + .bar + .foo { + color: blue; +} +.foo { + color: blue; +} +.foo { + padding: 2ch; +} +.error, +#id {} +.error:hover > .baz, +#id:hover > .baz { + color: red; +} +.ancestor .el {} +.other-ancestor .ancestor .el { + color: red; +} +figure { + margin: 0; +} +figure > figcaption { + background: hsl(0 0% 0% / 50%); +} +figure > figcaption > p { + font-size: .9rem; +} +@layer base { + html { + block-size: 100%; + & body { + min-block-size: 100%; + } + } +} +@layer base { + html { + block-size: 100%; + @layer base.support { + & body { + min-block-size: 100%; + } + } + } +} +.foo { + display: grid; +} +@media (orientation: landscape) { + .foo { + grid-auto-flow: column; + } +} +.foo { + display: grid; +} +@media (orientation: landscape) { + .foo { + grid-auto-flow: column; + @media (min-width > 1024px) { + max-inline-size: 1024px; + } + } +} +.foo { + display: grid; +} +@supports (grid-auto-flow: column) { + .foo { + grid-auto-flow: column; + } +} +.foo { + display: grid; +} +@supports (grid-auto-flow: column) { + .foo { + grid-auto-flow: column; + @supports (max-inline-size: 1024px) { + max-inline-size: 1024px; + } + } +} +.foo { + display: grid; +} +@container (min-width: 700px) { + .foo { + grid-auto-flow: column; + } +} +.foo { + display: grid; +} +@container (min-width: 700px) { + .foo { + grid-auto-flow: column; + @container (min-width: 400px) { + max-inline-size: 1024px; + } + } +} +article { + color: green; + color: red; +} +article { + color: blue; +} +.foo, +.foo::before, +.foo::after { + color: red; +} +.foo:hover, +.foo::before:hover, +.foo::after:hover { + color: blue; +} +.foo { + color: red; +} +.foo .bar { + color: blue; +} +.foo { + color: red; +} +.foo [test="test"] { + color: blue; +} +.foo { + color: red; +} +.foo #id { + color: blue; +} diff --git a/crates/swc_css_compat/tests/nesting/pseudo-is/input.css b/crates/swc_css_compat/tests/nesting/pseudo-is/input.css index e0b1e5d884f..10d07a66486 100644 --- a/crates/swc_css_compat/tests/nesting/pseudo-is/input.css +++ b/crates/swc_css_compat/tests/nesting/pseudo-is/input.css @@ -1,3 +1,8 @@ .foo { &:is(.bar, &.baz) { color: red; } -} \ No newline at end of file +} + +/* TODO FIX ME */ +.foo { + & :is(.bar, &.baz) { color: red; } +} diff --git a/crates/swc_css_compat/tests/nesting/pseudo-is/output.css b/crates/swc_css_compat/tests/nesting/pseudo-is/output.css index 8ddf438ca3a..21f67f7aaeb 100644 --- a/crates/swc_css_compat/tests/nesting/pseudo-is/output.css +++ b/crates/swc_css_compat/tests/nesting/pseudo-is/output.css @@ -2,3 +2,7 @@ .foo:is(.bar, .foo.baz) { color: red; } +.foo {} +.foo :is(.bar, &.baz) { + color: red; +} diff --git a/crates/swc_css_minifier/src/compressor/rules.rs b/crates/swc_css_minifier/src/compressor/rules.rs index 87d07c91bef..a5a7560b3b6 100644 --- a/crates/swc_css_minifier/src/compressor/rules.rs +++ b/crates/swc_css_minifier/src/compressor/rules.rs @@ -155,6 +155,21 @@ impl Compressor { } } + fn merge_relative_selector_list( + &self, + left: &RelativeSelectorList, + right: &RelativeSelectorList, + ) -> RelativeSelectorList { + let mut children = left.children.clone(); + + children.extend(right.children.clone()); + + RelativeSelectorList { + span: Span::new(left.span_lo(), right.span_hi(), SyntaxContext::empty()), + children, + } + } + fn merge_simple_block(&self, left: &SimpleBlock, right: &SimpleBlock) -> SimpleBlock { let mut value = left.value.clone(); @@ -168,21 +183,31 @@ impl Compressor { } fn can_merge_qualified_rules(&self, left: &QualifiedRule, right: &QualifiedRule) -> bool { - let left_selector_list = match &left.prelude { - QualifiedRulePrelude::SelectorList(selector_list) => selector_list, - _ => return false, - }; - let right_selector_list = match &right.prelude { - QualifiedRulePrelude::SelectorList(selector_list) => selector_list, - _ => return false, - }; + match (&left.prelude, &right.prelude) { + ( + QualifiedRulePrelude::SelectorList(left_selector_list), + QualifiedRulePrelude::SelectorList(right_selector_list), + ) => { + let mut checker = CompatibilityChecker::default(); - let mut checker = CompatibilityChecker::default(); + left_selector_list.visit_with(&mut checker); + right_selector_list.visit_with(&mut checker); - left_selector_list.visit_with(&mut checker); - right_selector_list.visit_with(&mut checker); + checker.allow_to_merge + } + ( + QualifiedRulePrelude::RelativeSelectorList(left_relative_selector_list), + QualifiedRulePrelude::RelativeSelectorList(right_relative_selector_list), + ) => { + let mut checker = CompatibilityChecker::default(); - checker.allow_to_merge + left_relative_selector_list.visit_with(&mut checker); + right_relative_selector_list.visit_with(&mut checker); + + checker.allow_to_merge + } + _ => false, + } } fn try_merge_qualified_rules( @@ -197,26 +222,42 @@ impl Compressor { // Merge when declarations are exactly equal // e.g. h1 { color: red } h2 { color: red } if left.block.eq_ignore_span(&right.block) { - if let ( - QualifiedRulePrelude::SelectorList(prev_selector_list), - QualifiedRulePrelude::SelectorList(current_selector_list), - ) = (&left.prelude, &right.prelude) - { - let selector_list = - self.merge_selector_list(prev_selector_list, current_selector_list); - let mut qualified_rule = QualifiedRule { - span: Span::new( - left.span.span_lo(), - right.span.span_lo(), - SyntaxContext::empty(), - ), - prelude: QualifiedRulePrelude::SelectorList(selector_list), - block: left.block.clone(), - }; + match (&left.prelude, &right.prelude) { + ( + QualifiedRulePrelude::SelectorList(prev_selector_list), + QualifiedRulePrelude::SelectorList(current_selector_list), + ) => { + let selector_list = + self.merge_selector_list(prev_selector_list, current_selector_list); + let mut qualified_rule = QualifiedRule { + span: Span::new(left.span_lo(), right.span_hi(), SyntaxContext::empty()), + prelude: QualifiedRulePrelude::SelectorList(selector_list), + block: left.block.clone(), + }; - qualified_rule.visit_mut_children_with(self); + qualified_rule.visit_mut_children_with(self); - return Some(qualified_rule); + return Some(qualified_rule); + } + ( + QualifiedRulePrelude::RelativeSelectorList(prev_relative_selector_list), + QualifiedRulePrelude::RelativeSelectorList(current_relative_selector_list), + ) => { + let relative_selector_list = self.merge_relative_selector_list( + prev_relative_selector_list, + current_relative_selector_list, + ); + let mut qualified_rule = QualifiedRule { + span: Span::new(left.span_lo(), right.span_hi(), SyntaxContext::empty()), + prelude: QualifiedRulePrelude::RelativeSelectorList(relative_selector_list), + block: left.block.clone(), + }; + + qualified_rule.visit_mut_children_with(self); + + return Some(qualified_rule); + } + _ => {} } } @@ -225,11 +266,7 @@ impl Compressor { if left.prelude.eq_ignore_span(&right.prelude) { let block = self.merge_simple_block(&left.block, &right.block); let mut qualified_rule = QualifiedRule { - span: Span::new( - left.span.span_lo(), - right.span.span_hi(), - SyntaxContext::empty(), - ), + span: Span::new(left.span_lo(), right.span_hi(), SyntaxContext::empty()), prelude: left.prelude.clone(), block, }; diff --git a/crates/swc_css_parser/src/parser/mod.rs b/crates/swc_css_parser/src/parser/mod.rs index 4ae94a2fed0..8324e88ac32 100644 --- a/crates/swc_css_parser/src/parser/mod.rs +++ b/crates/swc_css_parser/src/parser/mod.rs @@ -41,8 +41,8 @@ pub struct ParserConfig { #[serde(default)] pub css_modules: bool, - /// If this is `true`, the nested selectors without `&` will be parsed as - /// valid selectors + /// If this is `true`, the nested selector starts with an identifier will be + /// parsed as valid selectors (i.e. `ul { color: red; li { color: blue } }`) /// /// Defaults to `false`. #[serde(default)] @@ -68,6 +68,7 @@ impl Default for BlockContentsGrammar { struct Ctx { is_top_level: bool, block_contents_grammar: BlockContentsGrammar, + mixed_with_declarations: bool, in_keyframes_at_rule: bool, in_supports_at_rule: bool, @@ -75,7 +76,6 @@ struct Ctx { in_page_at_rule: bool, in_container_at_rule: bool, in_font_feature_values_at_rule: bool, - is_trying_legacy_nesting: bool, } #[derive(Debug, Clone)] diff --git a/crates/swc_css_parser/src/parser/syntax/mod.rs b/crates/swc_css_parser/src/parser/syntax/mod.rs index 2218024d97b..37753e617cf 100644 --- a/crates/swc_css_parser/src/parser/syntax/mod.rs +++ b/crates/swc_css_parser/src/parser/syntax/mod.rs @@ -307,46 +307,34 @@ where Ok(QualifiedRulePrelude::ListOfComponentValues( list_of_component_values, )) + } else if p.ctx.mixed_with_declarations { + match p.parse_according_to_grammar::( + &list_of_component_values, + |parser| parser.parse(), + ) { + Ok(relative_selector_list) => Ok( + QualifiedRulePrelude::RelativeSelectorList(relative_selector_list), + ), + Err(err) => { + p.errors.push(err); + + Ok(QualifiedRulePrelude::ListOfComponentValues( + list_of_component_values, + )) + } + } } else { match p.parse_according_to_grammar::( &list_of_component_values, |parser| parser.parse(), ) { - Ok(selector_list) => { - if p.ctx.is_trying_legacy_nesting { - let selector_list = p - .legacy_nested_selector_list_to_modern_selector_list( - selector_list, - )?; - - Ok(QualifiedRulePrelude::SelectorList(selector_list)) - } else { - Ok(QualifiedRulePrelude::SelectorList(selector_list)) - } - } + Ok(selector_list) => Ok(QualifiedRulePrelude::SelectorList(selector_list)), Err(err) => { - if p.ctx.is_trying_legacy_nesting { - match p.parse_according_to_grammar::( - &list_of_component_values, - |parser| parser.parse(), - ) { - Ok(relative_selector_list) => { - let selector_list = p - .legacy_relative_selector_list_to_modern_selector_list( - relative_selector_list, - )?; + p.errors.push(err); - Ok(QualifiedRulePrelude::SelectorList(selector_list)) - } - _ => Err(err), - } - } else { - p.errors.push(err); - - Ok(QualifiedRulePrelude::ListOfComponentValues( - list_of_component_values, - )) - } + Ok(QualifiedRulePrelude::ListOfComponentValues( + list_of_component_values, + )) } } } @@ -369,6 +357,21 @@ where } match cur!(self) { + // + // If mixed with declarations is true, this is a parse error; return nothing. + // Otherwise, append a to the qualified rule’s prelude. + tok!(";") => { + if self.ctx.mixed_with_declarations { + return Err(Error::new( + span!(self, span.lo), + ErrorKind::EofButExpected("'{'"), + )); + } else { + let component_value = self.parse_as::()?; + + prelude.push(component_value); + } + } // <{-token> // Consume a simple block and assign it to the qualified rule’s block. Return the // qualified rule. @@ -466,13 +469,23 @@ where rules.push(StyleBlock::AtRule(Box::new(at_rule))); } // - // Initialize a temporary list initially filled with the current input token. As - // long as the next input token is anything other than a or + // + // + // + // Reconsume the current input token. Initialize a temporary list, initially empty. + // As long as the next input token is anything other than a or // , consume a component value and append it to the temporary list. // Consume a declaration from the temporary list. If anything was returned, append // it to decls. - tok!("ident") => { - if self.config.legacy_nesting { + tok!("ident") | tok!("function") => { + // Legacy nested parsing conflict with custom properties, but selectors can't + // start with `--`, so it is safe to ignore them. + // + // Constructions like `a { prop: {value}; }` still affected this problem, but + // `{`/`}` doesn't used in declarations + if self.config.legacy_nesting + && matches!(self.input.cur(), Some(Token::Ident { value, .. }) if !value.starts_with("--")) + { if let Some(legacy_nested) = self.try_to_parse_legacy_nesting() { rules.push(StyleBlock::QualifiedRule(Box::new(legacy_nested))); @@ -508,82 +521,48 @@ where declarations.push(decl_or_list_of_component_values); } - // with a value of "&" (U+0026 AMPERSAND) - // Reconsume the current input token. Consume a qualified rule. If anything was - // returned, append it to rules. - tok!("&") => { + // anything else + // Reconsume the current input token. Consume a qualified rule, with mixed with + // declarations set to true. If anything was returned, append it to rules. + _ => { let state = self.input.state(); - let qualified_rule = match self.parse() { - Ok(v) => StyleBlock::QualifiedRule(v), + let qualified_rule = self + .with_ctx(Ctx { + mixed_with_declarations: true, + ..self.ctx + }) + .parse_as::>(); + + match qualified_rule { + Ok(i) => rules.push(StyleBlock::QualifiedRule(i)), Err(err) => { self.errors.push(err); self.input.reset(&state); let span = self.input.cur_span(); - let mut children = vec![]; - while !is_one_of!(self, EOF, "}") { - if let Some(token_and_span) = self.input.bump() { - children.push(ComponentValue::PreservedToken(token_and_span)); - } + self.errors + .push(Error::new(span, ErrorKind::Unexpected("token"))); - if is!(self, ";") { - if let Some(token_and_span) = self.input.bump() { - children - .push(ComponentValue::PreservedToken(token_and_span)); - } + // For recovery mode + let mut list_of_component_values = ListOfComponentValues { + span: Default::default(), + children: vec![], + }; - break; - } + // TODO verify error recovery (copied from prev spec) + while !is_one_of!(self, ";", EOF) { + let component_value = self.parse_as::()?; + + list_of_component_values.children.push(component_value); } - StyleBlock::ListOfComponentValues(ListOfComponentValues { - span: span!(self, span.lo), - children, - }) + list_of_component_values.span = span!(self, span.lo); + + declarations + .push(StyleBlock::ListOfComponentValues(list_of_component_values)); } }; - - rules.push(qualified_rule); - } - - // anything else - // This is a parse error. Reconsume the current input token. As long as the next - // input token is anything other than a or , consume a - // component value and throw away the returned value. - _ => { - if self.config.legacy_nesting { - if let Some(legacy_nested) = self.try_to_parse_legacy_nesting() { - rules.push(StyleBlock::QualifiedRule(Box::new(legacy_nested))); - - continue; - } - } - - let span = self.input.cur_span(); - - self.errors.push(Error::new( - span, - ErrorKind::Expected( - "whitespace, semicolon, EOF, at-keyword, '&' or ident token", - ), - )); - - // For recovery mode - let mut list_of_component_values = ListOfComponentValues { - span: Default::default(), - children: vec![], - }; - - while !is_one_of!(self, ";", EOF) { - let component_value = self.parse_as::()?; - - list_of_component_values.children.push(component_value); - } - - list_of_component_values.span = span!(self, span.lo); - - declarations.push(StyleBlock::ListOfComponentValues(list_of_component_values)); } } } @@ -720,9 +699,21 @@ where fn parse(&mut self) -> PResult { // To consume a declaration: - // Consume the next input token. Create a new declaration with its name set - // to the value of the current input token and its value initially set to an - // empty list. + // Let decl be a new declaration, with an initially empty name and a value set + // to an empty list. + + // TODO improve me + // Consume a component value. + // + // Set decl’s name to the value of the . + // + // anything else + // This is a parse error. + // + // While the next input token is anything but a or + // , consume a component value and throw it away. + // + // Return nothing. let span = self.input.cur_span(); let is_dashed_ident = match cur!(self) { Token::Ident { value, .. } => value.starts_with("--"), @@ -742,19 +733,19 @@ where important: None, }; - // 1. While the next input token is a , consume the next input + // 2. While the next input token is a , consume the next input // token. self.input.skip_ws(); - // 2. If the next input token is anything other than a , this is a + // 3. If the next input token is anything other than a , this is a // parse error. Return nothing. Otherwise, consume the next input token. expect!(self, ":"); - // 3. While the next input token is a , consume the next input + // 4. While the next input token is a , consume the next input // token. self.input.skip_ws(); - // 4. As long as the next input token is anything other than an , + // 5. As long as the next input token is anything other than an , // consume a component value and append it to the declaration’s value. let mut last_whitespaces = (0, 0, 0); let mut exclamation_point_span = None; @@ -840,7 +831,7 @@ where declaration.value.push(component_value); } - // 5. If the last two non-s in the declaration’s value are a + // 6. If the last two non-s in the declaration’s value are a // with the value "!" followed by an with a value // that is an ASCII case-insensitive match for "important", remove them from the // declaration’s value and set the declaration’s important flag to true. @@ -867,7 +858,7 @@ where declaration.important = Some(ImportantFlag { span, value }); } - // 6. While the last token in the declaration’s value is a , + // 7. While the last token in the declaration’s value is a , // remove that token. let len = if declaration.important.is_some() { declaration.value.len() @@ -884,7 +875,7 @@ where if is_dashed_ident { // Don't parse custom properties // - // 7. Return the declaration. + // 8. Return the declaration. return Ok(declaration); } @@ -914,7 +905,7 @@ where } }; - // 7. Return the declaration. + // 8. Return the declaration. Ok(declaration) } } diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index 804917ed5aa..c852ca336fd 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -73,11 +73,12 @@ where pub(super) fn try_to_parse_legacy_nesting(&mut self) -> Option { let state = self.input.state(); - let ctx = Ctx { - is_trying_legacy_nesting: true, - ..self.ctx - }; - let qualified_rule = self.with_ctx(ctx).parse_as::(); + let qualified_rule = self + .with_ctx(Ctx { + mixed_with_declarations: true, + ..self.ctx + }) + .parse_as::(); match qualified_rule { Ok(qualified_rule) => Some(qualified_rule), @@ -88,84 +89,6 @@ where } } } - - pub(super) fn legacy_nested_selector_list_to_modern_selector_list( - &mut self, - mut selector_list: SelectorList, - ) -> PResult { - for s in selector_list.children.iter_mut() { - if s.children.iter().any(|s| match s { - ComplexSelectorChildren::CompoundSelector(s) => s.nesting_selector.is_some(), - _ => false, - }) { - continue; - } - - s.children.insert( - 0, - ComplexSelectorChildren::CompoundSelector(CompoundSelector { - span: DUMMY_SP, - nesting_selector: Some(NestingSelector { span: DUMMY_SP }), - type_selector: Default::default(), - subclass_selectors: Default::default(), - }), - ); - s.children.insert( - 1, - ComplexSelectorChildren::Combinator(Combinator { - span: DUMMY_SP, - value: CombinatorValue::Descendant, - }), - ); - } - - Ok(selector_list) - } - - pub(super) fn legacy_relative_selector_list_to_modern_selector_list( - &mut self, - relative_selector_list: RelativeSelectorList, - ) -> PResult { - let mut selector_list = SelectorList { - span: relative_selector_list.span, - children: Vec::with_capacity(relative_selector_list.children.len()), - }; - - for relative_selector in relative_selector_list.children.into_iter() { - let mut complex_selector = relative_selector.selector.clone(); - - complex_selector.children.insert( - 0, - ComplexSelectorChildren::CompoundSelector(CompoundSelector { - span: DUMMY_SP, - nesting_selector: Some(NestingSelector { span: DUMMY_SP }), - type_selector: Default::default(), - subclass_selectors: Default::default(), - }), - ); - - match relative_selector.combinator { - Some(combinator) => { - complex_selector - .children - .insert(1, ComplexSelectorChildren::Combinator(combinator)); - } - _ => { - complex_selector.children.insert( - 1, - ComplexSelectorChildren::Combinator(Combinator { - span: DUMMY_SP, - value: CombinatorValue::Descendant, - }), - ); - } - } - - selector_list.children.push(complex_selector); - } - - Ok(selector_list) - } } pub(super) struct WithCtx<'w, I: 'w + ParserInput> { diff --git a/crates/swc_css_parser/tests/fixture/at-rule/nest/output.json b/crates/swc_css_parser/tests/fixture/at-rule/nest/output.json index 22b7620ca78..6b51b348fa1 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/nest/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/nest/output.json @@ -1033,7 +1033,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 295, "end": 300, @@ -1041,51 +1041,60 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 295, "end": 300, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 295, - "end": 300, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 295, + "end": 300, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 295, - "end": 296, + "end": 300, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 296, - "end": 300, + "start": 295, + "end": 296, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 297, + "start": 296, "end": 300, "ctxt": 0 }, - "value": "baz", - "raw": "baz" + "text": { + "type": "Ident", + "span": { + "start": 297, + "end": 300, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } } - } - ] - } - ] + ] + } + ] + } } ] }, diff --git a/crates/swc_css_parser/tests/fixture/at-rule/nest/span.rust-debug b/crates/swc_css_parser/tests/fixture/at-rule/nest/span.rust-debug index 9d948f24743..603b11a9968 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/nest/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/at-rule/nest/span.rust-debug @@ -1115,7 +1115,13 @@ 29 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/at-rule/nest/input.css:27:9] + 27 | &.baz { + : ^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/at-rule/nest/input.css:27:9] 27 | &.baz { : ^^^^^ diff --git a/crates/swc_css_parser/tests/fixture/selector/nesting/input.css b/crates/swc_css_parser/tests/fixture/selector/nesting/input.css index e6a3eb069a2..f4d484e2022 100644 --- a/crates/swc_css_parser/tests/fixture/selector/nesting/input.css +++ b/crates/swc_css_parser/tests/fixture/selector/nesting/input.css @@ -67,3 +67,110 @@ figure { color: blue; &__bar { color: red; } } + +.foo { + color: red; + + .bar { + color: blue; + } +} + +.foo { + color: red; + + + .bar { + color: blue; + } +} + +.foo { + color: blue; + & > .bar { color: red; } + > .baz { color: green; } +} + +div { + color: red; + + & input { margin: 1em; } + /* valid, no longer starts with an identifier */ + + :is(input) { margin: 1em; } + /* valid, starts with a colon, + and equivalent to the previous rule. */ +} + +.foo, .bar { + color: blue; + + .baz, &.qux { color: red; } +} + +.foo { + color: blue; + & .bar & .baz & .qux { color: red; } +} + +.foo { + color: red; + .parent & { + color: blue; + } +} + +.foo { + color: red; + :not(&) { + color: blue; + } +} + +.foo { + color: red; + + .bar + & { color: blue; } +} + +.ancestor .el { + .other-ancestor & { color: red; } +} + +.foo { + & :is(.bar, &.baz) { color: red; } +} + +@layer base { + html { + block-size: 100%; + + & body { + min-block-size: 100%; + } + } +} + +@layer base { + html { + block-size: 100%; + + @layer base.support { + & body { + min-block-size: 100%; + } + } + } +} + +article { + color: green; + & { color: blue; } + color: red; +} + +.foo { + color: red; + @media (min-width: 480px) { + & h1, & h2 { + color: blue; + } + } +} diff --git a/crates/swc_css_parser/tests/fixture/selector/nesting/output.json b/crates/swc_css_parser/tests/fixture/selector/nesting/output.json index 71e4959bae5..c0a7c8633fa 100644 --- a/crates/swc_css_parser/tests/fixture/selector/nesting/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/nesting/output.json @@ -2,7 +2,7 @@ "type": "Stylesheet", "span": { "start": 1, - "end": 956, + "end": 2317, "ctxt": 0 }, "rules": [ @@ -114,7 +114,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 24, "end": 28, @@ -122,78 +122,87 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 24, "end": 28, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 24, + "end": 28, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 24, "end": 25, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 24, + "end": 25, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 25, + "end": 26, + "ctxt": 0 + }, + "value": " " }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 26, - "end": 28, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 26, "end": 28, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 26, "end": 28, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 26, "end": 28, "ctxt": 0 }, - "value": "td", - "raw": "td" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 26, + "end": 28, + "ctxt": 0 + }, + "value": "td", + "raw": "td" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -253,7 +262,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 67, "end": 70, @@ -261,51 +270,60 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 67, "end": 70, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 67, - "end": 70, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 67, + "end": 70, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 67, - "end": 68, + "end": 70, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 68, - "end": 70, + "start": 67, + "end": 68, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 69, + "start": 68, "end": 70, "ctxt": 0 }, - "value": "c", - "raw": "c" + "text": { + "type": "Ident", + "span": { + "start": 69, + "end": 70, + "ctxt": 0 + }, + "value": "c", + "raw": "c" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -368,7 +386,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 108, "end": 141, @@ -376,146 +394,164 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 108, "end": 121, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 108, - "end": 121, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 108, + "end": 121, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 108, - "end": 109, + "end": 121, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "PseudoClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 109, - "end": 121, + "start": 108, + "end": 109, "ctxt": 0 - }, - "name": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", "span": { - "start": 110, + "start": 109, "end": 121, "ctxt": 0 }, - "value": "first-child", - "raw": "first-child" - }, - "children": null - } - ] - } - ] + "name": { + "type": "Ident", + "span": { + "start": 110, + "end": 121, + "ctxt": 0 + }, + "value": "first-child", + "raw": "first-child" + }, + "children": null + } + ] + } + ] + } }, { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 123, "end": 141, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 123, - "end": 136, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 123, + "end": 141, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 123, - "end": 124, + "end": 136, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "PseudoClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 124, - "end": 136, + "start": 123, + "end": 124, "ctxt": 0 - }, - "name": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", "span": { - "start": 125, + "start": 124, "end": 136, "ctxt": 0 }, - "value": "first-child", - "raw": "first-child" - }, - "children": null - } - ] - }, - { - "type": "Combinator", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 + "name": { + "type": "Ident", + "span": { + "start": 125, + "end": 136, + "ctxt": 0 + }, + "value": "first-child", + "raw": "first-child" + }, + "children": null + } + ] }, - "value": "+" - }, - { - "type": "CompoundSelector", - "span": { - "start": 139, - "end": 141, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 137, + "end": 138, + "ctxt": 0 + }, + "value": "+" }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 139, "end": 141, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 139, "end": 141, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 139, "end": 141, "ctxt": 0 }, - "value": "td", - "raw": "td" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 139, + "end": 141, + "ctxt": 0 + }, + "value": "td", + "raw": "td" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -619,7 +655,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 180, "end": 184, @@ -627,78 +663,87 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 180, "end": 184, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 180, + "end": 184, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 180, "end": 181, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 180, + "end": 181, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 181, + "end": 182, + "ctxt": 0 + }, + "value": " " }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 182, "end": 184, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 182, "end": 184, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 182, "end": 184, "ctxt": 0 }, - "value": "th", - "raw": "th" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 182, + "end": 184, + "ctxt": 0 + }, + "value": "th", + "raw": "th" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -931,7 +976,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 292, "end": 300, @@ -939,71 +984,80 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 292, "end": 300, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 292, + "end": 300, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 292, "end": 293, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": ">" - }, - { - "type": "CompoundSelector", - "span": { - "start": 296, - "end": 300, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 296, - "end": 300, + "start": 292, + "end": 293, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 294, + "end": 295, + "ctxt": 0 + }, + "value": ">" + }, + { + "type": "CompoundSelector", + "span": { + "start": 296, + "end": 300, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 297, + "start": 296, "end": 300, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "text": { + "type": "Ident", + "span": { + "start": 297, + "end": 300, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -1174,7 +1228,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 348, "end": 353, @@ -1182,51 +1236,60 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 348, "end": 353, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 348, - "end": 353, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 348, + "end": 353, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 348, - "end": 349, + "end": 353, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 349, - "end": 353, + "start": 348, + "end": 349, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 350, + "start": 349, "end": 353, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "text": { + "type": "Ident", + "span": { + "start": 350, + "end": 353, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -1437,7 +1500,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 407, "end": 422, @@ -1445,118 +1508,136 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 407, "end": 415, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 407, - "end": 408, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 407, + "end": 415, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 407, "end": 408, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 409, - "end": 410, - "ctxt": 0 - }, - "value": "+" - }, - { - "type": "CompoundSelector", - "span": { - "start": 411, - "end": 415, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 411, - "end": 415, + "start": 407, + "end": 408, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 409, + "end": 410, + "ctxt": 0 + }, + "value": "+" + }, + { + "type": "CompoundSelector", + "span": { + "start": 411, + "end": 415, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 412, + "start": 411, "end": 415, "ctxt": 0 }, - "value": "baz", - "raw": "baz" + "text": { + "type": "Ident", + "span": { + "start": 412, + "end": 415, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } } - } - ] - } - ] + ] + } + ] + } }, { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 417, "end": 422, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 417, + "end": 422, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 417, - "end": 418, + "end": 422, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 418, - "end": 422, + "start": 417, + "end": 418, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 419, + "start": 418, "end": 422, "ctxt": 0 }, - "value": "qux", - "raw": "qux" + "text": { + "type": "Ident", + "span": { + "start": 419, + "end": 422, + "ctxt": 0 + }, + "value": "qux", + "raw": "qux" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -1727,7 +1808,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 470, "end": 490, @@ -1735,203 +1816,212 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 470, "end": 490, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 470, - "end": 471, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 470, + "end": 490, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 470, "end": 471, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 471, - "end": 472, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 472, - "end": 476, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 472, - "end": 476, + "start": 470, + "end": 471, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 471, + "end": 472, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 472, + "end": 476, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 473, + "start": 472, "end": 476, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "text": { + "type": "Ident", + "span": { + "start": 473, + "end": 476, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } - } - ] - }, - { - "type": "Combinator", - "span": { - "start": 476, - "end": 477, - "ctxt": 0 + ] }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 476, + "end": 477, + "ctxt": 0 + }, + "value": " " }, - "nestingSelector": { - "type": "NestingSelector", + { + "type": "CompoundSelector", "span": { "start": 477, "end": 478, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 479, - "end": 483, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 479, - "end": 483, + "start": 477, + "end": 478, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 478, + "end": 479, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 479, + "end": 483, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 480, + "start": 479, "end": 483, "ctxt": 0 }, - "value": "baz", - "raw": "baz" + "text": { + "type": "Ident", + "span": { + "start": 480, + "end": 483, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } } - } - ] - }, - { - "type": "Combinator", - "span": { - "start": 483, - "end": 484, - "ctxt": 0 + ] }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 483, + "end": 484, + "ctxt": 0 + }, + "value": " " }, - "nestingSelector": { - "type": "NestingSelector", + { + "type": "CompoundSelector", "span": { "start": 484, "end": 485, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 485, - "end": 486, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 486, - "end": 490, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 486, - "end": 490, + "start": 484, + "end": 485, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 485, + "end": 486, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 486, + "end": 490, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 487, + "start": 486, "end": 490, "ctxt": 0 }, - "value": "qux", - "raw": "qux" + "text": { + "type": "Ident", + "span": { + "start": 487, + "end": 490, + "ctxt": 0 + }, + "value": "qux", + "raw": "qux" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -2102,7 +2192,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 538, "end": 539, @@ -2110,32 +2200,41 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 538, "end": 539, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 538, + "end": 539, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 538, "end": 539, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - } - ] + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 538, + "end": 539, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } } ] }, @@ -2333,7 +2432,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 667, "end": 681, @@ -2341,91 +2440,100 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 667, "end": 681, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 667, - "end": 674, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 667, + "end": 681, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 667, - "end": 668, + "end": 674, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "PseudoClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 668, - "end": 674, + "start": 667, + "end": 668, "ctxt": 0 - }, - "name": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", "span": { - "start": 669, + "start": 668, "end": 674, "ctxt": 0 }, - "value": "hover", - "raw": "hover" - }, - "children": null - } - ] - }, - { - "type": "Combinator", - "span": { - "start": 675, - "end": 676, - "ctxt": 0 + "name": { + "type": "Ident", + "span": { + "start": 669, + "end": 674, + "ctxt": 0 + }, + "value": "hover", + "raw": "hover" + }, + "children": null + } + ] }, - "value": ">" - }, - { - "type": "CompoundSelector", - "span": { - "start": 677, - "end": 681, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 675, + "end": 676, + "ctxt": 0 + }, + "value": ">" }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", - "span": { - "start": 677, - "end": 681, - "ctxt": 0 - }, - "text": { - "type": "Ident", + { + "type": "CompoundSelector", + "span": { + "start": 677, + "end": 681, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 678, + "start": 677, "end": 681, "ctxt": 0 }, - "value": "baz", - "raw": "baz" + "text": { + "type": "Ident", + "span": { + "start": 678, + "end": 681, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -2565,7 +2673,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 712, "end": 729, @@ -2573,150 +2681,159 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 712, "end": 729, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 712, - "end": 729, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 712, + "end": 729, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 712, - "end": 713, + "end": 729, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "PseudoClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 713, - "end": 729, + "start": 712, + "end": 713, "ctxt": 0 - }, - "name": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", "span": { - "start": 714, - "end": 716, + "start": 713, + "end": 729, "ctxt": 0 }, - "value": "is", - "raw": "is" - }, - "children": [ - { - "type": "SelectorList", + "name": { + "type": "Ident", "span": { - "start": 717, - "end": 728, + "start": 714, + "end": 716, "ctxt": 0 }, - "children": [ - { - "type": "ComplexSelector", - "span": { - "start": 717, - "end": 721, - "ctxt": 0 - }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 717, - "end": 721, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", - "span": { - "start": 717, - "end": 721, - "ctxt": 0 - }, - "text": { - "type": "Ident", + "value": "is", + "raw": "is" + }, + "children": [ + { + "type": "SelectorList", + "span": { + "start": 717, + "end": 728, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 717, + "end": 721, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 717, + "end": 721, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 718, + "start": 717, "end": 721, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "text": { + "type": "Ident", + "span": { + "start": 718, + "end": 721, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } - } - ] - } - ] - }, - { - "type": "ComplexSelector", - "span": { - "start": 723, - "end": 728, - "ctxt": 0 + ] + } + ] }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 723, - "end": 728, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + { + "type": "ComplexSelector", + "span": { + "start": 723, + "end": 728, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 723, - "end": 724, + "end": 728, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 724, - "end": 728, + "start": 723, + "end": 724, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 725, + "start": 724, "end": 728, "ctxt": 0 }, - "value": "baz", - "raw": "baz" + "text": { + "type": "Ident", + "span": { + "start": 725, + "end": 728, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } } - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } } ] }, @@ -2894,7 +3011,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 778, "end": 792, @@ -2902,78 +3019,87 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 778, "end": 792, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 778, - "end": 779, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 778, + "end": 792, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 778, "end": 779, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 778, + "end": 779, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 780, - "end": 781, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 780, + "end": 781, + "ctxt": 0 + }, + "value": ">" }, - "value": ">" - }, - { - "type": "CompoundSelector", - "span": { - "start": 782, - "end": 792, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 782, "end": 792, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 782, "end": 792, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 782, "end": 792, "ctxt": 0 }, - "value": "figcaption", - "raw": "figcaption" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 782, + "end": 792, + "ctxt": 0 + }, + "value": "figcaption", + "raw": "figcaption" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -3116,7 +3242,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 844, "end": 849, @@ -3124,78 +3250,87 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 844, "end": 849, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 844, - "end": 845, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 844, + "end": 849, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 844, "end": 845, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 844, + "end": 845, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 846, - "end": 847, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 846, + "end": 847, + "ctxt": 0 + }, + "value": ">" }, - "value": ">" - }, - { - "type": "CompoundSelector", - "span": { - "start": 848, - "end": 849, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 848, "end": 849, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 848, "end": 849, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 848, "end": 849, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 848, + "end": 849, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -3387,7 +3522,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 931, "end": 937, @@ -3395,58 +3530,67 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 931, "end": 937, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 931, - "end": 937, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 931, + "end": 937, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 931, - "end": 932, - "ctxt": 0 - } - }, - "typeSelector": { - "type": "TagNameSelector", - "span": { - "start": 932, "end": 937, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 931, + "end": 932, + "ctxt": 0 + } + }, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 932, "end": 937, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 932, "end": 937, "ctxt": 0 }, - "value": "__bar", - "raw": "__bar" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 932, + "end": 937, + "ctxt": 0 + }, + "value": "__bar", + "raw": "__bar" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -3503,6 +3647,4832 @@ } ] } + }, + { + "type": "QualifiedRule", + "span": { + "start": 957, + "end": 1020, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 957, + "end": 961, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 957, + "end": 961, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 957, + "end": 961, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 957, + "end": 961, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 958, + "end": 961, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 962, + "end": 1020, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 962, + "end": 963, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 968, + "end": 978, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 968, + "end": 973, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 975, + "end": 978, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 985, + "end": 1018, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 985, + "end": 989, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 985, + "end": 989, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 985, + "end": 989, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 985, + "end": 989, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 985, + "end": 989, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 986, + "end": 989, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 990, + "end": 1018, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 990, + "end": 991, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1000, + "end": 1011, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1000, + "end": 1005, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1007, + "end": 1011, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1022, + "end": 1087, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1022, + "end": 1026, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1022, + "end": 1026, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1022, + "end": 1026, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1022, + "end": 1026, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1023, + "end": 1026, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1027, + "end": 1087, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1027, + "end": 1028, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1033, + "end": 1043, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1033, + "end": 1038, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1040, + "end": 1043, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1050, + "end": 1085, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1050, + "end": 1056, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1050, + "end": 1056, + "ctxt": 0 + }, + "combinator": { + "type": "Combinator", + "span": { + "start": 1050, + "end": 1051, + "ctxt": 0 + }, + "value": "+" + }, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1052, + "end": 1056, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1052, + "end": 1056, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1052, + "end": 1056, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1053, + "end": 1056, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1057, + "end": 1085, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1057, + "end": 1058, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1067, + "end": 1078, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1067, + "end": 1072, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1074, + "end": 1078, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1089, + "end": 1172, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1089, + "end": 1093, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1089, + "end": 1093, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1089, + "end": 1093, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1089, + "end": 1093, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1090, + "end": 1093, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1094, + "end": 1172, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1094, + "end": 1095, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1100, + "end": 1111, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1100, + "end": 1105, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1107, + "end": 1111, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1117, + "end": 1141, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1117, + "end": 1125, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1117, + "end": 1125, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1117, + "end": 1125, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1117, + "end": 1118, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1117, + "end": 1118, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1119, + "end": 1120, + "ctxt": 0 + }, + "value": ">" + }, + { + "type": "CompoundSelector", + "span": { + "start": 1121, + "end": 1125, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1121, + "end": 1125, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1122, + "end": 1125, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1126, + "end": 1141, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1126, + "end": 1127, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1128, + "end": 1138, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1128, + "end": 1133, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1135, + "end": 1138, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1146, + "end": 1170, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1146, + "end": 1152, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1146, + "end": 1152, + "ctxt": 0 + }, + "combinator": { + "type": "Combinator", + "span": { + "start": 1146, + "end": 1147, + "ctxt": 0 + }, + "value": ">" + }, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1148, + "end": 1152, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1148, + "end": 1152, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1148, + "end": 1152, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1149, + "end": 1152, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1153, + "end": 1170, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1153, + "end": 1154, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1155, + "end": 1167, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1155, + "end": 1160, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1162, + "end": 1167, + "ctxt": 0 + }, + "value": "green", + "raw": "green" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1174, + "end": 1395, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1174, + "end": 1177, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1178, + "end": 1395, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1178, + "end": 1179, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1184, + "end": 1194, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1184, + "end": 1189, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1191, + "end": 1194, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1201, + "end": 1225, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1201, + "end": 1208, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1201, + "end": 1208, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1201, + "end": 1208, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1201, + "end": 1202, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1201, + "end": 1202, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1202, + "end": 1203, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1203, + "end": 1208, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1203, + "end": 1208, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1203, + "end": 1208, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1203, + "end": 1208, + "ctxt": 0 + }, + "value": "input", + "raw": "input" + } + } + }, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1209, + "end": 1225, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1209, + "end": 1210, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1211, + "end": 1222, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1211, + "end": 1217, + "ctxt": 0 + }, + "value": "margin", + "raw": "margin" + }, + "value": [ + { + "type": "Length", + "span": { + "start": 1219, + "end": 1222, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 1219, + "end": 1220, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "unit": { + "type": "Ident", + "span": { + "start": 1220, + "end": 1222, + "ctxt": 0 + }, + "value": "em", + "raw": "em" + } + } + ], + "important": null + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1284, + "end": 1311, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1284, + "end": 1294, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1284, + "end": 1294, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1284, + "end": 1294, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1284, + "end": 1294, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", + "span": { + "start": 1284, + "end": 1294, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1285, + "end": 1287, + "ctxt": 0 + }, + "value": "is", + "raw": "is" + }, + "children": [ + { + "type": "SelectorList", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1288, + "end": 1293, + "ctxt": 0 + }, + "value": "input", + "raw": "input" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1295, + "end": 1311, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1295, + "end": 1296, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1297, + "end": 1308, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1297, + "end": 1303, + "ctxt": 0 + }, + "value": "margin", + "raw": "margin" + }, + "value": [ + { + "type": "Length", + "span": { + "start": 1305, + "end": 1308, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 1305, + "end": 1306, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "unit": { + "type": "Ident", + "span": { + "start": 1306, + "end": 1308, + "ctxt": 0 + }, + "value": "em", + "raw": "em" + } + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1397, + "end": 1462, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1397, + "end": 1407, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1397, + "end": 1401, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1397, + "end": 1401, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1397, + "end": 1401, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1398, + "end": 1401, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + }, + { + "type": "ComplexSelector", + "span": { + "start": 1403, + "end": 1407, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1403, + "end": 1407, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1403, + "end": 1407, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1404, + "end": 1407, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1408, + "end": 1462, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1408, + "end": 1409, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1414, + "end": 1425, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1414, + "end": 1419, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1421, + "end": 1425, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1431, + "end": 1460, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1431, + "end": 1444, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1431, + "end": 1437, + "ctxt": 0 + }, + "combinator": { + "type": "Combinator", + "span": { + "start": 1431, + "end": 1432, + "ctxt": 0 + }, + "value": "+" + }, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1433, + "end": 1437, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1433, + "end": 1437, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1433, + "end": 1437, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1434, + "end": 1437, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } + } + ] + } + ] + } + }, + { + "type": "RelativeSelector", + "span": { + "start": 1439, + "end": 1444, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1439, + "end": 1444, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1439, + "end": 1444, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1439, + "end": 1440, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1440, + "end": 1444, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1441, + "end": 1444, + "ctxt": 0 + }, + "value": "qux", + "raw": "qux" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1445, + "end": 1460, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1445, + "end": 1446, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1447, + "end": 1457, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1447, + "end": 1452, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1454, + "end": 1457, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1464, + "end": 1530, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1464, + "end": 1468, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1464, + "end": 1468, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1464, + "end": 1468, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1464, + "end": 1468, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1465, + "end": 1468, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1469, + "end": 1530, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1469, + "end": 1470, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1475, + "end": 1486, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1475, + "end": 1480, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1482, + "end": 1486, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1492, + "end": 1528, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1492, + "end": 1512, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1492, + "end": 1512, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1492, + "end": 1512, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1492, + "end": 1493, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1492, + "end": 1493, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1493, + "end": 1494, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1494, + "end": 1498, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1494, + "end": 1498, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1495, + "end": 1498, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1498, + "end": 1499, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1499, + "end": 1500, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1499, + "end": 1500, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1500, + "end": 1501, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1501, + "end": 1505, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1501, + "end": 1505, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1502, + "end": 1505, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1505, + "end": 1506, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1506, + "end": 1507, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1506, + "end": 1507, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1507, + "end": 1508, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1508, + "end": 1512, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1508, + "end": 1512, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1509, + "end": 1512, + "ctxt": 0 + }, + "value": "qux", + "raw": "qux" + } + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1513, + "end": 1528, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1513, + "end": 1514, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1515, + "end": 1525, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1515, + "end": 1520, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1522, + "end": 1525, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1532, + "end": 1599, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1532, + "end": 1536, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1532, + "end": 1536, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1532, + "end": 1536, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1532, + "end": 1536, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1533, + "end": 1536, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1537, + "end": 1599, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1537, + "end": 1538, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1543, + "end": 1553, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1543, + "end": 1548, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1550, + "end": 1553, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1559, + "end": 1597, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1559, + "end": 1568, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1559, + "end": 1568, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1559, + "end": 1568, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1559, + "end": 1566, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1559, + "end": 1566, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1560, + "end": 1566, + "ctxt": 0 + }, + "value": "parent", + "raw": "parent" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1566, + "end": 1567, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1567, + "end": 1568, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1567, + "end": 1568, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1569, + "end": 1597, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1569, + "end": 1570, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1579, + "end": 1590, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1579, + "end": 1584, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1586, + "end": 1590, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1601, + "end": 1666, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1601, + "end": 1605, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1601, + "end": 1605, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1601, + "end": 1605, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1601, + "end": 1605, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1602, + "end": 1605, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1606, + "end": 1666, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1606, + "end": 1607, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1612, + "end": 1622, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1612, + "end": 1617, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1619, + "end": 1622, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1628, + "end": 1664, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1628, + "end": 1635, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1628, + "end": 1635, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1628, + "end": 1635, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1628, + "end": 1635, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", + "span": { + "start": 1628, + "end": 1635, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1629, + "end": 1632, + "ctxt": 0 + }, + "value": "not", + "raw": "not" + }, + "children": [ + { + "type": "SelectorList", + "span": { + "start": 1633, + "end": 1634, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1633, + "end": 1634, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1633, + "end": 1634, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1633, + "end": 1634, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1636, + "end": 1664, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1636, + "end": 1637, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1646, + "end": 1657, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1646, + "end": 1651, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1653, + "end": 1657, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1668, + "end": 1724, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1668, + "end": 1672, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1668, + "end": 1672, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1668, + "end": 1672, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1668, + "end": 1672, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1669, + "end": 1672, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1673, + "end": 1724, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1673, + "end": 1674, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1679, + "end": 1689, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1679, + "end": 1684, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1686, + "end": 1689, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1695, + "end": 1722, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1695, + "end": 1705, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1695, + "end": 1705, + "ctxt": 0 + }, + "combinator": { + "type": "Combinator", + "span": { + "start": 1695, + "end": 1696, + "ctxt": 0 + }, + "value": "+" + }, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1697, + "end": 1705, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1697, + "end": 1701, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1697, + "end": 1701, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1698, + "end": 1701, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1702, + "end": 1703, + "ctxt": 0 + }, + "value": "+" + }, + { + "type": "CompoundSelector", + "span": { + "start": 1704, + "end": 1705, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1704, + "end": 1705, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1706, + "end": 1722, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1706, + "end": 1707, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1708, + "end": 1719, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1708, + "end": 1713, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1715, + "end": 1719, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1726, + "end": 1781, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1726, + "end": 1739, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1726, + "end": 1739, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1726, + "end": 1735, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1726, + "end": 1735, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1727, + "end": 1735, + "ctxt": 0 + }, + "value": "ancestor", + "raw": "ancestor" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1735, + "end": 1736, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1736, + "end": 1739, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1736, + "end": 1739, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1737, + "end": 1739, + "ctxt": 0 + }, + "value": "el", + "raw": "el" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1740, + "end": 1781, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1740, + "end": 1741, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 1746, + "end": 1779, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1746, + "end": 1763, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1746, + "end": 1763, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1746, + "end": 1763, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1746, + "end": 1761, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1746, + "end": 1761, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1747, + "end": 1761, + "ctxt": 0 + }, + "value": "other-ancestor", + "raw": "other-ancestor" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1761, + "end": 1762, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1762, + "end": 1763, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1762, + "end": 1763, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1764, + "end": 1779, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1764, + "end": 1765, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1766, + "end": 1776, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1766, + "end": 1771, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1773, + "end": 1776, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1783, + "end": 1830, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1783, + "end": 1787, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1783, + "end": 1787, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1783, + "end": 1787, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1783, + "end": 1787, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1784, + "end": 1787, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1788, + "end": 1830, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1788, + "end": 1789, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 1794, + "end": 1828, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1794, + "end": 1812, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1794, + "end": 1812, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1794, + "end": 1812, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1794, + "end": 1795, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1794, + "end": 1795, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1795, + "end": 1796, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1796, + "end": 1812, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "PseudoClassSelector", + "span": { + "start": 1796, + "end": 1812, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1797, + "end": 1799, + "ctxt": 0 + }, + "value": "is", + "raw": "is" + }, + "children": [ + { + "type": "SelectorList", + "span": { + "start": 1800, + "end": 1811, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1800, + "end": 1804, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1800, + "end": 1804, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1800, + "end": 1804, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1801, + "end": 1804, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } + } + ] + } + ] + }, + { + "type": "ComplexSelector", + "span": { + "start": 1806, + "end": 1811, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1806, + "end": 1811, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1806, + "end": 1807, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1807, + "end": 1811, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 1808, + "end": 1811, + "ctxt": 0 + }, + "value": "baz", + "raw": "baz" + } + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1813, + "end": 1828, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1813, + "end": 1814, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1815, + "end": 1825, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1815, + "end": 1820, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 1822, + "end": 1825, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "AtRule", + "span": { + "start": 1832, + "end": 1952, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1833, + "end": 1838, + "ctxt": 0 + }, + "value": "layer", + "raw": "layer" + }, + "prelude": { + "type": "LayerName", + "span": { + "start": 1839, + "end": 1843, + "ctxt": 0 + }, + "name": [ + { + "type": "Ident", + "span": { + "start": 1839, + "end": 1843, + "ctxt": 0 + }, + "value": "base", + "raw": "base" + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1844, + "end": 1952, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1844, + "end": 1845, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 1850, + "end": 1950, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1850, + "end": 1854, + "ctxt": 0 + }, + "value": "html", + "raw": "html" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1855, + "end": 1950, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1855, + "end": 1856, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1865, + "end": 1881, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1865, + "end": 1875, + "ctxt": 0 + }, + "value": "block-size", + "raw": "block-size" + }, + "value": [ + { + "type": "Percentage", + "span": { + "start": 1877, + "end": 1881, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 1877, + "end": 1880, + "ctxt": 0 + }, + "value": 100.0, + "raw": "100" + } + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 1892, + "end": 1944, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 1892, + "end": 1898, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 1892, + "end": 1898, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 1892, + "end": 1898, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1892, + "end": 1893, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 1892, + "end": 1893, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 1893, + "end": 1894, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 1894, + "end": 1898, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1894, + "end": 1898, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1894, + "end": 1898, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1894, + "end": 1898, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } + } + }, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1899, + "end": 1944, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1899, + "end": 1900, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1913, + "end": 1933, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1913, + "end": 1927, + "ctxt": 0 + }, + "value": "min-block-size", + "raw": "min-block-size" + }, + "value": [ + { + "type": "Percentage", + "span": { + "start": 1929, + "end": 1933, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 1929, + "end": 1932, + "ctxt": 0 + }, + "value": 100.0, + "raw": "100" + } + } + ], + "important": null + } + ] + } + } + ] + } + } + ] + } + }, + { + "type": "AtRule", + "span": { + "start": 1954, + "end": 2126, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1955, + "end": 1960, + "ctxt": 0 + }, + "value": "layer", + "raw": "layer" + }, + "prelude": { + "type": "LayerName", + "span": { + "start": 1961, + "end": 1965, + "ctxt": 0 + }, + "name": [ + { + "type": "Ident", + "span": { + "start": 1961, + "end": 1965, + "ctxt": 0 + }, + "value": "base", + "raw": "base" + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1966, + "end": 2126, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1966, + "end": 1967, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 1972, + "end": 2124, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 1972, + "end": 1976, + "ctxt": 0 + }, + "value": "html", + "raw": "html" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 1977, + "end": 2124, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 1977, + "end": 1978, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 1987, + "end": 2003, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 1987, + "end": 1997, + "ctxt": 0 + }, + "value": "block-size", + "raw": "block-size" + }, + "value": [ + { + "type": "Percentage", + "span": { + "start": 1999, + "end": 2003, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 1999, + "end": 2002, + "ctxt": 0 + }, + "value": 100.0, + "raw": "100" + } + } + ], + "important": null + }, + { + "type": "AtRule", + "span": { + "start": 2014, + "end": 2118, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2015, + "end": 2020, + "ctxt": 0 + }, + "value": "layer", + "raw": "layer" + }, + "prelude": { + "type": "LayerName", + "span": { + "start": 2021, + "end": 2033, + "ctxt": 0 + }, + "name": [ + { + "type": "Ident", + "span": { + "start": 2021, + "end": 2025, + "ctxt": 0 + }, + "value": "base", + "raw": "base" + }, + { + "type": "Ident", + "span": { + "start": 2026, + "end": 2033, + "ctxt": 0 + }, + "value": "support", + "raw": "support" + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2034, + "end": 2118, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2034, + "end": 2035, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 2048, + "end": 2108, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 2048, + "end": 2054, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 2048, + "end": 2054, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2048, + "end": 2049, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 2048, + "end": 2049, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 2049, + "end": 2050, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 2050, + "end": 2054, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 2050, + "end": 2054, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 2050, + "end": 2054, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 2050, + "end": 2054, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2055, + "end": 2108, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2055, + "end": 2056, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 2073, + "end": 2093, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2073, + "end": 2087, + "ctxt": 0 + }, + "value": "min-block-size", + "raw": "min-block-size" + }, + "value": [ + { + "type": "Percentage", + "span": { + "start": 2089, + "end": 2093, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 2089, + "end": 2092, + "ctxt": 0 + }, + "value": 100.0, + "raw": "100" + } + } + ], + "important": null + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 2128, + "end": 2196, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 2128, + "end": 2135, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2136, + "end": 2196, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2136, + "end": 2137, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 2142, + "end": 2154, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2142, + "end": 2147, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 2149, + "end": 2154, + "ctxt": 0 + }, + "value": "green", + "raw": "green" + } + ], + "important": null + }, + { + "type": "Declaration", + "span": { + "start": 2183, + "end": 2193, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2183, + "end": 2188, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 2190, + "end": 2193, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "QualifiedRule", + "span": { + "start": 2160, + "end": 2178, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 2160, + "end": 2161, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 2160, + "end": 2161, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 2160, + "end": 2161, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2160, + "end": 2161, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 2160, + "end": 2161, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2162, + "end": 2178, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2162, + "end": 2163, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 2164, + "end": 2175, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2164, + "end": 2169, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 2171, + "end": 2175, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 2198, + "end": 2316, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 2198, + "end": 2202, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 2198, + "end": 2202, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2198, + "end": 2202, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 2198, + "end": 2202, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 2199, + "end": 2202, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2203, + "end": 2316, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2203, + "end": 2204, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 2209, + "end": 2219, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2209, + "end": 2214, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 2216, + "end": 2219, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + }, + { + "type": "AtRule", + "span": { + "start": 2225, + "end": 2314, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2226, + "end": 2231, + "ctxt": 0 + }, + "value": "media", + "raw": "media" + }, + "prelude": { + "type": "MediaQueryList", + "span": { + "start": 2232, + "end": 2250, + "ctxt": 0 + }, + "queries": [ + { + "type": "MediaQuery", + "span": { + "start": 2232, + "end": 2250, + "ctxt": 0 + }, + "modifier": null, + "mediaType": null, + "keyword": null, + "condition": { + "type": "MediaCondition", + "span": { + "start": 2232, + "end": 2250, + "ctxt": 0 + }, + "conditions": [ + { + "type": "MediaFeaturePlain", + "span": { + "start": 2232, + "end": 2250, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2233, + "end": 2242, + "ctxt": 0 + }, + "value": "min-width", + "raw": "min-width" + }, + "value": { + "type": "Length", + "span": { + "start": 2244, + "end": 2249, + "ctxt": 0 + }, + "value": { + "type": "Number", + "span": { + "start": 2244, + "end": 2247, + "ctxt": 0 + }, + "value": 480.0, + "raw": "480" + }, + "unit": { + "type": "Ident", + "span": { + "start": 2247, + "end": 2249, + "ctxt": 0 + }, + "value": "px", + "raw": "px" + } + } + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2251, + "end": 2314, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2251, + "end": 2252, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "QualifiedRule", + "span": { + "start": 2261, + "end": 2308, + "ctxt": 0 + }, + "prelude": { + "type": "RelativeSelectorList", + "span": { + "start": 2261, + "end": 2271, + "ctxt": 0 + }, + "children": [ + { + "type": "RelativeSelector", + "span": { + "start": 2261, + "end": 2265, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 2261, + "end": 2265, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2261, + "end": 2262, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 2261, + "end": 2262, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 2262, + "end": 2263, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 2263, + "end": 2265, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 2263, + "end": 2265, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 2263, + "end": 2265, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 2263, + "end": 2265, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } + } + }, + "subclassSelectors": [] + } + ] + } + }, + { + "type": "RelativeSelector", + "span": { + "start": 2267, + "end": 2271, + "ctxt": 0 + }, + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 2267, + "end": 2271, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 2267, + "end": 2268, + "ctxt": 0 + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 2267, + "end": 2268, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 2268, + "end": 2269, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 2269, + "end": 2271, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 2269, + "end": 2271, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 2269, + "end": 2271, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 2269, + "end": 2271, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } + } + }, + "subclassSelectors": [] + } + ] + } + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 2272, + "end": 2308, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 2272, + "end": 2273, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 2286, + "end": 2297, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 2286, + "end": 2291, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 2293, + "end": 2297, + "ctxt": 0 + }, + "value": "blue", + "raw": "blue" + } + ], + "important": null + } + ] + } + } + ] + } + } + ] + } } ] } diff --git a/crates/swc_css_parser/tests/fixture/selector/nesting/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/nesting/span.rust-debug index bc7f375345a..a99b858a68a 100644 --- a/crates/swc_css_parser/tests/fixture/selector/nesting/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/nesting/span.rust-debug @@ -1,76 +1,183 @@ x Stylesheet - ,-[$DIR/tests/fixture/selector/nesting/input.css:1:1] - 1 | ,-> table.colortable { - 2 | | & td { - 3 | | text-align: center; - 4 | | &.c { text-transform:uppercase } - 5 | | &:first-child, &:first-child + td { border:1px solid black } - 6 | | } - 7 | | - 8 | | & th { - 9 | | text-align:center; - 10 | | background:black; - 11 | | color:white; - 12 | | } - 13 | | } - 14 | | - 15 | | .foo { - 16 | | color: blue; - 17 | | & > .bar { color: red; } - 18 | | } - 19 | | - 20 | | .foo { - 21 | | color: blue; - 22 | | &.bar { color: red; } - 23 | | } - 24 | | - 25 | | .foo, .bar { - 26 | | color: blue; - 27 | | & + .baz, &.qux { color: red; } - 28 | | } - 29 | | - 30 | | .foo { - 31 | | color: blue; - 32 | | & .bar & .baz & .qux { color: red; } - 33 | | } - 34 | | - 35 | | .foo { - 36 | | color: blue; - 37 | | & { padding: 2ch; } - 38 | | } - 39 | | - 40 | | /* TODO fix me */ - 41 | | /*.foo {*/ - 42 | | /* color: blue;*/ - 43 | | /* && { padding: 2ch; }*/ - 44 | | /*}*/ - 45 | | - 46 | | .error, #test { - 47 | | &:hover > .baz { color: red; } - 48 | | } - 49 | | - 50 | | .foo { - 51 | | &:is(.bar, &.baz) { color: red; } - 52 | | } - 53 | | - 54 | | figure { - 55 | | margin: 0; - 56 | | - 57 | | & > figcaption { - 58 | | background: hsl(0 0% 0% / 50%); - 59 | | - 60 | | & > p { - 61 | | font-size: .9rem; - 62 | | } - 63 | | } - 64 | | } - 65 | | - 66 | | .foo { - 67 | | color: blue; - 68 | | &__bar { color: red; } - 69 | `-> } - `---- + ,-[$DIR/tests/fixture/selector/nesting/input.css:1:1] + 1 | ,-> table.colortable { + 2 | | & td { + 3 | | text-align: center; + 4 | | &.c { text-transform:uppercase } + 5 | | &:first-child, &:first-child + td { border:1px solid black } + 6 | | } + 7 | | + 8 | | & th { + 9 | | text-align:center; + 10 | | background:black; + 11 | | color:white; + 12 | | } + 13 | | } + 14 | | + 15 | | .foo { + 16 | | color: blue; + 17 | | & > .bar { color: red; } + 18 | | } + 19 | | + 20 | | .foo { + 21 | | color: blue; + 22 | | &.bar { color: red; } + 23 | | } + 24 | | + 25 | | .foo, .bar { + 26 | | color: blue; + 27 | | & + .baz, &.qux { color: red; } + 28 | | } + 29 | | + 30 | | .foo { + 31 | | color: blue; + 32 | | & .bar & .baz & .qux { color: red; } + 33 | | } + 34 | | + 35 | | .foo { + 36 | | color: blue; + 37 | | & { padding: 2ch; } + 38 | | } + 39 | | + 40 | | /* TODO fix me */ + 41 | | /*.foo {*/ + 42 | | /* color: blue;*/ + 43 | | /* && { padding: 2ch; }*/ + 44 | | /*}*/ + 45 | | + 46 | | .error, #test { + 47 | | &:hover > .baz { color: red; } + 48 | | } + 49 | | + 50 | | .foo { + 51 | | &:is(.bar, &.baz) { color: red; } + 52 | | } + 53 | | + 54 | | figure { + 55 | | margin: 0; + 56 | | + 57 | | & > figcaption { + 58 | | background: hsl(0 0% 0% / 50%); + 59 | | + 60 | | & > p { + 61 | | font-size: .9rem; + 62 | | } + 63 | | } + 64 | | } + 65 | | + 66 | | .foo { + 67 | | color: blue; + 68 | | &__bar { color: red; } + 69 | | } + 70 | | + 71 | | .foo { + 72 | | color: red; + 73 | | + 74 | | .bar { + 75 | | color: blue; + 76 | | } + 77 | | } + 78 | | + 79 | | .foo { + 80 | | color: red; + 81 | | + 82 | | + .bar { + 83 | | color: blue; + 84 | | } + 85 | | } + 86 | | + 87 | | .foo { + 88 | | color: blue; + 89 | | & > .bar { color: red; } + 90 | | > .baz { color: green; } + 91 | | } + 92 | | + 93 | | div { + 94 | | color: red; + 95 | | + 96 | | & input { margin: 1em; } + 97 | | /* valid, no longer starts with an identifier */ + 98 | | + 99 | | :is(input) { margin: 1em; } + 100 | | /* valid, starts with a colon, + 101 | | and equivalent to the previous rule. */ + 102 | | } + 103 | | + 104 | | .foo, .bar { + 105 | | color: blue; + 106 | | + .baz, &.qux { color: red; } + 107 | | } + 108 | | + 109 | | .foo { + 110 | | color: blue; + 111 | | & .bar & .baz & .qux { color: red; } + 112 | | } + 113 | | + 114 | | .foo { + 115 | | color: red; + 116 | | .parent & { + 117 | | color: blue; + 118 | | } + 119 | | } + 120 | | + 121 | | .foo { + 122 | | color: red; + 123 | | :not(&) { + 124 | | color: blue; + 125 | | } + 126 | | } + 127 | | + 128 | | .foo { + 129 | | color: red; + 130 | | + .bar + & { color: blue; } + 131 | | } + 132 | | + 133 | | .ancestor .el { + 134 | | .other-ancestor & { color: red; } + 135 | | } + 136 | | + 137 | | .foo { + 138 | | & :is(.bar, &.baz) { color: red; } + 139 | | } + 140 | | + 141 | | @layer base { + 142 | | html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | | } + 149 | | } + 150 | | + 151 | | @layer base { + 152 | | html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | | } + 161 | | } + 162 | | + 163 | | article { + 164 | | color: green; + 165 | | & { color: blue; } + 166 | | color: red; + 167 | | } + 168 | | + 169 | | .foo { + 170 | | color: red; + 171 | | @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | | } + 176 | `-> } + `---- x Rule ,-[$DIR/tests/fixture/selector/nesting/input.css:1:1] @@ -216,7 +323,13 @@ 6 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:2:5] + 2 | & td { + : ^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:2:5] 2 | & td { : ^^^^ @@ -351,7 +464,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:4:9] + 4 | &.c { text-transform:uppercase } + : ^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:4:9] 4 | &.c { text-transform:uppercase } : ^^^ @@ -465,12 +584,18 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList ,-[$DIR/tests/fixture/selector/nesting/input.css:5:9] 5 | &:first-child, &:first-child + td { border:1px solid black } : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:5:9] + 5 | &:first-child, &:first-child + td { border:1px solid black } + : ^^^^^^^^^^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:5:9] 5 | &:first-child, &:first-child + td { border:1px solid black } @@ -507,6 +632,12 @@ : ^^^^^^^^^^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:5:9] + 5 | &:first-child, &:first-child + td { border:1px solid black } + : ^^^^^^^^^^^^^^^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:5:9] 5 | &:first-child, &:first-child + td { border:1px solid black } @@ -702,7 +833,13 @@ 12 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:8:5] + 8 | & th { + : ^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:8:5] 8 | & th { : ^^^^ @@ -1029,7 +1166,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:17:5] + 17 | & > .bar { color: red; } + : ^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:17:5] 17 | & > .bar { color: red; } : ^^^^^^^^ @@ -1263,7 +1406,13 @@ : ^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:22:5] + 22 | &.bar { color: red; } + : ^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:22:5] 22 | &.bar { color: red; } : ^^^^^ @@ -1515,12 +1664,18 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList ,-[$DIR/tests/fixture/selector/nesting/input.css:27:5] 27 | & + .baz, &.qux { color: red; } : ^^^^^^^^^^^^^^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:27:5] + 27 | & + .baz, &.qux { color: red; } + : ^^^^^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:27:5] 27 | & + .baz, &.qux { color: red; } @@ -1569,6 +1724,12 @@ : ^^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:27:5] + 27 | & + .baz, &.qux { color: red; } + : ^^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:27:5] 27 | & + .baz, &.qux { color: red; } @@ -1785,7 +1946,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:32:5] + 32 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:32:5] 32 | & .bar & .baz & .qux { color: red; } : ^^^^^^^^^^^^^^^^^^^^ @@ -2115,7 +2282,13 @@ : ^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:37:5] + 37 | & { padding: 2ch; } + : ^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:37:5] 37 | & { padding: 2ch; } : ^ @@ -2322,7 +2495,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:47:5] + 47 | &:hover > .baz { color: red; } + : ^^^^^^^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:47:5] 47 | &:hover > .baz { color: red; } : ^^^^^^^^^^^^^^ @@ -2529,7 +2708,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:51:5] + 51 | &:is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:51:5] 51 | &:is(.bar, &.baz) { color: red; } : ^^^^^^^^^^^^^^^^^ @@ -2871,7 +3056,13 @@ 63 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:57:5] + 57 | & > figcaption { + : ^^^^^^^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:57:5] 57 | & > figcaption { : ^^^^^^^^^^^^^^ @@ -3113,7 +3304,13 @@ 62 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:60:9] + 60 | & > p { + : ^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:60:9] 60 | & > p { : ^^^^^ @@ -3372,7 +3569,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:68:5] + 68 | &__bar { color: red; } + : ^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/selector/nesting/input.css:68:5] 68 | &__bar { color: red; } : ^^^^^^ @@ -3473,3 +3676,4735 @@ 68 | &__bar { color: red; } : ^^^ `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | ,-> .foo { + 72 | | color: red; + 73 | | + 74 | | .bar { + 75 | | color: blue; + 76 | | } + 77 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | ,-> .foo { + 72 | | color: red; + 73 | | + 74 | | .bar { + 75 | | color: blue; + 76 | | } + 77 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | ,-> .foo { + 72 | | color: red; + 73 | | + 74 | | .bar { + 75 | | color: blue; + 76 | | } + 77 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:71:1] + 71 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:72:5] + 72 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | ,-> .bar { + 75 | | color: blue; + 76 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | ,-> .bar { + 75 | | color: blue; + 76 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | ,-> .bar { + 75 | | color: blue; + 76 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | ,-> .bar { + 75 | | color: blue; + 76 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:74:5] + 74 | .bar { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:75:9] + 75 | color: blue; + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | ,-> .foo { + 80 | | color: red; + 81 | | + 82 | | + .bar { + 83 | | color: blue; + 84 | | } + 85 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | ,-> .foo { + 80 | | color: red; + 81 | | + 82 | | + .bar { + 83 | | color: blue; + 84 | | } + 85 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | ,-> .foo { + 80 | | color: red; + 81 | | + 82 | | + .bar { + 83 | | color: blue; + 84 | | } + 85 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:79:1] + 79 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:80:5] + 80 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | ,-> + .bar { + 83 | | color: blue; + 84 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | ,-> + .bar { + 83 | | color: blue; + 84 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | ,-> + .bar { + 83 | | color: blue; + 84 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | ,-> + .bar { + 83 | | color: blue; + 84 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:82:5] + 82 | + .bar { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:83:9] + 83 | color: blue; + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | ,-> .foo { + 88 | | color: blue; + 89 | | & > .bar { color: red; } + 90 | | > .baz { color: green; } + 91 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | ,-> .foo { + 88 | | color: blue; + 89 | | & > .bar { color: red; } + 90 | | > .baz { color: green; } + 91 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | ,-> .foo { + 88 | | color: blue; + 89 | | & > .bar { color: red; } + 90 | | > .baz { color: green; } + 91 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:87:1] + 87 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:88:5] + 88 | color: blue; + : ^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:89:5] + 89 | & > .bar { color: red; } + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:90:5] + 90 | > .baz { color: green; } + : ^^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | ,-> div { + 94 | | color: red; + 95 | | + 96 | | & input { margin: 1em; } + 97 | | /* valid, no longer starts with an identifier */ + 98 | | + 99 | | :is(input) { margin: 1em; } + 100 | | /* valid, starts with a colon, + 101 | | and equivalent to the previous rule. */ + 102 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | ,-> div { + 94 | | color: red; + 95 | | + 96 | | & input { margin: 1em; } + 97 | | /* valid, no longer starts with an identifier */ + 98 | | + 99 | | :is(input) { margin: 1em; } + 100 | | /* valid, starts with a colon, + 101 | | and equivalent to the previous rule. */ + 102 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | ,-> div { + 94 | | color: red; + 95 | | + 96 | | & input { margin: 1em; } + 97 | | /* valid, no longer starts with an identifier */ + 98 | | + 99 | | :is(input) { margin: 1em; } + 100 | | /* valid, starts with a colon, + 101 | | and equivalent to the previous rule. */ + 102 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:93:1] + 93 | div { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:94:5] + 94 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^ + `---- + + x Dimension + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^ + `---- + + x Length + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:96:5] + 96 | & input { margin: 1em; } + : ^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x PseudoClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^ + `---- + + x PseudoClassSelectorChildren + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x ForgivingSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^ + `---- + + x Dimension + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^ + `---- + + x Length + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:99:5] + 99 | :is(input) { margin: 1em; } + : ^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | ,-> .foo, .bar { + 105 | | color: blue; + 106 | | + .baz, &.qux { color: red; } + 107 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | ,-> .foo, .bar { + 105 | | color: blue; + 106 | | + .baz, &.qux { color: red; } + 107 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | ,-> .foo, .bar { + 105 | | color: blue; + 106 | | + .baz, &.qux { color: red; } + 107 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:104:1] + 104 | .foo, .bar { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:105:5] + 105 | color: blue; + : ^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:106:5] + 106 | + .baz, &.qux { color: red; } + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | ,-> .foo { + 110 | | color: blue; + 111 | | & .bar & .baz & .qux { color: red; } + 112 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | ,-> .foo { + 110 | | color: blue; + 111 | | & .bar & .baz & .qux { color: red; } + 112 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | ,-> .foo { + 110 | | color: blue; + 111 | | & .bar & .baz & .qux { color: red; } + 112 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:109:1] + 109 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:110:5] + 110 | color: blue; + : ^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:111:5] + 111 | & .bar & .baz & .qux { color: red; } + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | ,-> .foo { + 115 | | color: red; + 116 | | .parent & { + 117 | | color: blue; + 118 | | } + 119 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | ,-> .foo { + 115 | | color: red; + 116 | | .parent & { + 117 | | color: blue; + 118 | | } + 119 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | ,-> .foo { + 115 | | color: red; + 116 | | .parent & { + 117 | | color: blue; + 118 | | } + 119 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:114:1] + 114 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:115:5] + 115 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | ,-> .parent & { + 117 | | color: blue; + 118 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | ,-> .parent & { + 117 | | color: blue; + 118 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | ,-> .parent & { + 117 | | color: blue; + 118 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | ,-> .parent & { + 117 | | color: blue; + 118 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:116:5] + 116 | .parent & { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:117:9] + 117 | color: blue; + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | ,-> .foo { + 122 | | color: red; + 123 | | :not(&) { + 124 | | color: blue; + 125 | | } + 126 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | ,-> .foo { + 122 | | color: red; + 123 | | :not(&) { + 124 | | color: blue; + 125 | | } + 126 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | ,-> .foo { + 122 | | color: red; + 123 | | :not(&) { + 124 | | color: blue; + 125 | | } + 126 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:121:1] + 121 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:122:5] + 122 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | ,-> :not(&) { + 124 | | color: blue; + 125 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | ,-> :not(&) { + 124 | | color: blue; + 125 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | ,-> :not(&) { + 124 | | color: blue; + 125 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x PseudoClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^^^ + `---- + + x PseudoClassSelectorChildren + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | ,-> :not(&) { + 124 | | color: blue; + 125 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:123:5] + 123 | :not(&) { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:124:9] + 124 | color: blue; + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | ,-> .foo { + 129 | | color: red; + 130 | | + .bar + & { color: blue; } + 131 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | ,-> .foo { + 129 | | color: red; + 130 | | + .bar + & { color: blue; } + 131 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | ,-> .foo { + 129 | | color: red; + 130 | | + .bar + & { color: blue; } + 131 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:128:1] + 128 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:129:5] + 129 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:130:5] + 130 | + .bar + & { color: blue; } + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | ,-> .ancestor .el { + 134 | | .other-ancestor & { color: red; } + 135 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | ,-> .ancestor .el { + 134 | | .other-ancestor & { color: red; } + 135 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | ,-> .ancestor .el { + 134 | | .other-ancestor & { color: red; } + 135 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:133:1] + 133 | .ancestor .el { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:134:5] + 134 | .other-ancestor & { color: red; } + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | ,-> .foo { + 138 | | & :is(.bar, &.baz) { color: red; } + 139 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | ,-> .foo { + 138 | | & :is(.bar, &.baz) { color: red; } + 139 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | ,-> .foo { + 138 | | & :is(.bar, &.baz) { color: red; } + 139 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:137:1] + 137 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^ + `---- + + x PseudoClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^ + `---- + + x PseudoClassSelectorChildren + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^ + `---- + + x ForgivingSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:138:5] + 138 | & :is(.bar, &.baz) { color: red; } + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | ,-> @layer base { + 142 | | html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | | } + 149 | `-> } + `---- + + x AtRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | ,-> @layer base { + 142 | | html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | | } + 149 | `-> } + `---- + + x AtRuleName + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^^^^^ + `---- + + x LayerPrelude + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^^^^ + `---- + + x LayerName + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | ,-> @layer base { + 142 | | html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | | } + 149 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:141:1] + 141 | @layer base { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | ,-> html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | `-> } + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | ,-> html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | ,-> html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | ,-> html { + 143 | | block-size: 100%; + 144 | | + 145 | | & body { + 146 | | min-block-size: 100%; + 147 | | } + 148 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:142:5] + 142 | html { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^ + `---- + + x Percentage + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:143:9] + 143 | block-size: 100%; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | ,-> & body { + 146 | | min-block-size: 100%; + 147 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | ,-> & body { + 146 | | min-block-size: 100%; + 147 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | ,-> & body { + 146 | | min-block-size: 100%; + 147 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | ,-> & body { + 146 | | min-block-size: 100%; + 147 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:145:9] + 145 | & body { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^^^^^^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^ + `---- + + x Percentage + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:146:13] + 146 | min-block-size: 100%; + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | ,-> @layer base { + 152 | | html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | | } + 161 | `-> } + `---- + + x AtRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | ,-> @layer base { + 152 | | html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | | } + 161 | `-> } + `---- + + x AtRuleName + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^^^^^ + `---- + + x LayerPrelude + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^^^^ + `---- + + x LayerName + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | ,-> @layer base { + 152 | | html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | | } + 161 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:151:1] + 151 | @layer base { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | ,-> html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | `-> } + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | ,-> html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | ,-> html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | ,-> html { + 153 | | block-size: 100%; + 154 | | + 155 | | @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | | } + 160 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:152:5] + 152 | html { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^ + `---- + + x Percentage + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:153:9] + 153 | block-size: 100%; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | ,-> @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | ,-> @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | `-> } + `---- + + x AtRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | ,-> @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | `-> } + `---- + + x AtRuleName + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^^ + `---- + + x LayerPrelude + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^^^^^^^^^ + `---- + + x LayerName + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^^^^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | ,-> @layer base.support { + 156 | | & body { + 157 | | min-block-size: 100%; + 158 | | } + 159 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:155:9] + 155 | @layer base.support { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | ,-> & body { + 157 | | min-block-size: 100%; + 158 | `-> } + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | ,-> & body { + 157 | | min-block-size: 100%; + 158 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | ,-> & body { + 157 | | min-block-size: 100%; + 158 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | ,-> & body { + 157 | | min-block-size: 100%; + 158 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:156:13] + 156 | & body { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^^^^^^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^^^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^^^^^^^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^ + `---- + + x Percentage + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:157:17] + 157 | min-block-size: 100%; + : ^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | ,-> article { + 164 | | color: green; + 165 | | & { color: blue; } + 166 | | color: red; + 167 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | ,-> article { + 164 | | color: green; + 165 | | & { color: blue; } + 166 | | color: red; + 167 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^^^^^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | ,-> article { + 164 | | color: green; + 165 | | & { color: blue; } + 166 | | color: red; + 167 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:163:1] + 163 | article { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:164:5] + 164 | color: green; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:166:5] + 166 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^^^^^^^^ + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^^^^^^ + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:165:5] + 165 | & { color: blue; } + : ^^^^ + `---- + + x Rule + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | ,-> .foo { + 170 | | color: red; + 171 | | @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | | } + 176 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | ,-> .foo { + 170 | | color: red; + 171 | | @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | | } + 176 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^^ + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^^ + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | ,-> .foo { + 170 | | color: red; + 171 | | @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | | } + 176 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:169:1] + 169 | .foo { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:170:5] + 170 | color: red; + : ^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | ,-> @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | ,-> @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | `-> } + `---- + + x AtRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | ,-> @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | `-> } + `---- + + x AtRuleName + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^ + `---- + + x MediaQueryList + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaQuery + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaCondition + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaConditionAllType + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaInParens + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaFeature + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaFeaturePlain + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^^^^^^^^^^ + `---- + + x MediaFeatureName + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^^^^^ + `---- + + x MediaFeatureValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^ + `---- + + x Dimension + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^ + `---- + + x Length + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^^^ + `---- + + x Number + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | ,-> @media (min-width: 480px) { + 172 | | & h1, & h2 { + 173 | | color: blue; + 174 | | } + 175 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:171:5] + 171 | @media (min-width: 480px) { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | ,-> & h1, & h2 { + 173 | | color: blue; + 174 | `-> } + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | ,-> & h1, & h2 { + 173 | | color: blue; + 174 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | ,-> & h1, & h2 { + 173 | | color: blue; + 174 | `-> } + `---- + + x RelativeSelectorList + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^^^^^^^^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x RelativeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^^^ + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^^^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x NestingSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x Combinator + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x TypeSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x TagNameSelector + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x WqName + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^^ + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | ,-> & h1, & h2 { + 173 | | color: blue; + 174 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/selector/nesting/input.css:172:9] + 172 | & h1, & h2 { + : ^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^^^^^^^^ + `---- + + x StyleBlock + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^^^^^^^^ + `---- + + x Declaration + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^^^^^^^^ + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^^ + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^ + `---- + + x Ident + ,-[$DIR/tests/fixture/selector/nesting/input.css:173:13] + 173 | color: blue; + : ^^^^ + `---- diff --git a/crates/swc_css_parser/tests/fixture/style-block/output.json b/crates/swc_css_parser/tests/fixture/style-block/output.json index 57abed4fff6..5e27126585a 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/output.json +++ b/crates/swc_css_parser/tests/fixture/style-block/output.json @@ -1164,7 +1164,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 477, "end": 487, @@ -1172,152 +1172,170 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 477, "end": 481, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 477, + "end": 481, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 477, "end": 478, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 477, + "end": 478, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 478, + "end": 479, + "ctxt": 0 + }, + "value": " " }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 479, - "end": 481, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 479, "end": 481, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 479, "end": 481, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 479, "end": 481, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 479, + "end": 481, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } }, { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 483, "end": 487, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 483, - "end": 484, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 483, + "end": 487, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 483, "end": 484, "ctxt": 0 - } + }, + "nestingSelector": { + "type": "NestingSelector", + "span": { + "start": 483, + "end": 484, + "ctxt": 0 + } + }, + "typeSelector": null, + "subclassSelectors": [] }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 + { + "type": "Combinator", + "span": { + "start": 484, + "end": 485, + "ctxt": 0 + }, + "value": " " }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 485, - "end": 487, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": { - "type": "TagNameSelector", + { + "type": "CompoundSelector", "span": { "start": 485, "end": 487, "ctxt": 0 }, - "name": { - "type": "WqName", + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", "span": { "start": 485, "end": 487, "ctxt": 0 }, - "prefix": null, - "value": { - "type": "Ident", + "name": { + "type": "WqName", "span": { "start": 485, "end": 487, "ctxt": 0 }, - "value": "h2", - "raw": "h2" + "prefix": null, + "value": { + "type": "Ident", + "span": { + "start": 485, + "end": 487, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } } - } - }, - "subclassSelectors": [] - } - ] + }, + "subclassSelectors": [] + } + ] + } } ] }, @@ -1584,7 +1602,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 594, "end": 602, @@ -1592,71 +1610,80 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 594, "end": 602, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 594, - "end": 595, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 594, + "end": 602, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 594, "end": 595, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 595, - "end": 596, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 596, - "end": 602, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 596, - "end": 602, + "start": 594, + "end": 595, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 595, + "end": 596, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 596, + "end": 602, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 597, + "start": 596, "end": 602, "ctxt": 0 }, - "value": "class", - "raw": "class" + "text": { + "type": "Ident", + "span": { + "start": 597, + "end": 602, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -1954,7 +1981,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 725, "end": 733, @@ -1962,71 +1989,80 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 725, "end": 733, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 725, + "end": 733, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 725, "end": 726, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 726, - "end": 727, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 727, - "end": 733, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 727, - "end": 733, + "start": 725, + "end": 726, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 726, + "end": 727, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 727, + "end": 733, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 728, + "start": 727, "end": 733, "ctxt": 0 }, - "value": "class", - "raw": "class" + "text": { + "type": "Ident", + "span": { + "start": 728, + "end": 733, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -2200,7 +2236,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 789, "end": 794, @@ -2208,51 +2244,60 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 789, "end": 794, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 789, - "end": 794, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 789, + "end": 794, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 789, - "end": 790, + "end": 794, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 790, - "end": 794, + "start": 789, + "end": 790, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 791, + "start": 790, "end": 794, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "text": { + "type": "Ident", + "span": { + "start": 791, + "end": 794, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } - } - ] - } - ] + ] + } + ] + } } ] }, @@ -2439,7 +2484,7 @@ "ctxt": 0 }, "prelude": { - "type": "SelectorList", + "type": "RelativeSelectorList", "span": { "start": 895, "end": 903, @@ -2447,71 +2492,80 @@ }, "children": [ { - "type": "ComplexSelector", + "type": "RelativeSelector", "span": { "start": 895, "end": 903, "ctxt": 0 }, - "children": [ - { - "type": "CompoundSelector", - "span": { - "start": 895, - "end": 896, - "ctxt": 0 - }, - "nestingSelector": { - "type": "NestingSelector", + "combinator": null, + "selector": { + "type": "ComplexSelector", + "span": { + "start": 895, + "end": 903, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", "span": { "start": 895, "end": 896, "ctxt": 0 - } - }, - "typeSelector": null, - "subclassSelectors": [] - }, - { - "type": "Combinator", - "span": { - "start": 896, - "end": 897, - "ctxt": 0 - }, - "value": " " - }, - { - "type": "CompoundSelector", - "span": { - "start": 897, - "end": 903, - "ctxt": 0 - }, - "nestingSelector": null, - "typeSelector": null, - "subclassSelectors": [ - { - "type": "ClassSelector", + }, + "nestingSelector": { + "type": "NestingSelector", "span": { - "start": 897, - "end": 903, + "start": 895, + "end": 896, "ctxt": 0 - }, - "text": { - "type": "Ident", + } + }, + "typeSelector": null, + "subclassSelectors": [] + }, + { + "type": "Combinator", + "span": { + "start": 896, + "end": 897, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 897, + "end": 903, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", "span": { - "start": 898, + "start": 897, "end": 903, "ctxt": 0 }, - "value": "class", - "raw": "class" + "text": { + "type": "Ident", + "span": { + "start": 898, + "end": 903, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } } - } - ] - } - ] + ] + } + ] + } } ] }, diff --git a/crates/swc_css_parser/tests/fixture/style-block/span.rust-debug b/crates/swc_css_parser/tests/fixture/style-block/span.rust-debug index 7eb256a9a11..8f4373189de 100644 --- a/crates/swc_css_parser/tests/fixture/style-block/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/style-block/span.rust-debug @@ -1456,12 +1456,18 @@ : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList ,-[$DIR/tests/fixture/style-block/input.css:33:9] 33 | & h1, & h2 { color: blue; } : ^^^^^^^^^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/style-block/input.css:33:9] + 33 | & h1, & h2 { color: blue; } + : ^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/style-block/input.css:33:9] 33 | & h1, & h2 { color: blue; } @@ -1516,6 +1522,12 @@ : ^^ `---- + x RelativeSelector + ,-[$DIR/tests/fixture/style-block/input.css:33:9] + 33 | & h1, & h2 { color: blue; } + : ^^^^ + `---- + x ComplexSelector ,-[$DIR/tests/fixture/style-block/input.css:33:9] 33 | & h1, & h2 { color: blue; } @@ -1879,7 +1891,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/style-block/input.css:41:9] + 41 | & .class { color: red } + : ^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/style-block/input.css:41:9] 41 | & .class { color: red } : ^^^^^^^^ @@ -2290,7 +2308,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/style-block/input.css:51:9] + 51 | & .class { color: red } + : ^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/style-block/input.css:51:9] 51 | & .class { color: red } : ^^^^^^^^ @@ -2554,7 +2578,13 @@ 60 | `-> } `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/style-block/input.css:58:5] + 58 | &.foo { + : ^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/style-block/input.css:58:5] 58 | &.foo { : ^^^^^ @@ -2831,7 +2861,13 @@ : ^^^^^^^^^^^^^^^^^^^^^^^ `---- - x SelectorList + x RelativeSelectorList + ,-[$DIR/tests/fixture/style-block/input.css:65:9] + 65 | & .class { color: red } + : ^^^^^^^^ + `---- + + x RelativeSelector ,-[$DIR/tests/fixture/style-block/input.css:65:9] 65 | & .class { color: red } : ^^^^^^^^ diff --git a/crates/swc_css_parser/tests/recovery/cdo-and-cdc/output.swc-stderr b/crates/swc_css_parser/tests/recovery/cdo-and-cdc/output.swc-stderr index 4230f7b44f2..f8d3622ce09 100644 --- a/crates/swc_css_parser/tests/recovery/cdo-and-cdc/output.swc-stderr +++ b/crates/swc_css_parser/tests/recovery/cdo-and-cdc/output.swc-stderr @@ -1,24 +1,54 @@ - x Expected whitespace, semicolon, EOF, at-keyword, '&' or ident token - ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:5:1] - 5 | : ^^^ `---- + + x Unexpected end of file, but expected '{' + ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:5:1] + 5 | ,-> + 10 | } + `---- + + x Unexpected end of file, but expected '{' + ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:14:1] + 14 | ,-> + 19 | | + 20 | `-> color: blue; + `---- + + x Unexpected end of file, but expected '{' + ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:25:1] + 25 | ,-> ; + `---- + + x Unexpected token + ,-[$DIR/tests/recovery/cdo-and-cdc/input.css:5:1] + 5 |