Move renderNamedFlowThreadWrapper() to RenderElement.
[WebKit-https.git] / Source / WebCore / rendering / RenderElement.cpp
index 53901edd2528ea1098ddde27cbbef880ecacc1b4..3ca4c457c55eb2dff8cd1e60e6b24a2899ec2461 100644 (file)
@@ -44,6 +44,7 @@
 #include "RenderLayerCompositor.h"
 #include "RenderLineBreak.h"
 #include "RenderListItem.h"
+#include "RenderNamedFlowThread.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();
 }
 
+RenderNamedFlowThread* RenderElement::renderNamedFlowThreadWrapper()
+{
+    auto renderer = this;
+    while (renderer && renderer->isAnonymousBlock() && !renderer->isRenderNamedFlowThread())
+        renderer = renderer->parent();
+    return renderer && renderer->isRenderNamedFlowThread() ? toRenderNamedFlowThread(renderer) : nullptr;
+}
+
 }