commit 4a5ca0d853a2aef17b689e63ad58616fab42e5f2
parent 5677f188185cefc5c96a8a27a77fdd0734c48dfc
Author: Minseong Kim <jja08111@gmail.com>
Date: Wed, 3 Dec 2025 13:56:56 +0000
Bug 2003254 [wpt PR 56364] - [css-lists] Support for parsing counter-reset: reversed(counter-name), a=testonly
Automatic update from web-platform-tests
[css-lists] Support for parsing counter-reset: reversed(counter-name)
This CL introduces support for the `reversed()` function within the
`counter-reset` CSS property. This allows authors to specify that a
counter should be reset in a reversed order.
This CL includes:
- Adding `reversed` as a recognized CSS value keyword.
- Adding `CSSCounterValue` class for parsing.
- Modifying `CounterDirectives` to store a `is_reset_reversed_` flag.
- Updating CSS parsing utilities to correctly parse new syntax.
- Updating relevant WPTs to reflect the new parsing behaviour.
This CL also fixes `CounterRulesEqual` by iterating over one of
`CounterDirectiveMap` and do a lookup with a comparison against the
other.
The new behavior is behind a runtime flag, CSSCounterResetReversed.
Spec: https://drafts.csswg.org/css-lists-3/#counter-reset
Bug: 40760770
Change-Id: I5bf294c70ea7db67580bd4db2caf54c509a96c5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7150339
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Commit-Queue: Minseong Kim <jja08111@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1551991}
--
wpt-commits: ee3c6083c19d22841061d808405d54f9b878dc1b
wpt-pr: 56364
Diffstat:
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-lists/css-lists-no-interpolation.html b/testing/web-platform/tests/css/css-lists/css-lists-no-interpolation.html
@@ -21,6 +21,36 @@ test_no_interpolation({
test_no_interpolation({
property: 'counter-reset',
+ from: 'reversed(foo) 5',
+ to: 'reversed(foo) 123'
+});
+
+test_no_interpolation({
+ property: 'counter-reset',
+ from: 'reversed(foo)',
+ to: 'reversed(foo) 123'
+});
+
+test_no_interpolation({
+ property: 'counter-reset',
+ from: 'foo 123',
+ to: 'reversed(foo) 123'
+});
+
+test_no_interpolation({
+ property: 'counter-reset',
+ from: 'foo',
+ to: 'reversed(foo)'
+});
+
+test_no_interpolation({
+ property: 'counter-reset',
+ from: 'initial',
+ to: 'reversed(foo)'
+});
+
+test_no_interpolation({
+ property: 'counter-reset',
from: 'initial',
to: 'add 123'
});
diff --git a/testing/web-platform/tests/css/selectors/is-where-error-crash.html b/testing/web-platform/tests/css/selectors/is-where-error-crash.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<title>CSS Selectors: :is() and :where() error crash</title>
+<link rel="help" href="https://crbug.com/464739072">
+<style>
+:is(c|l:i) {}
+:where(c|l:i) {}
+</style>
+<p>Test passes if page does not crash.</p>