Move renderNamedFlowThreadWrapper() to RenderElement.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 01:55:40 +0000 (01:55 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 01:55:40 +0000 (01:55 +0000)
<https://webkit.org/b/128634>

This function is only ever called on RenderElements so move it there
from RenderObject.

Reviewed by Antti Koivisto.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::renderNamedFlowThreadWrapper):
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h

index fbfebc2df8a2a2f5de3655262c53edec57ab63f0..b0bd88dd4abd641ac44f97f8b55cfcddd2fcdb85 100644 (file)
@@ -1,3 +1,19 @@
+2014-02-11  Andreas Kling  <akling@apple.com>
+
+        Move renderNamedFlowThreadWrapper() to RenderElement.
+        <https://webkit.org/b/128634>
+
+        This function is only ever called on RenderElements so move it there
+        from RenderObject.
+
+        Reviewed by Antti Koivisto.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::renderNamedFlowThreadWrapper):
+        * rendering/RenderElement.h:
+        * rendering/RenderObject.cpp:
+        * rendering/RenderObject.h:
+
 2014-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Position and thickness of underline as text size changes
 2014-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Position and thickness of underline as text size changes
index 53901edd2528ea1098ddde27cbbef880ecacc1b4..3ca4c457c55eb2dff8cd1e60e6b24a2899ec2461 100644 (file)
@@ -44,6 +44,7 @@
 #include "RenderLayerCompositor.h"
 #include "RenderLineBreak.h"
 #include "RenderListItem.h"
 #include "RenderLayerCompositor.h"
 #include "RenderLineBreak.h"
 #include "RenderListItem.h"
+#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderRuby.h"
 #include "RenderRubyText.h"
 #include "RenderRegion.h"
 #include "RenderRuby.h"
 #include "RenderRubyText.h"
@@ -1274,4 +1275,12 @@ bool RenderElement::borderImageIsLoadedAndCanBeRendered() const
     return borderImage && borderImage->canRender(this, style().effectiveZoom()) && borderImage->isLoaded();
 }
 
     return borderImage && borderImage->canRender(this, style().effectiveZoom()) && borderImage->isLoaded();
 }
 
+RenderNamedFlowThread* RenderElement::renderNamedFlowThreadWrapper()
+{
+    auto renderer = this;
+    while (renderer && renderer->isAnonymousBlock() && !renderer->isRenderNamedFlowThread())
+        renderer = renderer->parent();
+    return renderer && renderer->isRenderNamedFlowThread() ? toRenderNamedFlowThread(renderer) : nullptr;
+}
+
 }
 }
index 839f56e069e8d9b1e412c582c94fdd490b152dfe..6c3433630f8f3af0b744cdaa100c8a0f796bf4eb 100644 (file)
@@ -141,6 +141,8 @@ public:
     bool hasBlendMode() const { return false; }
 #endif
 
     bool hasBlendMode() const { return false; }
 #endif
 
+    RenderNamedFlowThread* renderNamedFlowThreadWrapper();
+
 protected:
     enum BaseTypeFlags {
         RenderLayerModelObjectFlag = 1 << 0,
 protected:
     enum BaseTypeFlags {
         RenderLayerModelObjectFlag = 1 << 0,
index b26fbce81e931ea591972294743d39cab1a34700..0e41b67f9c21b40856caca42a0511d9725115bed 100644 (file)
@@ -538,15 +538,6 @@ RenderFlowThread* RenderObject::locateFlowThreadContainingBlock() const
     return 0;
 }
 
     return 0;
 }
 
-RenderNamedFlowThread* RenderObject::renderNamedFlowThreadWrapper() const
-{
-    RenderObject* object = const_cast<RenderObject*>(this);
-    while (object && object->isAnonymousBlock() && !object->isRenderNamedFlowThread())
-        object = object->parent();
-
-    return object && object->isRenderNamedFlowThread() ? toRenderNamedFlowThread(object) : 0;
-}
-
 RenderBlock* RenderObject::firstLineBlock() const
 {
     return 0;
 RenderBlock* RenderObject::firstLineBlock() const
 {
     return 0;
index 2624715942f5bef9af4804f5b1d171a492130ce1..d0fa41f2b16ae07e083a330644bf0fba60576c6a 100644 (file)
@@ -217,8 +217,6 @@ public:
         return locateFlowThreadContainingBlock();
     }
 
         return locateFlowThreadContainingBlock();
     }
 
-    RenderNamedFlowThread* renderNamedFlowThreadWrapper() const;
-
     // FIXME: The meaning of this function is unclear.
     virtual bool isEmpty() const { return !firstChildSlow(); }
 
     // FIXME: The meaning of this function is unclear.
     virtual bool isEmpty() const { return !firstChildSlow(); }