Skip to content

Commit

Permalink
Bug 1902735 [wpt PR 46764] - Fix counters instantiating, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Fix counters instantiating

As per https://drafts.csswg.org/css-lists/#instantiating-counters:

If innermost counter’s originating element is element or a previous
sibling of element, remove innermost counter from counters.

Fixed: 346974104
Change-Id: I938a13937cd629a9a4758483c0e118501629e302
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5630408
Reviewed-by: Vladimir Levin <[email protected]>
Commit-Queue: Daniil Sakhapov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1315384}

--

wpt-commits: 03c98d6db3f0f140a4f8ed706dc2737599f673f6
wpt-pr: 46764
  • Loading branch information
danielsakhapov authored and moz-wptsync-bot committed Jun 20, 2024
1 parent 1728ccd commit eb294ce
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
<span>6</span><!-- "6" -->
<span>0</span><!-- "0" -->
<x>
<span>0.2</span><!-- "0.2" -->
<span>2</span><!-- "2" -->
</x>
<span>0.3</span><!-- "0.3" -->
<span>3</span><!-- "3" -->
<x>
<span>0.3.0</span><!-- "0.3.0" -->
<span>0.3.2</span><!-- "0.3.2" -->
<span>0</span><!-- "0" -->
<span>2</span><!-- "2" -->
<x>
<span>0.3.2.5</span><!-- "0.3.2.5" -->
<span>2.5</span><!-- "2.5" -->
</x>
</x>
<span>0.3.3</span><!-- "0.3.3" -->
<span>3</span><!-- "3" -->

</body>
</html>
12 changes: 6 additions & 6 deletions testing/web-platform/tests/css/css-lists/counter-set-001.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
<span style="counter-set: n 6; counter-increment: n 2"></span><!-- "6" -->
<span style="counter-set: n; counter-increment: n 2"></span><!-- "0" -->
<x style="counter-reset: n 9">
<span style="counter-set: n 2"></span><!-- "0.2" -->
<span style="counter-set: n 2"></span><!-- "2" -->
</x>
<span style="counter-increment: n"></span><!-- "0.3" -->
<span style="counter-increment: n"></span><!-- "3" -->
<x style="counter-reset: n 9">
<span style="counter-set: n"></span><!-- "0.3.0" -->
<span style="counter-set: n 2"></span><!-- "0.3.2" -->
<span style="counter-set: n"></span><!-- "0" -->
<span style="counter-set: n 2"></span><!-- "2" -->
<x style="counter-reset: n 1">
<span style="counter-set: n 5"></span><!-- "0.3.2.5" -->
<span style="counter-set: n 5"></span><!-- "2.5" -->
</x>
</x>
<span style="counter-increment: n"></span><!-- "0.3.3" -->
<span style="counter-increment: n"></span><!-- "3" -->

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<p>The following two lines should be identical:</p>

<div>B 1 1.0 1 1.0</div>
<div>B 1 1.0 1 1.0</div>
<div>B 1 0 1 1.0</div>
<div>B 1 0 1 1.0</div>

</body>
</html>
2 changes: 1 addition & 1 deletion testing/web-platform/tests/css/css-lists/counters-005.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</span>
</div>

<div>B 1 1.0 1 1.0</div>
<div>B 1 0 1 1.0</div>

</body>
</html>
17 changes: 17 additions & 0 deletions testing/web-platform/tests/css/css-lists/counters-006-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>CSS Lists Ref Test: counters instantiating</title>
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-lists-3/#instantiating-counters">
<style type="text/css">
* {
padding: 0;
margin: 0;
}
</style>

<div>1.1.1.1</div>
<div>1.2.1.2</div>
<div>1.3.1.3</div>
<div>2.1.2.1</div>
<div>2.2.2.2</div>
<div>2.3.2.3</div>
38 changes: 38 additions & 0 deletions testing/web-platform/tests/css/css-lists/counters-006.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<title>CSS Lists: counters instantiating</title>
<link rel="author" title="Daniil Sakhapov" href="mailto:[email protected]">
<link rel="help" href="https://www.w3.org/TR/css-lists-3/#instantiating-counters">
<link rel="match" href="counters-006-ref.html">
<style type="text/css">
* {
padding: 0;
margin: 0;
}

.test {
counter-increment: section;
counter-reset: multilevel;
}

ol[multilevel] > li::before {
content: counter(section) "." counters(multilevel, ".") ".";
counter-increment: multilevel;
}

ol[multilevel] {
list-style: none !important;
clear: both;
}
</style>
<div class="test"></div>
<ol multilevel="multilevel">
<li>1.1</li>
<li>1.2</li>
<li>1.3</li>
</ol>
<div class="test"></div>
<ol multilevel="multilevel">
<li>2.1</li>
<li>2.2</li>
<li>2.3</li>
</ol>

0 comments on commit eb294ce

Please sign in to comment.