Bug 121302

Summary: [CTTE] Tighter element types for RenderSVGShape and subclasses.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, d-r, esprehn+autocc, fmalita, glenn, kling, kondapallykalyan, pdr, schenney
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review+

Description Andreas Kling 2013-09-13 08:44:16 PDT
[CTTE] Tighter element types for RenderSVGShape and subclasses.
Comment 1 Andreas Kling 2013-09-13 08:45:26 PDT
Created attachment 211556 [details]
Patch
Comment 2 WebKit Commit Bot 2013-09-13 08:47:39 PDT
Attachment 211556 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/rendering/svg/RenderSVGEllipse.cpp', u'Source/WebCore/rendering/svg/RenderSVGEllipse.h', u'Source/WebCore/rendering/svg/RenderSVGPath.cpp', u'Source/WebCore/rendering/svg/RenderSVGPath.h', u'Source/WebCore/rendering/svg/RenderSVGRect.cpp', u'Source/WebCore/rendering/svg/RenderSVGRect.h', u'Source/WebCore/rendering/svg/RenderSVGShape.cpp', u'Source/WebCore/rendering/svg/RenderSVGShape.h', u'Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp', u'Source/WebCore/svg/SVGCircleElement.cpp', u'Source/WebCore/svg/SVGEllipseElement.cpp', u'Source/WebCore/svg/SVGGraphicsElement.cpp', u'Source/WebCore/svg/SVGPathElement.cpp', u'Source/WebCore/svg/SVGPolyElement.h', u'Source/WebCore/svg/SVGRectElement.cpp']" exit_code: 1
Source/WebCore/rendering/svg/RenderSVGRect.cpp:62:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Antti Koivisto 2013-09-13 08:49:36 PDT
Comment on attachment 211556 [details]
Patch

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

> Source/WebCore/svg/SVGPolyElement.h:72
> +inline SVGPolyElement& toSVGPolyElement(SVGElement& element)
> +{
> +    ASSERT_WITH_SECURITY_IMPLICATION(element.hasTagName(SVGNames::polygonTag) || element.hasTagName(SVGNames::polylineTag));
> +    return static_cast<SVGPolyElement&>(element);
> +}

Would be cool if the autogen script could handle these.
Comment 4 Andreas Kling 2013-09-13 08:53:58 PDT
Committed r155704: <http://trac.webkit.org/changeset/155704>