text-underline-offset has wrong baseline for vertical text when set to 0
Categories
(Core :: Layout, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: cmarlow, Assigned: cmarlow)
Details
Attachments
(2 files)
When text-underline-offset has been set, and the text-underline-position has not been set, at 0 it should default to the alphabetic baseline of the text. It does this in horizontal mode, but in vertical mode it defaults to the center of the text.
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
Here's a sample file I've been using to look at the effect of this locally. Based on what I see here, I think we probably want to tweak things a bit further. Observations...
-
With current trunk code (i.e. without this patch), the
auto
position of the underline looks fine, and thetext-underline-offset:0px
position looks perfect in horizontal mode (it exactly touches the alphabetic baseline). Insideways-*
writing modes, the result looks exactly like the horizontal result, just rotated by 90°, which is what I'd expect. Invertical-*
modes, thetext-underline-offset:0px
position is centered, which is bad, and is what we primarily want to fix here. -
With this patch applied, the
text-underline-offset:0px
invertical-*
modes is much better. (It's hard to say what the exact "correct" position would be, but the result here looks reasonable to me.) However, insideways-*
modes, the position has been shifted slightly, such that it's now fractionally away from the alphabetic baseline -- there's a 1px gap or thereabouts. This seems regrettable; those cases looked perfect previously. Can we make sure the fix here only affectsvertical-*
modes, and leaves thesideways-*
modes unchanged? -
The other thing this example highlights (although it's not a new issue in this patch) is that
text-underline-offset
doesn't have any effect in vertical mode whenlang=ja
is in effect, when the underline appears by default to the right of the text. This is probably because we handle this internally by effectively swapping under- and over-line decorations at some point, but I think we need to fix this:text-underline-offset
should work similarly for all languages and writing modes.
Assignee | ||
Comment 3•5 years ago
|
||
I've added some code so the underline behaves as before in sideways mode, and I opened up Bug 1562704 for the japanese text and have submitted a potential patch for it on Phabricator
Updated•5 years ago
|
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f6965b4d5e2 Fixed origin from which text-underline-offset is set in vertical writing modes r=jfkthame
Comment 5•5 years ago
|
||
bugherder |
Description
•