Files
sousa-gecko/testing/web-platform/tests/css/css-lists/counter-reset-reversed-nested-ref.html
T
Minseong Kim 284d28e1fb Bug 2018933 [wpt PR 58010] - [css-lists] Fix initial value for reversed CSS counters, a=testonly
Automatic update from web-platform-tests
[css-lists] Fix initial value for reversed CSS counters

When `counter-reset` uses the `reversed()` function, its initial value
must be calculated based on the number of items within its scope. The
previous implementation did not handle this correctly.

This patch implements the correct behavior according to the CSS spec.
The value calculation for reversed counters is now computed by
traversing the list scope when we face the content-based reset style.

This also amends `ol-reversed-dynamic.html` test that removes the
`value` attribute dynamically. This was incorrectly fixed in
crrev.com/c/7126701. It will be fixed in the following CL.

And `counter-reset-reversed-*` and `li-value-reversed-*` tests are
created to verify these changes.

Bug: 40682542
Change-Id: I8698e59ee2a692d45e5b3da6a9e0c763440ab4f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7482809
Commit-Queue: Minseong Kim <jja08111@gmail.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1589329}

--

wpt-commits: cad51099291e6fa7a00e76b40092c4b29c8af0aa
wpt-pr: 58010
2026-02-26 15:20:13 +00:00

18 lines
447 B
HTML

<!doctype html>
<title>CSS Lists Reference: nested counter-reset: reversed() with counter-set and increment</title>
<style>
li { display: block }
li::before { content: attr(data-marker) ". "; }
</style>
<ol>
<li data-marker="3">Three</li>
<li data-marker="2">Two
<ol>
<li data-marker="11">Eleven</li>
<li data-marker="9">Nine</li>
<li data-marker="8">Eight</li>
</ol>
</li>
<li data-marker="1">One</li>
</ol>