Skip to content

Commit 29cfe68

Browse files
Loirooriolchromium-wpt-export-bot
authored andcommitted
[css-pseudo] Don't inherit text-indent to ::marker
The CSSWG resolved in w3c/csswg-drafts#4568 that properties like 'text-indent' that don't apply to ::marker, should not be able to affect the ::marker via inheritance when set to an ancestor. Therefore, this patch sets 'text-indent: 0 !important' in UA origin. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-content-023.html TEST=external/wpt/css/css-pseudo/marker-default-styles.html TEST=http/tests/devtools/elements/styles-2/pseudo-elements.js Change-Id: I4dd9e8afd448bd5fe237c084d3c0215e91560dd1
1 parent 350d1d9 commit 29cfe68

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
>
2+
<meta charset="utf-8">
3+
<title>CSS Reference: ::marker pseudo elements styled with 'content' propertytitle>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<style>
6+
.disc {
7+
list-style-type: disc;
8+
}
9+
.decimal {
10+
list-style-type: decimal;
11+
}
12+
.string {
13+
list-style-type: "3. ";
14+
}
15+
.content::marker {
16+
content: "4. ";
17+
}
18+
.rtl-marker ::marker {
19+
direction: rtl;
20+
}
21+
style>
22+
<ol>
23+
<li class="disc"><div>discdiv>li>
24+
<li class="decimal"><div>decimaldiv>li>
25+
<li class="string"><div>stringdiv>li>
26+
<li class="content"><div>contentdiv>li>
27+
ol>
28+
<ol class="rtl-marker">
29+
<li class="disc"><div>discdiv>li>
30+
<li class="decimal"><div>decimaldiv>li>
31+
<li class="string"><div>stringdiv>li>
32+
<li class="content"><div>contentdiv>li>
33+
ol>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
>
2+
<meta charset="utf-8">
3+
<title>CSS Test: ::marker pseudo elements styled with 'content' propertytitle>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<link rel="match" href="marker-content-023-ref.html">
6+
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
7+
<link rel="help" href="https://drafts.csswg.org/css-text/#text-indent-property">
8+
<meta name="assert" content="Checks that 'text-indent' doesn't apply nor inherit to ::marker.">
9+
<style>
10+
li {
11+
text-indent: 100px; /* Should not be inherited by ::marker */
12+
}
13+
::marker {
14+
text-indent: 100px; /* Should have no effect */
15+
}
16+
li > div {
17+
text-indent: 0;
18+
}
19+
.disc {
20+
list-style-type: disc;
21+
}
22+
.decimal {
23+
list-style-type: decimal;
24+
}
25+
.string {
26+
list-style-type: "3. ";
27+
}
28+
.content::marker {
29+
content: "4. ";
30+
}
31+
.rtl-marker ::marker {
32+
direction: rtl;
33+
}
34+
style>
35+
<ol>
36+
<li class="disc"><div>discdiv>li>
37+
<li class="decimal"><div>decimaldiv>li>
38+
<li class="string"><div>stringdiv>li>
39+
<li class="content"><div>contentdiv>li>
40+
ol>
41+
<ol class="rtl-marker">
42+
<li class="disc"><div>discdiv>li>
43+
<li class="decimal"><div>decimaldiv>li>
44+
<li class="string"><div>stringdiv>li>
45+
<li class="content"><div>contentdiv>li>
46+
ol>

css/css-pseudo/marker-default-styles.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
.decimal { list-style-type: decimal }
1212
.string { list-style-type: "string" }
1313
.marker::marker { content: "marker" }
14-
li { text-transform: lowercase }
14+
li {
15+
/* These inheritable properties should not be inherited by ::marker */
16+
text-transform: lowercase;
17+
text-indent: 1px;
18+
}
1519
style>
1620
<div id="log">div>
1721
<ul>
@@ -32,6 +36,7 @@
3236
["unicode-bidi", "isolate"],
3337
["font-variant-numeric", "tabular-nums"],
3438
["text-transform", "none"],
39+
["text-indent", "0px"],
3540
];
3641
for (const target of document.querySelectorAll("li")) {
3742
const cs = getComputedStyle(target, "::marker");

0 commit comments

Comments
 (0)