Bug 137733 - Use is<>() / downcast<>() for ClipPathOperation subclasses
Summary: Use is<>() / downcast<>() for ClipPathOperation subclasses
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 137424
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-14 20:26 PDT by Chris Dumez
Modified: 2014-10-15 10:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch (9.88 KB, patch)
2014-10-14 20:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (10.15 KB, patch)
2014-10-15 09:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-10-14 20:26:53 PDT
Use is<>() / downcast<>() for ClipPathOperation subclasses
Comment 1 Chris Dumez 2014-10-14 20:35:19 PDT
Created attachment 239845 [details]
Patch
Comment 2 Mihnea Ovidenie 2014-10-15 07:38:10 PDT
Comment on attachment 239845 [details]
Patch

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

r=me with some comments.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2856
> +                ReferenceClipPathOperation& referenceOperation = downcast<ReferenceClipPathOperation>(*operation);

I guess you can use const auto& referenceOperation instead.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2861
> +                ShapeClipPathOperation& shapeOperation = downcast<ShapeClipPathOperation>(*operation);

ShapeClipPathOperation& shapeOperation -> const auto& shapeOperation

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2867
> +                BoxClipPathOperation& boxOperation = downcast<BoxClipPathOperation>(*operation);

BoxClipPathOperation& boxOperation -> const auto& boxOperation

> Source/WebCore/rendering/RenderBlock.cpp:2456
> +            ShapeClipPathOperation& clipPath = downcast<ShapeClipPathOperation>(*style().clipPath());

ShapeClipPathOperation& clipPath -> const auto& clipPath

> Source/WebCore/rendering/RenderLayer.cpp:3929
> +        ShapeClipPathOperation& clippingPath = downcast<ShapeClipPathOperation>(*style.clipPath());

ShapeClipPathOperation& clippingPath -> const auto& clipPath. I noticed that in general we use clipPath and I think we should use clipPath here too (and for the same reason below).

> Source/WebCore/rendering/RenderLayer.cpp:3938
> +        BoxClipPathOperation& clippingPath = downcast<BoxClipPathOperation>(*style.clipPath());

BoxClipPathOperation& clippingPath -> const auto& clipPath

> Source/WebCore/rendering/svg/SVGRenderingContext.cpp:140
> +        ShapeClipPathOperation& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);

ShapeClipPathOperation& clipPath -> const auto& clipPath
Comment 3 Chris Dumez 2014-10-15 09:29:54 PDT
Created attachment 239874 [details]
Patch
Comment 4 WebKit Commit Bot 2014-10-15 10:13:49 PDT
Comment on attachment 239874 [details]
Patch

Clearing flags on attachment: 239874

Committed r174729: <http://trac.webkit.org/changeset/174729>
Comment 5 WebKit Commit Bot 2014-10-15 10:13:57 PDT
All reviewed patches have been landed.  Closing bug.