Bug 134336

Summary: Text-decoration-style: dashed / dotted rendered as solid
Product: WebKit Reporter: Philippe Wittenbergh <phiw2>
Component: CSSAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: alwillis, commit-queue, dino, esprehn+autocc, glenn, jonlee, kondapallykalyan, mcatanzaro, mmaxfield, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=158918
Attachments:
Description Flags
test case
none
Patch dino: review+

Description Philippe Wittenbergh 2014-06-25 22:35:09 PDT
Created attachment 233883 [details]
test case

test case: 
expected a dashed or dotted underline
actual: a solid underline

The Webkit inspector does seem to accept the values as valid / supported.

All other text-decoration-style values are supported and rendered correctly.
Comment 1 Radar WebKit Bug Importer 2016-06-02 17:17:44 PDT
<rdar://problem/26613669>
Comment 2 Myles C. Maxfield 2016-06-07 15:37:07 PDT
I can't figure out how this ever worked. We set the stroke style ever since r132076, but we've been filling the underline instead of stroking it since r23761. (So setting the stroke style is irrelevant.)
Comment 3 Myles C. Maxfield 2016-06-07 16:45:00 PDT
Created attachment 280746 [details]
Patch
Comment 4 Dean Jackson 2016-06-07 16:51:20 PDT
Comment on attachment 280746 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:1518
> +    float particleWidth = 0;
> +    switch (strokeStyle) {
> +    case DottedStroke:
> +        particleWidth = bounds.height();
> +        break;
> +    case DashedStroke:
> +        particleWidth = 2 * bounds.height();

I think this should be dashWidth.

> LayoutTests/ChangeLog:15
> +        * fast/css3-text/css3-text-decoration/text-decoration-dashed-expected-mismatch.html: Added.
> +        * fast/css3-text/css3-text-decoration/text-decoration-dashed.html: Added.
> +        * fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed-expected-mismatch.html: Added.
> +        * fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html: Added.
> +        * fast/css3-text/css3-text-decoration/text-decoration-dotted-expected-mismatch.html: Added.
> +        * fast/css3-text/css3-text-decoration/text-decoration-dotted.html: Added.

It's a shame we can't produce actual results to test against.
Comment 5 Myles C. Maxfield 2016-06-07 17:05:03 PDT
Committed r201777: <http://trac.webkit.org/changeset/201777>
Comment 6 Michael Catanzaro 2016-06-19 17:28:07 PDT
Note these layout tests are flaky on GTK, see bug #158918.