-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-pseudo] Support 'line-height' property in ::marker
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c
- Loading branch information
1 parent
0fc65fe
commit 2d174ca
Showing
4 changed files
with
120 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]" /> | ||
<style> | ||
ol { | ||
float: left; | ||
width: 50px; | ||
list-style-position: inside; | ||
line-height: 3; | ||
} | ||
li:first-child { | ||
list-style-type: disc; | ||
} | ||
div { | ||
line-height: 1; | ||
} | ||
</style> | ||
<ol> | ||
<li></li> | ||
<li></li> | ||
<li></li> | ||
<li></li> | ||
</ol> | ||
<ol> | ||
<li></li> | ||
<li></li> | ||
<li></li> | ||
<li></li> | ||
</ol> | ||
<ol> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
</ol> | ||
<ol> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
<li><div>x</div></li> | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>::marker supports 'line-height'</title> | ||
<link rel="author" title="Oriol Brufau" href="mailto:[email protected]" /> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo"> | ||
<link rel="help" href="https://drafts.csswg.org/css-inline/#propdef-line-height"> | ||
<link rel="match" href="marker-line-height-ref.html"> | ||
<meta name="assert" content="Checks that ::marker supports 'line-height', both explicitly set or inherited from an ancestor"> | ||
<style> | ||
ol { | ||
float: left; | ||
width: 50px; | ||
list-style-position: inside; | ||
} | ||
ol, ol div { | ||
line-height: 1; | ||
font-size: 1rem; | ||
} | ||
.line-height.explicit ::marker, | ||
.line-height.inherit { | ||
line-height: 3; | ||
} | ||
.line-height.inherit li { | ||
font-size: 0; /* Remove the strut, which would defeat the test */ | ||
} | ||
.line-height.inherit ::marker { | ||
font-size: 1rem; /* Restore the font-size */ | ||
} | ||
.marker-disc { | ||
list-style-type: disc; | ||
} | ||
.marker-decimal { | ||
list-style-type: decimal; | ||
} | ||
.marker-string { | ||
list-style-type: "3. "; | ||
} | ||
.marker-content::marker { | ||
content: "4. "; | ||
} | ||
</style> | ||
<ol class="line-height explicit"> | ||
<li class="marker-disc"></li> | ||
<li class="marker-decimal"></li> | ||
<li class="marker-string"></li> | ||
<li class="marker-content"></li> | ||
</ol> | ||
<ol class="line-height inherit"> | ||
<li class="marker-disc"></li> | ||
<li class="marker-decimal"></li> | ||
<li class="marker-string"></li> | ||
<li class="marker-content"></li> | ||
</ol> | ||
<ol class="line-height explicit"> | ||
<li class="marker-disc"><div>x</div></li> | ||
<li class="marker-decimal"><div>x</div></li> | ||
<li class="marker-string"><div>x</div></li> | ||
<li class="marker-content"><div>x</div></li> | ||
</ol> | ||
<ol class="line-height inherit"> | ||
<li class="marker-disc"><div>x</div></li> | ||
<li class="marker-decimal"><div>x</div></li> | ||
<li class="marker-string"><div>x</div></li> | ||
<li class="marker-content"><div>x</div></li> | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters