Bug 119990 - Add toSVGStopElement(Node* node) to clean-up a static_cast<SVGStopElement*>
Summary: Add toSVGStopElement(Node* node) to clean-up a static_cast<SVGStopElement*>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-08-18 20:30 PDT by Gyuyoung Kim
Modified: 2013-08-19 01:43 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.35 KB, patch)
2013-08-18 20:34 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch for landing (1.50 KB, patch)
2013-08-18 23:42 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2013-08-18 20:30:55 PDT
This patch adds toSVGStopElement(Node* node) in order to remove remained static_cast<SVGStopElement*>.

Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=156274
Comment 1 Gyuyoung Kim 2013-08-18 20:34:03 PDT
Created attachment 209046 [details]
Patch
Comment 2 Darin Adler 2013-08-18 23:00:25 PDT
Comment on attachment 209046 [details]
Patch

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

I am OK with this, but there might be a slightly better way. It seems unfortunate to use isGradientStop in one case and use hasTagName in the other.

> Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp:639
> -    SVGStopElement* stopElement = static_cast<SVGStopElement*>(stop.node());
> +    SVGStopElement* stopElement = toSVGStopElement(stop.node());

How about just using toSVGStopElement(toSVGElement(stop.node())) here instead?
Comment 3 Gyuyoung Kim 2013-08-18 23:42:42 PDT
Created attachment 209059 [details]
Patch for landing
Comment 4 Gyuyoung Kim 2013-08-18 23:43:41 PDT
(In reply to comment #2)
> (From update of attachment 209046 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=209046&action=review
> 
> I am OK with this, but there might be a slightly better way. It seems unfortunate to use isGradientStop in one case and use hasTagName in the other.
> 
> > Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp:639
> > -    SVGStopElement* stopElement = static_cast<SVGStopElement*>(stop.node());
> > +    SVGStopElement* stopElement = toSVGStopElement(stop.node());
> 
> How about just using toSVGStopElement(toSVGElement(stop.node())) here instead?

Hi Darin, thank you for your nice comment. :) I also agree with your nice suggestion.
Comment 5 WebKit Commit Bot 2013-08-19 01:43:51 PDT
Comment on attachment 209059 [details]
Patch for landing

Clearing flags on attachment: 209059

Committed r154267: <http://trac.webkit.org/changeset/154267>
Comment 6 WebKit Commit Bot 2013-08-19 01:43:54 PDT
All reviewed patches have been landed.  Closing bug.