Underline stroke not sized properly
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Tracking
()
People
(Reporter: lafleur.justin, Unassigned)
References
()
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Steps to reproduce:
- Render this markup "<u>some<span style="font-size: 36px;">underlined</span>text</u>" in latest chrome
- Render the same markup in Firefox
Actual results:
The word "underlined" does not have a size 36px underline.
Expected results:
The word "underlined" should have a size 36px underline.
![]() |
||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
I don't think CSS requires that the decoration thickness and position changes like in Chrome and Safari. It's a bit unclear, but I think from the example in https://drafts.csswg.org/css-text-decor-4/#line-position and the paragraph just before the example, using a single decoration thickness and position for this markup is acceptable.
Comment 2•6 years ago
|
||
AIUI, the Chrome and Safari behavior here is a bug; it is explicitly not allowed by the spec. The Firefox behavior is correct.
In https://drafts.csswg.org/css-text-decor-3/#text-underline-position-property, we find:
The exact position and thickness of line decorations is UA-defined in this level. However, for underlines and overlines the UA must use a single thickness and position on each line for the decorations deriving from a single decorating box.
The decorating box here is the <u> element, and the spec requires that a single thickness and position be used for its underline.
To achieve an effect where the large text has a correspondingly larger underline, a separate decoration should be applied:
data:text/html,<u>some</u><u style="font-size: 36px;">underlined</u><u>text</u>
I believe the webkit/blink bug here is essentially the same one as is clearly illustrated by
data:text/html,<u>some <sup>underlined</sup> text</u>
where according to the spec, there should be a single continuous underline; it should not move up with the superscripted text.
Description
•