[csswg-drafts] [css-contain] Style containment for counters (#9212)

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

== [css-contain] Style containment for counters ==
While looking at: https://github.com/web-platform-tests/wpt/blob/efde03a7b7/css/css-contain/counter-scoping-004.html

It seemed to me that this WPT was incorrect, and that Blink & WebKit's behaviors were correct here.

Since `::before` (where we read the counter) is _inside_ the style containment tree (it's a tree abiding pseudo element), `counter-increment` on the scoping element shouldn't have any effect on the counter inside tree.

I believe that is the intention of the spec as well:

> If scoped to a sub-tree, it’s the same, except the scoping element itself is counted as "outside" the tree [...] When considering the effects of the scoped property on elements inside the subtree, the element at the base of the subtree is treated as if it was the root of the document.

To me that essentially means we take all the elements inside the subtree excluding the scoping element, and put that in its own document. Meaning the counter should always be "0" on the `contain: style` element, since the counter is never incremented (since the element that increments it is outside of that "document").

@emilio Can you describe what your interpretation was?





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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 21 August 2023 22:10:09 UTC