Re: [csswg-drafts] [css-contain] Scoping of the content property unclear.

OK! Also consider this generalization of the example in the spec:

```html
<div></div>
```
```css
div {
  contain: style;
  counter-increment: n;
}
div::before, div::after {
  content: counters(n, '.') ", ";
}
div::after {
  counter-increment: n 2;
}
```

When `content` refers to a counter which does not exist, a new counter is created (#2348).

So what happens if you use `counter()` or `counters()` inside a scoped subtree, and the counter does not exist in the subtree, but does exist in some ancestor?

I think creating a new counter seems more consistent with scoped `counter-increment` and `counter-set`. But since this is a read-only operation, it may not be necessary.

So should the example produce `1.0, 1.2,` or `1, 1.2,`? Chrome renders `0, 2,`.

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

Received on Friday, 6 April 2018 13:56:48 UTC