Bug 200211 - wpt/css/css-images/gradient/color-stops-parsing.html fails
Summary: wpt/css/css-images/gradient/color-stops-parsing.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-28 15:54 PDT by Simon Fraser (smfr)
Modified: 2019-10-22 20:53 PDT (History)
13 users (show)

See Also:


Attachments
Patch (8.19 KB, patch)
2019-07-28 16:34 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (11.83 KB, patch)
2019-10-22 10:50 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (14.81 KB, patch)
2019-10-22 14:12 PDT, Simon Fraser (smfr)
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2019-07-28 15:54:28 PDT
wpt/css/css-images/gradient/color-stops-parsing.html fails once the crash (bug 200206) is fixed.
Comment 1 Simon Fraser (smfr) 2019-07-28 15:57:00 PDT
It fails on cases where there are multiple length values not separated by commas:

linear-gradient(black, 25% 50%, white)

Chrome and Firefox pass these tests. The relevant parsing code in Chrome is protected by RuntimeEnabledFeatures::MultipleColorStopPositionsEnabled() which was added via https://chromiumcodereview.appspot.com/2799793002/. I'm not sure if this is enabled by default in Chrome yet.
Comment 2 Florin Malita 2019-07-28 16:31:56 PDT
This was shipped in Chrome m71: https://chromium-review.googlesource.com/c/chromium/src/+/1230018/

(see also https://chromestatus.com/feature/5712111258828800)
Comment 3 Simon Fraser (smfr) 2019-07-28 16:34:14 PDT
Created attachment 375050 [details]
Patch
Comment 4 Simon Fraser (smfr) 2019-07-28 16:54:33 PDT
Comment on attachment 375050 [details]
Patch

This breaks a conic gradient test.
Comment 5 Simon Fraser (smfr) 2019-10-22 10:50:42 PDT
Created attachment 381563 [details]
Patch
Comment 6 Simon Fraser (smfr) 2019-10-22 14:12:27 PDT
Created attachment 381601 [details]
Patch
Comment 7 Said Abou-Hallawa 2019-10-22 14:26:36 PDT
Comment on attachment 381601 [details]
Patch

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

> Source/WebCore/css/CSSGradientValue.cpp:123
> +        else if (i) {

Is it possible that i == 0 && stop.isMidpoint == true? I think it should not. If this is correct then I would suggest replacing else if (i) by ASSERT(i).
Comment 8 Simon Fraser (smfr) 2019-10-22 14:33:39 PDT
(In reply to Said Abou-Hallawa from comment #7)
> Comment on attachment 381601 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=381601&action=review
> 
> > Source/WebCore/css/CSSGradientValue.cpp:123
> > +        else if (i) {
> 
> Is it possible that i == 0 && stop.isMidpoint == true? I think it should
> not. If this is correct then I would suggest replacing else if (i) by
> ASSERT(i).

I don't think you can get a mid-point stop before a colorless stop. I could add the assertion.
Comment 9 Simon Fraser (smfr) 2019-10-22 20:51:53 PDT
https://trac.webkit.org/changeset/251474/webkit
Comment 10 Radar WebKit Bug Importer 2019-10-22 20:53:34 PDT
<rdar://problem/56527169>