Bug 141857

Summary: REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jonlee, krit, mihnea, sabouhallawa, simon.fraser, stavila, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase
none
provisional patch, needs test
none
Patch none

Description Simon Fraser (smfr) 2015-02-20 16:18:31 PST
Created attachment 247007 [details]
Testcase

r177494 broke -webkit-mask-image: with data URIs for non-local files.
Comment 1 Simon Fraser (smfr) 2015-02-20 16:20:15 PST
rdar://problem/19738198
Comment 2 Dirk Schulze 2015-02-20 20:41:27 PST
(In reply to comment #0)
> Created attachment 247007 [details]
> Testcase
> 
> r177494 broke -webkit-mask-image: with data URIs for non-local files.

What do you mean with "for non-local"? I know that we added tests to confirm that data URIs are not broken. Did you break down the issue to r177494?

Question to the test, does masking itself not work or is the image not loaded correctly? If I interpret the test correctly then the former.
Comment 3 Simon Fraser (smfr) 2015-02-23 10:34:19 PST
(In reply to comment #2)
> (In reply to comment #0)
> > Created attachment 247007 [details]
> > Testcase
> > 
> > r177494 broke -webkit-mask-image: with data URIs for non-local files.
> What do you mean with "for non-local"?

We don't do same-origin testing for file: urls, so to see the bug you have to load from an http(s) url.

> I know that we added tests to confirm
> that data URIs are not broken. Did you break down the issue to r177494?

Yes, it was blamed to that revision.

> Question to the test, does masking itself not work or is the image not
> loaded correctly? If I interpret the test correctly then the former.

The masking doesn't work (second square with little arrows is missing in a nightly).
Comment 4 Simon Fraser (smfr) 2015-02-23 10:58:50 PST
Created attachment 247128 [details]
provisional patch, needs test
Comment 5 WebKit Commit Bot 2015-02-23 11:00:32 PST
Attachment 247128 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Dirk Schulze 2015-02-24 13:48:29 PST
Comment on attachment 247128 [details]
provisional patch, needs test

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

> Source/WebCore/css/CSSParser.cpp:9584
> +        if (protocolIs(value->string, "data"))

I need to ask Radu here as well, but is special casing "data" going to be future proof? Are there other things to consider?
Comment 7 Simon Fraser (smfr) 2015-02-28 13:36:41 PST
Dirk, any update?
Comment 8 Radu Stavila 2015-03-06 06:24:41 PST
Comment on attachment 247128 [details]
provisional patch, needs test

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

I think this should be ok. Thanks for taking care of this, Simon.

> Source/WebCore/css/CSSParser.cpp:9587
> +            resourceValue = CSSPrimitiveValue::create(completeURL(value->string));

This might also need the CSSPrimitiveValue::CSS_URI second parameter.
Comment 9 Simon Fraser (smfr) 2015-04-20 15:08:36 PDT
This also broke mobile twitter:
https://mobile.twitter.com/Paul2eD/status/580757901377048577
Comment 10 Simon Fraser (smfr) 2015-04-20 15:45:58 PDT
Created attachment 251196 [details]
Patch
Comment 11 Dirk Schulze 2015-04-20 22:59:51 PDT
Comment on attachment 251196 [details]
Patch

LGTM
Comment 12 WebKit Commit Bot 2015-04-20 23:48:21 PDT
Comment on attachment 251196 [details]
Patch

Clearing flags on attachment: 251196

Committed r183053: <http://trac.webkit.org/changeset/183053>
Comment 13 WebKit Commit Bot 2015-04-20 23:48:26 PDT
All reviewed patches have been landed.  Closing bug.