[webkit-reviews] review granted: [Bug 137594] Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject subclasses : [Attachment 239595] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 10 09:35:22 PDT 2014
Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 137594: Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject
subclasses
https://bugs.webkit.org/show_bug.cgi?id=137594
Attachment 239595: Patch
https://bugs.webkit.org/attachment.cgi?id=239595&action=review
------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=239595&action=review
> Source/WebCore/rendering/RenderVideo.cpp:284
> RenderObject* parent = renderer->parent();
> if (!parent)
> - return 0;
> + return nullptr;
>
> - RenderFullScreen* fullScreen = parent->isRenderFullScreen() ?
toRenderFullScreen(parent) : 0;
> + RenderFullScreen* fullScreen = is<RenderFullScreen>(*parent) ?
downcast<RenderFullScreen>(parent) : nullptr;
> if (!fullScreen)
> - return 0;
> + return nullptr;
>
> return fullScreen->placeholder();
We should write this:
RenderObject* parent = renderer->parent();
return is<RenderFullScreen>(parent) ?
downcast<RenderFullScreen>(*parent).placeholder() : nullptr;
I think the two line version is better than the longer version.
More information about the webkit-reviews
mailing list