Use RENDER_OBJECT_TYPE_CASTS for more types.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Nov 2013 05:47:40 +0000 (05:47 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Nov 2013 05:47:40 +0000 (05:47 +0000)
<https://webkit.org/b/124112>

Generate toRenderFoo() type casting helpers for these classes:

    - RenderCombineText
    - RenderDetailsMarker
    - RenderListMarker
    - RenderVideo
    - RenderView

Reviewed by Anders Carlsson.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderCombineText.h
Source/WebCore/rendering/RenderDetailsMarker.h
Source/WebCore/rendering/RenderListMarker.h
Source/WebCore/rendering/RenderVideo.h
Source/WebCore/rendering/RenderView.h

index c2da0df..bf24126 100644 (file)
@@ -1,5 +1,20 @@
 2013-11-09  Andreas Kling  <akling@apple.com>
 
+        Use RENDER_OBJECT_TYPE_CASTS for more types.
+        <https://webkit.org/b/124112>
+
+        Generate toRenderFoo() type casting helpers for these classes:
+
+            - RenderCombineText
+            - RenderDetailsMarker
+            - RenderListMarker
+            - RenderVideo
+            - RenderView
+
+        Reviewed by Anders Carlsson.
+
+2013-11-09  Andreas Kling  <akling@apple.com>
+
         Move MathML type checking virtuals to RenderObject.
         <https://webkit.org/b/124111>
 
index acb621b..d522025 100644 (file)
@@ -57,19 +57,7 @@ private:
     bool m_needsFontUpdate : 1;
 };
 
-inline RenderCombineText& toRenderCombineText(RenderObject& object)
-{ 
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isCombineText());
-    return static_cast<RenderCombineText&>(object);
-}
-
-inline const RenderCombineText& toRenderCombineText(const RenderObject& object)
-{ 
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isCombineText());
-    return static_cast<const RenderCombineText&>(object);
-}
-
-void toRenderCombineText(const RenderCombineText&);
+RENDER_OBJECT_TYPE_CASTS(RenderCombineText, isCombineText());
 
 } // namespace WebCore
 
index eb4eefe..68523f9 100644 (file)
@@ -45,13 +45,7 @@ private:
     Path getPath(const LayoutPoint& origin) const;
 };
 
-inline const RenderDetailsMarker& toRenderDetailsMarker(const RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isDetailsMarker());
-    return static_cast<const RenderDetailsMarker&>(object);
-}
-
-void toRenderDetailsMarker(const RenderDetailsMarker&);
+RENDER_OBJECT_TYPE_CASTS(RenderDetailsMarker, isDetailsMarker());
 
 }
 
index 1ffc6d5..d13653b 100644 (file)
@@ -85,19 +85,7 @@ private:
     RenderListItem& m_listItem;
 };
 
-inline RenderListMarker& toRenderListMarker(RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isListMarker());
-    return static_cast<RenderListMarker&>(object);
-}
-
-inline const RenderListMarker& toRenderListMarker(const RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isListMarker());
-    return static_cast<const RenderListMarker&>(object);
-}
-
-void toRenderListMarker(const RenderListMarker&);
+RENDER_OBJECT_TYPE_CASTS(RenderListMarker, isListMarker());
 
 } // namespace WebCore
 
index ef46831..f5a87b5 100644 (file)
@@ -92,19 +92,7 @@ private:
     LayoutSize m_cachedImageSize;
 };
 
-inline RenderVideo& toRenderVideo(RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isVideo());
-    return static_cast<RenderVideo&>(object);
-}
-
-inline const RenderVideo& toRenderVideo(const RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isVideo());
-    return static_cast<const RenderVideo&>(object);
-}
-
-void toRenderVideo(const RenderVideo&);
+RENDER_OBJECT_TYPE_CASTS(RenderVideo, isVideo());
 
 } // namespace WebCore
 
index dde81f9..de2f6c3 100644 (file)
@@ -348,19 +348,7 @@ private:
 #endif
 };
 
-inline RenderView& toRenderView(RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderView());
-    return static_cast<RenderView&>(object);
-}
-
-inline const RenderView& toRenderView(const RenderObject& object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderView());
-    return static_cast<const RenderView&>(object);
-}
-
-void toRenderView(const RenderView&);
+RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView());
 
 // Stack-based class to assist with LayoutState push/pop
 class LayoutStateMaintainer {