Bug 121302 - [CTTE] Tighter element types for RenderSVGShape and subclasses.
Summary: [CTTE] Tighter element types for RenderSVGShape and subclasses.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2013-09-13 08:44 PDT by Andreas Kling
Modified: 2013-09-13 08:53 PDT (History)
9 users (show)

See Also:

Patch (20.47 KB, patch)
2013-09-13 08:45 PDT, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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]

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>