Bug 230083

Summary: Make text-decoration CSS property spec-compliant
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: CSSAssignee: Matthieu Dubet <m_dubet>
Status: NEW    
Severity: Normal CC: aboxhall, alystair, andresg_22, apinheiro, brandonstewart, cfleizach, changseok, chriskirknielsen+wkbugs, clopez, dino, dmazzoni, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, jcraig, jdiggs, joepeck, karlcow, kizmarh, kondapallykalyan, macpherson, martin, menard, mifenton, mmaxfield, ntim, obrufau, oliverwilliams345, pdr, sabouhallawa, samuel_white, schenney, sergio, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: BrowserCompat, InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=239069
https://bugs.webkit.org/show_bug.cgi?id=213554
https://bugs.webkit.org/show_bug.cgi?id=135353
https://bugs.webkit.org/show_bug.cgi?id=237175
https://bugs.webkit.org/show_bug.cgi?id=286598
Bug Depends on: 232729, 233154, 237175    
Bug Blocks: 58491    
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch with editing changes none

Manuel Rego Casasnovas
Reported 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".
Attachments
Patch (103.73 KB, patch)
2021-10-25 12:33 PDT, Tim Nguyen (:ntim)
no flags
Patch (66.51 KB, patch)
2021-12-10 07:08 PST, Tim Nguyen (:ntim)
ews-feeder: commit-queue-
Patch (44.43 KB, patch)
2022-08-31 17:32 PDT, Tim Nguyen (:ntim)
no flags
Patch (45.42 KB, patch)
2022-08-31 18:09 PDT, Tim Nguyen (:ntim)
ews-feeder: commit-queue-
Patch with editing changes (45.18 KB, patch)
2022-11-14 01:42 PST, Tim Nguyen (:ntim)
no flags
Radar WebKit Bug Importer
Comment 1 2021-09-15 22:30:31 PDT
Tim Nguyen (:ntim)
Comment 2 2021-10-25 12:33:49 PDT
Tim Nguyen (:ntim)
Comment 3 2021-12-10 07:08:35 PST
EWS Watchlist
Comment 4 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
Lorin H
Comment 5 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!
Tim Nguyen (:ntim)
Comment 6 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.
Tim Nguyen (:ntim)
Comment 7 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).
Oriol Brufau
Comment 8 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.
Oriol Brufau
Comment 9 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
Tim Nguyen (:ntim)
Comment 10 2022-08-12 18:02:40 PDT
*** Bug 243865 has been marked as a duplicate of this bug. ***
Tim Nguyen (:ntim)
Comment 11 2022-08-31 17:32:04 PDT
Tim Nguyen (:ntim)
Comment 12 2022-08-31 18:09:55 PDT
Tim Nguyen (:ntim)
Comment 13 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.
Tim Nguyen (:ntim)
Comment 14 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.
Tim Nguyen (:ntim)
Comment 15 2022-11-14 02:47:40 PST
Brandon
Comment 17 2023-07-23 10:45:26 PDT
*** Bug 259428 has been marked as a duplicate of this bug. ***
Matthieu Dubet
Comment 18 2024-01-23 13:31:06 PST
Note You need to log in before you can comment on or make changes to this bug.