`text-underline-offset` and `text-decoration-thickness` should accept percentage values
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [layout:backlog:2020q1])
Attachments
(1 file)
The CSS Text Decoration 4 spec (draft) has recently been updated to say that text-underline-offset and text-decoration-thickness can take percentages (of the em size).
This is a useful addition because (as the spec notes) a <percentage> value will inherit as relative values, unlike <length> which inherits as a fixed value (even if specified in font-relative units such as em
). So a value like 10%
may be more useful than 0.1em
in some situations.
(I guess Safari is probably intending to implement this soon, as Myles has been an active participant in the spec discussions, though I don't yet see it in the Safari Tech Preview release notes.)
Comment 1•5 years ago
|
||
To be clear, they mean for the percentage values to resolve at layout time, right? So like line-height: <number>
? I think it's bad that this behaves differently than line-height: <percentage>
.
Comment 2•5 years ago
|
||
I commented on https://github.com/w3c/csswg-drafts/issues/2165#issuecomment-571727474 with that argument... I think ideally it should be text-underline-offset: <number>
or something of that sort. But we could implement this as-wanted... The definition of the properties should take a <length-percentage>
then, rather than a <length> | <percentage>
.
Assignee | ||
Comment 3•5 years ago
|
||
Yes, my understanding is that it's expected to behave like line-height: <number>
rather than <percentage>
. Do you want to object to this?
(Personally, I think it's probably the right behavior. It's unfortunate that it differs from line-height
, but that's a legacy flaw that we presumably can't fix for web compatibility reasons. I'm not sure that justifies propagating the poor behavior to new properties, however.)
Assignee | ||
Comment 4•5 years ago
|
||
I have a try build at https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d108d0425aa36bfc43262ca83726b2805539cb2 that implements these as <length-percentage>
, but let's see how people respond in the github issue before doing anything here.
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Backed out 2 changesets (bug 1607308, bug 1607534) for causing text-decoration-underline-position-vertical-ja.html to permafail
https://hg.mozilla.org/integration/autoland/rev/7b3bfdc4fd78aa3ad4bae727b0319d7378c33dbf
push that caused the backout: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=64dab97e6878b19ebcd97477bd84a7d2c90ef663
Assignee | ||
Comment 10•5 years ago
|
||
Updated the patch in bug 1607308 to adjust the annotation for the newly-passing test.
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Description
•