WebKit supports the old "text-decoration" property from CSS2 (https://www.w3.org/TR/CSS2/text.html#propdef-text-decoration), which is somehow similar to the new "text-decoration-line" property (https://drafts.csswg.org/css-text-decor-4/#text-decoration-line-property).
Apart from that WebKit also has a shorthand "-webkit-text-decoration" that allows to set "text-decoration-line", "text-decoration-style" and "text-decoration-color" in just one delcaration.
"text-decoration" is now a shorthand in the spec (https://drafts.csswg.org/css-text-decor-4/#text-decoration-property), so it'd be nice to remove the prefix from "-webkit-text-decoration" and make it a shorthand. Ideally including the possibility to set "text-decoration-thickness" as that's also supported in WebKit.
Websites using the old CSS2 property would still keep working as "text-decoration: underline" will work without problems. And we'd add support for things like "text-decoration: green underline".
Created attachment 442400 [details]
Created attachment 446721 [details]
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
(In reply to Tim Nguyen (:ntim) from comment #3)
> Created attachment 446721 [details]
I'm curious what's blocking this? Been patiently waiting for a few years for something along these lines to land to allow for text-decoration /w thickness without a prefix. Thanks!
(In reply to Lorin H from comment #5)
> (In reply to Tim Nguyen (:ntim) from comment #3)
> > Created attachment 446721 [details]
> > Patch
> I'm curious what's blocking this? Been patiently waiting for a few years for
> something along these lines to land to allow for text-decoration /w
> thickness without a prefix. Thanks!
editing/ tests are failing unfortunately. Needs someone familiar with that code to take a look at it. Everything else in the patch works reasonably well however.
Bug 237175 made it a shorthand, there are still some things to do to make it spec compliant (see attached patch).
Some things remaining to do:
- Remove -webkit-text-decoration, or make it an alias of text-decoration.
- For some reason, text-decoration-thickness is inherited, it shouldn't be according to the spec.
- text-decoration should parse and serialize values for any longhand, not just text-decoration-line.
In the reland of bug 237175 I made text-decoration be a shorthand of only text-decoration-line. It should be a shorthand of all the text-decoration-* longhands.
This will probably need changing the editing code like in https://commits.webkit.org/r290756