Skip to content

Commit bd20806

Browse files
committed
Bug 2000404 - Allow counter and quotes properties in ::marker r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D272790
1 parent 1c2b83c commit bd20806

File tree

6 files changed

+156
-0
lines changed

6 files changed

+156
-0
lines changed

layout/style/test/property_database.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5438,6 +5438,7 @@ var gCSSProperties = {
54385438
domProp: "counterIncrement",
54395439
inherited: false,
54405440
type: CSS_TYPE_LONGHAND,
5441+
applies_to_marker: true,
54415442
initial_values: ["none"],
54425443
other_values: [
54435444
"foo 1",
@@ -5462,6 +5463,7 @@ var gCSSProperties = {
54625463
domProp: "counterReset",
54635464
inherited: false,
54645465
type: CSS_TYPE_LONGHAND,
5466+
applies_to_marker: true,
54655467
initial_values: ["none"],
54665468
other_values: [
54675469
"foo 1",
@@ -5485,6 +5487,7 @@ var gCSSProperties = {
54855487
domProp: "counterSet",
54865488
inherited: false,
54875489
type: CSS_TYPE_LONGHAND,
5490+
applies_to_marker: true,
54885491
initial_values: ["none"],
54895492
other_values: [
54905493
"foo 1",
@@ -7529,6 +7532,7 @@ var gCSSProperties = {
75297532
domProp: "quotes",
75307533
inherited: true,
75317534
type: CSS_TYPE_LONGHAND,
7535+
applies_to_marker: true,
75327536
initial_values: ["auto"],
75337537
other_values: [
75347538
"none",

servo/components/style/properties/data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,10 +1076,14 @@ def marker(data):
10761076
[
10771077
"color",
10781078
"content",
1079+
"counter-increment",
1080+
"counter-reset",
1081+
"counter-set",
10791082
"cursor",
10801083
"direction",
10811084
"hyphens",
10821085
"line-height",
1086+
"quotes",
10831087
"text-combine-upright",
10841088
"text-emphasis-color",
10851089
"text-emphasis-position",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
4+
<title>CSS Lists reference: use of `counter-*` in ::marker</title>
5+
6+
<link rel="author" href="mailto:jkew@mozilla.com">
7+
8+
<style>
9+
ol {
10+
padding-left: 5em;
11+
}
12+
li:nth-child(1)::marker {
13+
content: "[1] ";
14+
}
15+
li:nth-child(2)::marker {
16+
content: "[2] ";
17+
}
18+
li:nth-child(3)::marker {
19+
content: "[10] ";
20+
}
21+
li:nth-child(4)::marker {
22+
content: "[11] ";
23+
}
24+
li:nth-child(5)::marker {
25+
content: "[12] ";
26+
}
27+
li:nth-child(6)::marker {
28+
content: "[12:1] ";
29+
}
30+
li:nth-child(7)::marker {
31+
content: "[13] ";
32+
}
33+
li:nth-child(8)::marker {
34+
content: "[14] ";
35+
}
36+
</style>
37+
38+
<ol>
39+
<li>one
40+
<li>two
41+
<li class=set>set to 10
42+
<li>next item
43+
<li>next item
44+
<li class=reset>reset (12:2)
45+
<li>next item
46+
<li>last item
47+
</ol>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
4+
<title>CSS Lists test: use of `counter-*` in ::marker</title>
5+
6+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#marker-properties">
7+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5265#issuecomment-3531669680">
8+
<meta name="assert" content="counter-* properties are supported in ::marker">
9+
10+
<link rel="author" href="mailto:jkew@mozilla.com">
11+
12+
<link rel="match" href="marker-counter-ref.html">
13+
14+
<style>
15+
ol {
16+
counter-reset: my-counter;
17+
padding-left: 5em;
18+
}
19+
::marker {
20+
counter-increment: my-counter;
21+
content: "[" counters(my-counter, ":") "] ";
22+
}
23+
.set::marker {
24+
counter-set: my-counter 10;
25+
}
26+
.reset::marker {
27+
counter-reset: my-counter;
28+
}
29+
.reset::after {
30+
counter-increment: my-counter;
31+
content: " (" counters(my-counter, ":") ")";
32+
}
33+
</style>
34+
35+
<ol>
36+
<li>one
37+
<li>two
38+
<li class=set>set to 10
39+
<li>next item
40+
<li>next item
41+
<li class=reset>reset <!-- instantiates a new counter on the current item -->
42+
<li>next item
43+
<li>last item
44+
</ol>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
4+
<title>CSS Lists reference: use of `quotes` in ::marker</title>
5+
6+
<link rel="author" href="mailto:jkew@mozilla.com">
7+
8+
<style>
9+
li:nth-child(1)::marker {
10+
content: "\2018" "1" "\2019" " ";
11+
}
12+
li:nth-child(2)::marker {
13+
content: "«2»" " ";
14+
}
15+
li:nth-child(3)::marker {
16+
content: "‹3›" " ";
17+
}
18+
</style>
19+
20+
<ol>
21+
<li>one
22+
<li>two
23+
<li>three
24+
</ol>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
4+
<title>CSS Lists test: use of `quotes` in ::marker</title>
5+
6+
<link rel="help" href="https://drafts.csswg.org/css-lists-3/#marker-properties">
7+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5265#issuecomment-3531669680">
8+
<meta name="assert" content="the quotes property is supported in ::marker">
9+
10+
<link rel="author" href="mailto:jkew@mozilla.com">
11+
12+
<link rel="match" href="marker-quotes-ref.html">
13+
14+
<style>
15+
ol {
16+
quotes: "\2018" "\2019";
17+
}
18+
::marker {
19+
content: open-quote counter(list-item) close-quote " ";
20+
}
21+
:nth-child(2)::marker {
22+
quotes: "«" "»";
23+
}
24+
:nth-child(3)::marker {
25+
quotes: "‹" "›";
26+
}
27+
</style>
28+
29+
<ol>
30+
<li>one
31+
<li>two
32+
<li>three
33+
</ol>

0 commit comments

Comments
 (0)