Files
sousa-gecko/testing/web-platform/tests/css/css-lists/css-lists-no-interpolation.html
T
Minseong Kim 4a5ca0d853 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
2025-12-04 09:24:53 +00:00

76 lines
1.4 KiB
HTML

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/4441">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<body>
<script>
test_no_interpolation({
property: 'counter-increment',
from: 'initial',
to: 'add 123'
});
test_no_interpolation({
property: 'counter-increment',
from: 'add 5',
to: 'add 123'
});
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'
});
test_no_interpolation({
property: 'counter-set',
from: 'initial',
to: 'add 123'
});
test_no_interpolation({
property: 'list-style-position',
from: 'initial',
to: 'inside'
});
test_no_interpolation({
property: 'list-style-type',
from: 'initial',
to: 'square'
});
</script>