Bug 227445 - Text decoration renders on top of text when it should be below
Summary: Text decoration renders on top of text when it should be below
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
: 196194 (view as bug list)
Depends on: 234707
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-28 05:39 PDT by Andy Bell
Modified: 2022-03-15 06:22 PDT (History)
13 users (show)

See Also:


Attachments
Safari 14.1.1 (467.09 KB, image/jpeg)
2021-06-28 05:39 PDT, Andy Bell
no flags Details
Patch (20.21 KB, patch)
2021-12-12 17:06 PST, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (19.42 KB, patch)
2021-12-12 17:31 PST, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (18.53 KB, patch)
2021-12-12 17:39 PST, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (18.52 KB, patch)
2021-12-13 09:46 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 Andy Bell 2021-06-28 05:39:38 PDT
Created attachment 432386 [details]
Safari 14.1.1

Expected behaviour: text decoration renders below the text 
Actual behaviour: text decoration renders above the text
Safari info: 14.1.1 (16611.2.7.1.4)
Condensed demo: https://codepen.io/piccalilli/pen/bf9e2945fd33d6aaddd31336f9184e64
Possible issue: The paint order should be underline before text https://drafts.csswg.org/css-text-decor-4/#painting-order
Comment 1 Radar WebKit Bug Importer 2021-07-05 05:40:31 PDT
<rdar://problem/80174107>
Comment 2 Tim Nguyen (:ntim) 2021-12-12 17:06:24 PST
Created attachment 446953 [details]
Patch
Comment 3 Tim Nguyen (:ntim) 2021-12-12 17:31:30 PST
Created attachment 446954 [details]
Patch
Comment 4 Tim Nguyen (:ntim) 2021-12-12 17:39:08 PST
Created attachment 446955 [details]
Patch
Comment 5 Myles C. Maxfield 2021-12-12 20:14:57 PST
I think this is a dup of https://bugs.webkit.org/show_bug.cgi?id=196194.

I guess I'll reverse-dup...
Comment 6 Myles C. Maxfield 2021-12-12 20:15:12 PST
*** Bug 196194 has been marked as a duplicate of this bug. ***
Comment 7 Sam Sneddon [:gsnedders] 2021-12-13 05:56:50 PST
bug 196841 reverted a previous fix here, due to perf regression
Comment 8 Simon Fraser (smfr) 2021-12-13 08:23:47 PST
Comment on attachment 446955 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=446955&action=review

> Source/WebCore/rendering/TextDecorationPainter.cpp:317
> +void TextDecorationPainter::strokeLineThrough(const Color& color, float thickness, const FloatPoint& localOrigin)

This use of "stroke" here is easily confused with "text stroke". Just call it paintLineThrough() and limit use the term "stroke" in the code.
Comment 9 Tim Nguyen (:ntim) 2021-12-13 09:46:13 PST
Created attachment 447018 [details]
Patch
Comment 10 EWS 2021-12-13 10:24:17 PST
Committed r286955 (245180@main): <https://commits.webkit.org/245180@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447018 [details].