Bug 230083 - Make text-decoration CSS property spec-compliant
Summary: Make text-decoration CSS property spec-compliant
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WebExposed
Depends on: 232729 233154 237175
Blocks: 58491
  Show dependency treegraph
 
Reported: 2021-09-08 22:29 PDT by Manuel Rego Casasnovas
Modified: 2022-06-10 10:05 PDT (History)
33 users (show)

See Also:


Attachments
Patch (103.73 KB, patch)
2021-10-25 12:33 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (66.51 KB, patch)
2021-12-10 07:08 PST, Tim Nguyen (:ntim)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rego Casasnovas 2021-09-08 22:29:17 PDT
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".
Comment 1 Radar WebKit Bug Importer 2021-09-15 22:30:31 PDT
<rdar://problem/83182835>
Comment 2 Tim Nguyen (:ntim) 2021-10-25 12:33:49 PDT
Created attachment 442400 [details]
Patch
Comment 3 Tim Nguyen (:ntim) 2021-12-10 07:08:35 PST
Created attachment 446721 [details]
Patch
Comment 4 EWS Watchlist 2021-12-10 07:09:33 PST
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
Comment 5 Lorin H 2021-12-21 01:07:30 PST
(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!
Comment 6 Tim Nguyen (:ntim) 2021-12-24 10:50:52 PST
(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.
Comment 7 Tim Nguyen (:ntim) 2022-03-02 14:56:16 PST
Bug 237175 made it a shorthand, there are still some things to do to make it spec compliant (see attached patch).
Comment 8 Oriol Brufau 2022-03-02 15:07:32 PST
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.
Comment 9 Oriol Brufau 2022-03-14 15:57:47 PDT
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