Skip to content

Commit

Permalink
[CSS Nesting] Always serialize relative selector with &
Browse files Browse the repository at this point in the history
The current spec mandates to always serialize the implicit &,
even when it's not necessary (such as .foo)

web-platform-tests#41213 (comment)
  • Loading branch information
Matthieu Dubet authored and mdubet committed Nov 9, 2023
1 parent acd3fbe commit 36e85c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions css/css-nesting/parsing.html
Expand Up @@ -47,15 +47,15 @@

// relative selector
testNestedSelector("> .bar", {expected:"& > .bar"});
testNestedSelector("> & .bar", {expected: "& > & .bar"});
testNestedSelector("> & .bar", {expected:"& > & .bar"});
testNestedSelector("+ .bar &", {expected:"& + .bar &"});
testNestedSelector("+ .bar, .foo, > .baz", {expected:"& + .bar, .foo, & > .baz"});
testNestedSelector("+ .bar, .foo, > .baz", {expected:"& + .bar, & .foo, & > .baz"});

// implicit relative (and not)
testNestedSelector(".foo");
testNestedSelector(".foo", {expected:"& .foo"});
testNestedSelector(".test > & .bar");
testNestedSelector(".foo, .foo &");
testNestedSelector(":is(.bar, .baz)");
testNestedSelector(".foo, .foo &", {expected:"& .foo, .foo &"});
testNestedSelector(":is(.bar, .baz)", {expected:"& :is(.bar, .baz)"});
testNestedSelector("&:is(.bar, .baz)");
testNestedSelector(":is(.bar, &.baz)");
testNestedSelector("&:is(.bar, &.baz)");
Expand Down

0 comments on commit 36e85c9

Please sign in to comment.