[csswg-drafts] [css2][css-content] close-quote refers to wrong quote pair

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css2][css-content] close-quote refers to wrong quote pair ==
[CSS 2](https://www.w3.org/TR/CSS22/generate.html#quotes-insert) and [CSS content](https://drafts.csswg.org/css-content/#quote-values) say

> 'Open-quote' refers to the first of a pair of quotes, 'close-quote' refers to the second. Which pair of quotes is used depends on the nesting level of quotes: the number of occurrences of 'open-quote' in all generated text before the current occurrence, minus the number of occurrences of 'close-quote'. If the depth is 0, the first pair is used, if the depth is 1, the second pair is used, etc.

Not sure if I'm missing something, but consider this simple example:

```html
<div></div>
```
```css
div { quotes: "[1." ".1]" "[2." ".2]" }
div::before { content: open-quote }
div::after { content: close-quote }
```

In `div::before`,
 - Previous occurrences of `open-quote`: `0`
 - Previous occurrences of `close-quote`: `0`
 - Depth: `0 - 0 = 0`
 - Pair used: `"[1." ".1]"`
 - Generated content: `[1.`

In `div::after`,
 - Previous occurrences of `open-quote`: `1`
 - Previous occurrences of `close-quote`: `0`
 - Depth: `1 - 0 = 1`
 - Pair used: `"[2." ".2]"`
 - Generated content: `.2]`

So reading the spec I expect `[1..2]` but obviously it should be `[1..1]`.

Probably `close-quote` should also count the current occurrence when determining the depth.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2506 using your GitHub account

Received on Thursday, 5 April 2018 19:22:55 UTC