Re: [csswg-drafts] [css-nesting] Concern about combinatorial explosion

>From my understanding,

```css
a b {
  & c d { }
  e f & { }
}
```
should expand to
```css
:matches(a b) c d { }
e f :matches(a b) { }
```
Sure, the parent part is repeated but there is no combinatorial explosion.

The problem seems indeed when `&` is used multiple times in an inner selector:

```css
a1, a2 {
  & b1, & b2 {
    & c1, & c2 {}
  }
}
```

expands to

```css
:matches(:matches(a1, a2) b1, :matches(a1, a2) b2) c1,
:matches(:matches(a1, a2) b1, :matches(a1, a2) b2) c2 {}
```

but then I think implementations should just not do this, and reuse the parent part without actually duplicating it.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2881#issuecomment-402794879 using your GitHub account

Received on Thursday, 5 July 2018 17:23:49 UTC