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: Matthieu Dubet
URL:
Keywords: BrowserCompat, InRadar, WebExposed
: 243865 259428 (view as bug list)
Depends on: 232729 233154 237175
Blocks: 58491
  Show dependency treegraph
 
Reported: 2021-09-08 22:29 PDT by Manuel Rego Casasnovas
Modified: 2024-03-12 14:36 PDT (History)
37 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
Patch (44.43 KB, patch)
2022-08-31 17:32 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (45.42 KB, patch)
2022-08-31 18:09 PDT, Tim Nguyen (:ntim)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch with editing changes (45.18 KB, patch)
2022-11-14 01:42 PST, Tim Nguyen (:ntim)
no flags 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
Comment 10 Tim Nguyen (:ntim) 2022-08-12 18:02:40 PDT
*** Bug 243865 has been marked as a duplicate of this bug. ***
Comment 11 Tim Nguyen (:ntim) 2022-08-31 17:32:04 PDT
Created attachment 462063 [details]
Patch
Comment 12 Tim Nguyen (:ntim) 2022-08-31 18:09:55 PDT
Created attachment 462065 [details]
Patch
Comment 13 Tim Nguyen (:ntim) 2022-11-14 01:42:06 PST
Created attachment 463517 [details]
Patch with editing changes

This is a patch with Oriol's editing changes (that were reverted due to perf regression). For simplicity, I'll deal with editing in a separate patch, so we can land this easily.
Comment 14 Tim Nguyen (:ntim) 2022-11-14 02:45:10 PST
I might include editing changes after all, but restrict certain work to text-decoration to avoid perf regressions.
Comment 15 Tim Nguyen (:ntim) 2022-11-14 02:47:40 PST
Pull request: https://github.com/WebKit/WebKit/pull/6466
Comment 17 Brandon 2023-07-23 10:45:26 PDT
*** Bug 259428 has been marked as a duplicate of this bug. ***
Comment 18 Matthieu Dubet 2024-01-23 13:31:06 PST
Pull request: https://github.com/WebKit/WebKit/pull/23121