Bug 137622 - Use is<>() / downcast<>() for RenderElement
Summary: Use is<>() / downcast<>() for RenderElement
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-10 12:58 PDT by Chris Dumez
Modified: 2014-10-10 16:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (71.65 KB, patch)
2014-10-10 13:01 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (71.88 KB, patch)
2014-10-10 13:27 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (72.09 KB, patch)
2014-10-10 14:00 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (72.13 KB, patch)
2014-10-10 15:28 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-10 12:58:21 PDT
Use is<>() / downcast<>() for RenderElement
Comment 1 Chris Dumez 2014-10-10 13:01:47 PDT
Created attachment 239644 [details]
Patch
Comment 2 Chris Dumez 2014-10-10 13:27:42 PDT
Created attachment 239645 [details]
Patch
Comment 3 Chris Dumez 2014-10-10 14:00:52 PDT
Created attachment 239647 [details]
Patch
Comment 4 Benjamin Poulain 2014-10-10 15:02:46 PDT
Comment on attachment 239647 [details]
Patch

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

> Source/WebCore/rendering/RenderCounter.cpp:624
> +            counterName ? WebCore::counterMaps().get(downcast<WebCore::RenderElement>(current))->get(identifier) : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0);

What the heck!

> Source/WebCore/rendering/svg/SVGRenderSupport.cpp:263
> +                        downcast<RenderSVGText>(*child).setNeedsTextMetricsUpdate();
> +                        downcast<RenderSVGText>(*child).setNeedsPositioningValuesUpdate();

IMHO, it would be cleaner to put downcast<RenderSVGText>(*child) in a temporary here.
Comment 5 Chris Dumez 2014-10-10 15:28:46 PDT
Created attachment 239654 [details]
Patch
Comment 6 WebKit Commit Bot 2014-10-10 16:06:55 PDT
Comment on attachment 239654 [details]
Patch

Clearing flags on attachment: 239654

Committed r174619: <http://trac.webkit.org/changeset/174619>
Comment 7 WebKit Commit Bot 2014-10-10 16:07:00 PDT
All reviewed patches have been landed.  Closing bug.