W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

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

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Thu, 05 Jul 2018 17:23:45 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-402794879-1530811424-sysbot+gh@w3.org>
>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

This archive was generated by hypermail 2.3.1 : Thursday, 5 July 2018 17:23:51 UTC