Bug 200211

Summary: wpt/css/css-images/gradient/color-stops-parsing.html fails
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, commit-queue, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, macpherson, menard, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch dino: review+

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>