Skip to content

Commit 0608332

Browse files
jja08111chromium-wpt-export-bot
authored andcommitted
[css-lists] Apply new algorithm for initial counter in reversed list
This CL applies the last non-zero increment version algorithm[1] that accounts an initial counter value. If we have an explicit start value, we don't apply a counter increment of the list item. E.g., if the list is reversed, then plus one, else minus one to the initial counter value. This is same as Firefox's behaviour. And this CL renames functions which is related an instantiating counters to `InitialCounter*` for aligning with the spec. [1]: w3c/csswg-drafts#6797 Bug: 40682542 Change-Id: I8188288062461ca4c5689e530db3255f9c31ebcb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7126701 Commit-Queue: Minseong Kim <[email protected]> Reviewed-by: Daniil Sakhapov <[email protected]> Reviewed-by: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1542452}
1 parent 60e6e3a commit 0608332

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

css/css-lists/li-value-reversed-012.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#auto-numbering">
66
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#instantiating-counters">
77
<link rel="author" title="Minseong Kim" href="mailto:[email protected]">
8-
<link rel="match" href="li-value-reversed-012-ref.html">
8+
<link rel="match" href="li-value-reversed-011-ref.html">
99
<ol reversed>
1010
<li style="counter-increment: list-item -2">Three
1111
<li>Two
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<title>Interaction of ol reversed and list-item value</title>
3+
<link rel="help" href="https://html.spec.whatwg.org/#attr-ol-reversed">
4+
<link rel="help" href="https://html.spec.whatwg.org/#ordinal-value">
5+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#auto-numbering">
6+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#instantiating-counters">
7+
<link rel="author" title="Minseong Kim" href="mailto:[email protected]">
8+
<link rel="match" href="li-value-reversed-011-ref.html">
9+
<ol reversed start=5>
10+
<li style="counter-increment: list-item -3">Three
11+
<li>Two
12+
<li>One
13+
</ol>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<!doctype html>
22
<title>CSS Test Reference</title>
33
<ol>
4-
<li value=3>Three
4+
<li value=6>Six
5+
<li value=5>Five
6+
<li value=4>Four
57
<li value=2>Two
68
<li value=1>One
79
</ol>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<title>Interaction of ol reversed and list-item value</title>
3+
<link rel="help" href="https://html.spec.whatwg.org/#attr-ol-reversed">
4+
<link rel="help" href="https://html.spec.whatwg.org/#ordinal-value">
5+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#auto-numbering">
6+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#instantiating-counters">
7+
<link rel="author" title="Minseong Kim" href="mailto:[email protected]">
8+
<link rel="match" href="li-value-reversed-022-ref.html">
9+
<ol reversed>
10+
<li>Six
11+
<li style="counter-set: list-item 5">Five
12+
<li>Four
13+
<li style="counter-set: list-item 2">Two
14+
<li>One
15+
</ol>

0 commit comments

Comments
 (0)