Percentage text-decoration-thickness values are resolved against the used font size instead of computed
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: xiaochengh, Assigned: jfkthame)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Steps to reproduce:
Go to https://jsfiddle.net/h9dqac15/, or render the following
<style>
u {
font-family: Ahem;
font-size: 20px;
}
</style>
<u style="text-decoration-thickness: 10%; font-size-adjust: 2">
É
</u>
<u style="text-decoration-thickness: 10%">
É
</u>
Actual results:
The two <u> elements have different underline thicknesses. The first one is thicker.
Expected results:
The two <u> elements have the same underline thickness
The spec [1] says percentage values of text-decoration-thickness "Specifies the thickness of text decoration lines as a percentage of 1em". So it shouldn't be affected by font-size-adjust or anything else that affects the used font size.
[1] https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-thickness-percentage
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
So the relevant code is here, we use the font's em height rather than the computed font-size.
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Agreed, this is a bug; the same also applies to percentage values of text-underline-offset
.
Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D109904
Assignee | ||
Comment 6•4 years ago
|
||
Thanks for reporting, Xiaocheng! I see the equivalent issue was recently fixed in Chrome Canary. :-)
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2dade59cbeef
https://hg.mozilla.org/mozilla-central/rev/480d28465472
Description
•