Skip to content

Commit a311181

Browse files
Loirooriolchromium-wpt-export-bot
authored andcommitted
[css-pseudo] Move all ::marker style adjustments into StyleAdjuster
LayoutNGListItem was applying some style adjustments to markers, like 'white-space: pre' to preserve trailing spaces in outside markers. But this was only affecting markers with 'content: normal', and the changes weren't exposed in getComputedStyle(). This patch moves these adjustments into StyleAdjuster, so that all markers are affected equally. BUG=457718 TEST=external/wpt/css/css-pseudo/marker-content-018.html The test fails in legacy because the 'content' property is not supported yet in ::marker. There is a new failure in marker-supported-properties.html because now 'white-space' will compute to 'pre' in outside markers, even if you specify a different value. But normal markers were already enforcing 'pre' at used value time anyways. Change-Id: I6d8b8ec7fb26cb04402032924f87b2c3b8fdb9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985966 Reviewed-by: Rune Lillesveen <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#728176}
1 parent 3513bf9 commit a311181

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>CSS Reference: ::marker pseudo elements styled with 'content' property</title>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<style>
6+
ol {
7+
float: left;
8+
width: 100px;
9+
}
10+
.inside {
11+
list-style-position: inside;
12+
}
13+
li:nth-child(1) { list-style-type: "1" }
14+
li:nth-child(2) { list-style-type: "1 " }
15+
li:nth-child(3) { list-style-type: "1 " }
16+
li:nth-child(4) { list-style-type: " 1" }
17+
li:nth-child(5) { list-style-type: " 1" }
18+
li:nth-child(6) { list-style-type: " 1 " }
19+
li:nth-child(7) { list-style-type: "1\9 2" }
20+
li:nth-child(8) { list-style-type: "1\a 2" }
21+
</style>
22+
<ol class="inside">
23+
<li>item</li>
24+
<li>item</li>
25+
<li>item</li>
26+
<li>item</li>
27+
<li>item</li>
28+
<li>item</li>
29+
<li>item</li>
30+
<li>item</li>
31+
</ol>
32+
<ol class="inside">
33+
<li> item</li>
34+
<li> item</li>
35+
<li> item</li>
36+
<li> item</li>
37+
<li> item</li>
38+
<li> item</li>
39+
<li> item</li>
40+
<li> item</li>
41+
</ol>
42+
<ol class="outside">
43+
<li>item</li>
44+
<li>item</li>
45+
<li>item</li>
46+
<li>item</li>
47+
<li>item</li>
48+
<li>item</li>
49+
<li>item</li>
50+
<li>item</li>
51+
</ol>
52+
<ol class="outside">
53+
<li> item</li>
54+
<li> item</li>
55+
<li> item</li>
56+
<li> item</li>
57+
<li> item</li>
58+
<li> item</li>
59+
<li> item</li>
60+
<li> item</li>
61+
</ol>
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>CSS Test: ::marker pseudo elements styled with 'content' property</title>
4+
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]">
5+
<link rel="match" href="marker-content-018-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-3/#white-space-rules">
8+
<meta name="assert" content="Checks that the 'content' property of a ::marker doesn't affect white space.">
9+
<style>
10+
ol {
11+
float: left;
12+
width: 100px;
13+
}
14+
.inside {
15+
list-style-position: inside;
16+
}
17+
li:nth-child(1)::marker { content: "1" }
18+
li:nth-child(2)::marker { content: "1 " }
19+
li:nth-child(3)::marker { content: "1 " }
20+
li:nth-child(4)::marker { content: " 1" }
21+
li:nth-child(5)::marker { content: " 1" }
22+
li:nth-child(6)::marker { content: " 1 " }
23+
li:nth-child(7)::marker { content: "1\9 2" }
24+
li:nth-child(8)::marker { content: "1\a 2" }
25+
</style>
26+
<ol class="inside">
27+
<li>item</li>
28+
<li>item</li>
29+
<li>item</li>
30+
<li>item</li>
31+
<li>item</li>
32+
<li>item</li>
33+
<li>item</li>
34+
<li>item</li>
35+
</ol>
36+
<ol class="inside">
37+
<li> item</li>
38+
<li> item</li>
39+
<li> item</li>
40+
<li> item</li>
41+
<li> item</li>
42+
<li> item</li>
43+
<li> item</li>
44+
<li> item</li>
45+
</ol>
46+
<ol class="outside">
47+
<li>item</li>
48+
<li>item</li>
49+
<li>item</li>
50+
<li>item</li>
51+
<li>item</li>
52+
<li>item</li>
53+
<li>item</li>
54+
<li>item</li>
55+
</ol>
56+
<ol class="outside">
57+
<li> item</li>
58+
<li> item</li>
59+
<li> item</li>
60+
<li> item</li>
61+
<li> item</li>
62+
<li> item</li>
63+
<li> item</li>
64+
<li> item</li>
65+
</ol>

0 commit comments

Comments
 (0)