Skip to content

Commit

Permalink
[counter-style] Add a test for styling list markers via shadow DOM part
Browse files Browse the repository at this point in the history
Note: this test case is the same as example FOUR in

w3c/csswg-drafts#1995 (comment)

Bug: 1225033
Change-Id: Ic02c6c0e9c623c4eb12ac4bc152716f63f6ebd52
  • Loading branch information
xiaochengh authored and chromium-wpt-export-bot committed Jul 14, 2021
1 parent 04ab41d commit 94038ab
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>

<ol>
<div>A.</div>
<div>B.</div>
<div>C.</div>
</ol>

35 changes: 35 additions & 0 deletions css/css-counter-styles/counter-styles-shadow-dom-part.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<title>Counter style tree-scoped references</title>
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#the-counter-style-rule">
<link rel="help" href="https://drafts.csswg.org/css-scoping/#shadow-names">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="match" href="counter-styles-shadow-dom-part-ref.html">
<meta name="assert" content="The list in the shadow tree should use the counter style defined in the outer document, because it's styled by the outer document">

<style>
@counter-style foo {
system: fixed;
symbols: A B C;
}
#host::part(list) {
list-style-type: foo;
}
</style>

<div id="host"></div>

<script>
document.getElementById("host").attachShadow({mode: 'open'}).innerHTML = `
<style>
@counter-style foo {
system: fixed;
symbols: D E F;
}
</style>
<ol part="list" style="list-style-position: inside">
<li></li>
<li></li>
<li></li>
</ol>
`;
</script>

0 comments on commit 94038ab

Please sign in to comment.