Bug 83404

Summary: Remove dead code in SVGCSSParser
Product: WebKit Reporter: Rob Buis <rwlbuis>
Component: SVGAssignee: Rob Buis <rwlbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: macpherson, menard, webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
zimmermann: review+
Patch zimmermann: review+

Description Rob Buis 2012-04-06 15:40:51 PDT
The CSSPropertyColor handling code is unreachable, because CSSParser handles it. I think this was kept as a possible way to deal with SVGColor interface (bug 15012), but since it is deprecated this code is really not needed anymore.
Comment 1 Rob Buis 2012-04-06 15:47:43 PDT
Created attachment 136080 [details]
Patch
Comment 2 Rob Buis 2012-04-06 19:21:30 PDT
Created attachment 136120 [details]
Patch
Comment 3 Nikolas Zimmermann 2012-04-06 23:57:05 PDT
Comment on attachment 136080 [details]
Patch

CSSPropertyColor is already handled by CSSParser I guess, so we never reach this code path?
If so, please include this in the ChangeLog ("why" change logs are better than "what" change logs). Still r=me.
Comment 4 Nikolas Zimmermann 2012-04-06 23:58:57 PDT
Comment on attachment 136120 [details]
Patch

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

Ah, just saw you posted a new patch, r=me for that as well, as it resolved my issue :-)

> LayoutTests/svg/custom/script-tests/currentColor-on-color.js:13
> +rectElement.setAttribute("color", "currentColor");

This is not needed, is it?

> LayoutTests/svg/custom/script-tests/currentColor-on-color.js:19
> +shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement).color", "rgb(0, 128, 0)");

s/document.defaultView// (it's not need).
Comment 5 Rob Buis 2012-04-07 04:32:24 PDT
Hi Niko,

Thanks for the review!

(In reply to comment #4)
> (From update of attachment 136120 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=136120&action=review
> 
> Ah, just saw you posted a new patch, r=me for that as well, as it resolved my issue :-)

Nice :)

> > LayoutTests/svg/custom/script-tests/currentColor-on-color.js:13
> > +rectElement.setAttribute("color", "currentColor");
> 
> This is not needed, is it?

I think it is. Read the LayoutTests Changelog :) Basically we inherit the color=currentColor CSS3 behaviour from CSSParser.cpp (matches what FF does), and I agreed with Dirk to make a regression test for that since we are giving up dealing with color property in SVGCSSParser.cpp, based on his bug and closing of bug 15012.

> > LayoutTests/svg/custom/script-tests/currentColor-on-color.js:19
> > +shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement).color", "rgb(0, 128, 0)");
> 
> s/document.defaultView// (it's not need).

Great! Will fix before landing.
Cheers,

Rob.
Comment 6 Rob Buis 2012-04-17 07:10:07 PDT
Fix landed in r113546.