[css2][css-content] close-quote refers to wrong quote pair · Issue #2506 · w3c/csswg-drafts (original) (raw)

CSS 2 and CSS content 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:

div { quotes: "[1." ".1]" "[2." ".2]" } div::before { content: open-quote } div::after { content: close-quote }

div::before div::after
Previous occurrences of open-quote 0 1
Previous occurrences of close-quote 0 0
Depth 0 - 0 = 0 1 - 0 = 1
Pair used "[1." ".1]" "[2." ".2]"
Generated content [1. .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.