Bug 72378 - [CSSShaders] Implement the style cached resources and computed style for the shader urls
Summary: [CSSShaders] Implement the style cached resources and computed style for the ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexandru Chiculita
URL:
Keywords: InRadar
Depends on:
Blocks: 71446
  Show dependency treegraph
 
Reported: 2011-11-15 04:47 PST by Alexandru Chiculita
Modified: 2011-11-15 23:51 PST (History)
7 users (show)

See Also:


Attachments
Patch V1 (62.43 KB, patch)
2011-11-15 07:15 PST, Alexandru Chiculita
dino: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch V2 (62.43 KB, patch)
2011-11-15 10:09 PST, Alexandru Chiculita
dino: review+
dino: commit-queue-
Details | Formatted Diff | Diff
Patch V3 (62.26 KB, patch)
2011-11-15 10:56 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff
Patch for landing (64.13 KB, patch)
2011-11-15 22:34 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2011-11-15 04:47:30 PST
This patch will add the CustomFilterOperation and add the code in CSSStyleSelector for creating it. The only parsed arguments will be the urls for the shaders. Also it should add code for the Computed style, so that we can test the functionality.
Comment 1 Alexandru Chiculita 2011-11-15 07:15:48 PST
Created attachment 115163 [details]
Patch V1
Comment 2 WebKit Review Bot 2011-11-15 08:11:33 PST
Comment on attachment 115163 [details]
Patch V1

Attachment 115163 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10484359
Comment 3 Alexandru Chiculita 2011-11-15 10:09:47 PST
Created attachment 115190 [details]
Patch V2

Fixed the Chromium gypi file
Comment 4 Dean Jackson 2011-11-15 10:30:25 PST
Comment on attachment 115163 [details]
Patch V1

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

r- up front for the chromium build issue, otherwise looks good. I wonder if we should retitle the bug because it now does a lot more than just computed style.

> LayoutTests/css3/filters/script-tests/custom-filter-property-computed-style.js:1
> +description("Test the parsing of the custom() function of the -webkit-filter property.");

This needs updating.

> LayoutTests/css3/filters/script-tests/custom-filter-property-computed-style.js:82
> +testFilterRule("Custom with vertex shader",
> +               "custom(url(vertex.shader))", "custom(url(vertex.shader))");
> +
> +testFilterRule("Custom with fragment shader",
> +              "custom(none url(fragment.shader))", "custom(none url(fragment.shader))");
> +
> +testFilterRule("Custom with both shaders",
> +            "custom(url(vertex.shader) url(fragment.shader))", "custom(url(vertex.shader) url(fragment.shader))");
> +
> +testFilterRule("Multiple with fragment shader",
> +            "grayscale() custom(none url(fragment.shader)) sepia()", "grayscale(1) custom(none url(fragment.shader)) sepia(1)",
> +            ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE",
> +            "WebKitCSSFilterValue.CSS_FILTER_CUSTOM",
> +            "WebKitCSSFilterValue.CSS_FILTER_SEPIA"],
> +            ["grayscale(1)",
> +            "custom(none url(fragment.shader))",
> +            "sepia(1)"]);

Nit: some indentation differences up there.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:66
> +#include <algorithm>

Is there a reason for this?

> Source/WebCore/css/CSSStyleSelector.h:211
> +    StyleShader* styleShader(CSSValue*);
> +    StyleShader* cachedOrPendingFromValue(WebKitCSSShaderValue*);

I wonder if this should be named cachedOrPendingStyleShaderFromValue ?

> Source/WebCore/rendering/style/StyleShader.h:57
> +    bool m_isCachedShader:1;
> +    bool m_isPendingShader:1;

I think we typically separate the : and num with spaces.
Comment 5 Dean Jackson 2011-11-15 10:31:59 PST
oops! patch was updated as I was reviewing :)
Comment 6 Dean Jackson 2011-11-15 10:32:59 PST
Comment on attachment 115190 [details]
Patch V2

r+ with the changes from the previous review. I do think the bug needs a better title.
Comment 7 Alexandru Chiculita 2011-11-15 10:49:23 PST
I will post a new patch in a few moments.

> > LayoutTests/css3/filters/script-tests/custom-filter-property-computed-style.js:1
> > +description("Test the parsing of the custom() function of the -webkit-filter property.");
> 
> This needs updating.

Ok.

> 
> > LayoutTests/css3/filters/script-tests/custom-filter-property-computed-style.js:82
> > +testFilterRule("Custom with vertex shader",
> > +               "custom(url(vertex.shader))", "custom(url(vertex.shader))");
> > +
> > +testFilterRule("Custom with fragment shader",
> > +              "custom(none url(fragment.shader))", "custom(none url(fragment.shader))");
> > +
> > +testFilterRule("Custom with both shaders",
> > +            "custom(url(vertex.shader) url(fragment.shader))", "custom(url(vertex.shader) url(fragment.shader))");
> > +
> > +testFilterRule("Multiple with fragment shader",
> > +            "grayscale() custom(none url(fragment.shader)) sepia()", "grayscale(1) custom(none url(fragment.shader)) sepia(1)",
> > +            ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE",
> > +            "WebKitCSSFilterValue.CSS_FILTER_CUSTOM",
> > +            "WebKitCSSFilterValue.CSS_FILTER_SEPIA"],
> > +            ["grayscale(1)",
> > +            "custom(none url(fragment.shader))",
> > +            "sepia(1)"]);
> Nit: some indentation differences up there.

Ok.

> > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:66
> > +#include <algorithm>
> 
> Is there a reason for this?
Good catch. I will remove it. I've actually took the big patch posted on the #71446 and deleted some code.  It was used for std::sort, to sort the parameters by name. Sorting the parameters is not really required, but it makes testing easier.

> > Source/WebCore/css/CSSStyleSelector.h:211
> > +    StyleShader* styleShader(CSSValue*);
> > +    StyleShader* cachedOrPendingFromValue(WebKitCSSShaderValue*);
> 
> I wonder if this should be named cachedOrPendingStyleShaderFromValue ?

Ok. cachedOrPendingStyleShaderFromValue makes sense.

> > Source/WebCore/rendering/style/StyleShader.h:57
> > +    bool m_isCachedShader:1;
> > +    bool m_isPendingShader:1;
> 
> I think we typically separate the : and num with spaces.

Ok. That was copied from StyleImage.h, so I thought it was correct. It seems like both styles are used in WebKit's code (ie. CSSValue.h uses space), so I assume that the new style is to use spaces.
Comment 8 Alexandru Chiculita 2011-11-15 10:56:42 PST
Created attachment 115202 [details]
Patch V3
Comment 9 Dean Jackson 2011-11-15 11:44:26 PST
(In reply to comment #7)


> > > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:66
> > > +#include <algorithm>
> > 
> > Is there a reason for this?
> Good catch. I will remove it. I've actually took the big patch posted on the #71446 and deleted some code.  It was used for std::sort, to sort the parameters by name. Sorting the parameters is not really required, but it makes testing easier.

Cool.

> > > Source/WebCore/rendering/style/StyleShader.h:57
> > > +    bool m_isCachedShader:1;
> > > +    bool m_isPendingShader:1;
> > 
> > I think we typically separate the : and num with spaces.
> 
> Ok. That was copied from StyleImage.h, so I thought it was correct. It seems like both styles are used in WebKit's code (ie. CSSValue.h uses space), so I assume that the new style is to use spaces.

Yeah, I'm not sure myself.
Comment 10 Alexandru Chiculita 2011-11-15 12:05:40 PST
Is everything ok with the last patch? Can you r+ and cq+ please?
Comment 11 Dean Jackson 2011-11-15 12:07:35 PST
(In reply to comment #10)
> Is everything ok with the last patch? Can you r+ and cq+ please?

Yep, doing so now.
Comment 12 Dean Jackson 2011-11-15 12:07:58 PST
Comment on attachment 115202 [details]
Patch V3

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

> Source/WebCore/css/CSSStyleSelector.cpp:5519
> +                operations.operations().append(operation);

Reading this line makes my head hurt :) I wonder if we should rename the operations() accessor on FilterOperations. What do you think? (or we could put the append method on FilterOperations)
Comment 13 Alexandru Chiculita 2011-11-15 12:21:17 PST
(In reply to comment #12)
> (From update of attachment 115202 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115202&action=review
> 
> > Source/WebCore/css/CSSStyleSelector.cpp:5519
> > +                operations.operations().append(operation);
> 
> Reading this line makes my head hurt :) I wonder if we should rename the operations() accessor on FilterOperations. What do you think? (or we could put the append method on FilterOperations)

It looks like there's a lot of operations.operations().append in CSSStyleSelector.cpp. CSS Transforms have the same issue.

Yes adding an append() method on the FilterOperations sound great. Also, operationAt() might be useful.
Comment 14 Dean Jackson 2011-11-15 12:39:36 PST
(In reply to comment #13)
> (In reply to comment #12)
> > (From update of attachment 115202 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=115202&action=review
> > 
> > > Source/WebCore/css/CSSStyleSelector.cpp:5519
> > > +                operations.operations().append(operation);
> > 
> > Reading this line makes my head hurt :) I wonder if we should rename the operations() accessor on FilterOperations. What do you think? (or we could put the append method on FilterOperations)
> 
> It looks like there's a lot of operations.operations().append in CSSStyleSelector.cpp. CSS Transforms have the same issue.
> 
> Yes adding an append() method on the FilterOperations sound great. Also, operationAt() might be useful.

OK. I filed https://bugs.webkit.org/show_bug.cgi?id=72406
Comment 15 Radar WebKit Bug Importer 2011-11-15 12:40:23 PST
<rdar://problem/10450040>
Comment 16 WebKit Review Bot 2011-11-15 13:01:39 PST
Comment on attachment 115202 [details]
Patch V3

Rejecting attachment 115202 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
n/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.
Updating chromium port dependencies using gclient...

________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/10310664
Comment 17 Adam Barth 2011-11-15 13:19:44 PST
Looks like the patch didn't apply.  Not sure why the bot produced a junky error message.
Comment 18 Alexandru Chiculita 2011-11-15 22:34:20 PST
Created attachment 115323 [details]
Patch for landing
Comment 19 Alexandru Chiculita 2011-11-15 22:35:24 PST
(In reply to comment #18)
> Created an attachment (id=115323) [details]
> Patch for landing

I've rebased the patch.
Comment 20 WebKit Review Bot 2011-11-15 23:51:20 PST
Comment on attachment 115323 [details]
Patch for landing

Clearing flags on attachment: 115323

Committed r100416: <http://trac.webkit.org/changeset/100416>
Comment 21 WebKit Review Bot 2011-11-15 23:51:27 PST
All reviewed patches have been landed.  Closing bug.