-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-contain] unclear about counter() in 'contain: style' context #9116
Comments
The idea is that you can read across the style containment boundary, but not modify. |
Right, but then the wpt test is wrong, isn't it? Counter at div::after should access the 13 from the |
TBH the implementations are quite broken (e.g. Blink says 0 for |
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary and the first counter-increment will create a counter, that will be inherited by its siblings, so class="contain" element will have a counter from its previous sibling, and counters() inside the style containment scopes will have access to this counter. Bug: 990657 Change-Id: I9ff784577d37b7a936e96a21548006b8b0d7848d
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary and the first counter-increment will create a counter, that will be inherited by its siblings, so class="contain" element will have a counter from its previous sibling, and counters() inside the style containment scopes will have access to this counter. Bug: 990657 Change-Id: I9ff784577d37b7a936e96a21548006b8b0d7848d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4839207 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1203928}
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571}
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571}
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571}
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 2a2fdf7316964d175c39754df1bd348a9da555f1
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 1d596d12047a698634b528896d66aa0b3d116cf5
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 2a2fdf7316964d175c39754df1bd348a9da555f1
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 1d596d12047a698634b528896d66aa0b3d116cf5
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 2a2fdf7316964d175c39754df1bd348a9da555f1
Automatic update from web-platform-tests Fix WPT CSS Counters test As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futharkchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> Cr-Commit-Position: refs/heads/main{#1204571} -- wpt-commits: dcb79ca1856efaa5ac6b455d1f96f63e3038e663 wpt-pr: 41799 UltraBlame original commit: 1d596d12047a698634b528896d66aa0b3d116cf5
As per: https://drafts.csswg.org/css-contain/#example-6932a400 and w3c/csswg-drafts#9116 counter() and counters() can cross the style containment boundary, so the result should be 13 from the body's counter-reset. Bug: 990657 Change-Id: Iee313a5ed6f487865b1b7c754aa45b736f6b8f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836162 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1204571}
The test has since been fixed, and the value of the counter on body can indeed be read. |
Note: the results of that test might change (for other reasons) depending on the outcome of #5175, though current interop suggests that this will remain correct. |
I'm confused a bit about the behavior of content: counter() in the context of 'contain: style'.
The spec says:
However, the counter() and counters() value of the content property is not itself scoped, and can refer to counters established outside of the subtree.
My interpretation is that we can leave the style containment scope for search of the counter value.
And the example after the text above shows the same.
But the test, which all the browsers pass tells the other story, it doesn't allow the access to the reset on body element.
So, my question - is my understanding incorrect? If so, why we can access the 1 for div::before in example, doesn't it cross the style containment boundary?
The text was updated successfully, but these errors were encountered: