RenderNamedFlowThread should not create NodeRenderingContext objects
authorabucur@adobe.com <abucur@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Aug 2013 15:28:37 +0000 (15:28 +0000)
committerabucur@adobe.com <abucur@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Aug 2013 15:28:37 +0000 (15:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119923

Reviewed by Antti Koivisto.

Port of https://chromium.googlesource.com/chromium/blink/+/949d7d7e7b8685454742a55cf0ca912bb9a7b177.
Original patch by Elliott Sprehn.

RenderNamedFlowThread should not create NodeRenderingContext objects

RenderNamedFlowThread is using NodeRenderingContext to get the original
parent renderer, but should just be using NodeRenderingTraversal::parent
instead (which is what NodeRenderingContext does internally anyway).

Tests: No change in functionality. No new tests.

* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::isChildAllowed):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderNamedFlowThread.cpp

index 4669e00a1ef6612107a1eec8813febf1489d7dac..70270806341ffa5ea74dd20b89388af58beaf93b 100644 (file)
@@ -1,3 +1,24 @@
+2013-08-22  Andrei Bucur  <abucur@adobe.com>
+
+        RenderNamedFlowThread should not create NodeRenderingContext objects
+        https://bugs.webkit.org/show_bug.cgi?id=119923
+
+        Reviewed by Antti Koivisto.
+
+        Port of https://chromium.googlesource.com/chromium/blink/+/949d7d7e7b8685454742a55cf0ca912bb9a7b177.
+        Original patch by Elliott Sprehn.
+
+        RenderNamedFlowThread should not create NodeRenderingContext objects
+
+        RenderNamedFlowThread is using NodeRenderingContext to get the original
+        parent renderer, but should just be using NodeRenderingTraversal::parent
+        instead (which is what NodeRenderingContext does internally anyway).
+
+        Tests: No change in functionality. No new tests.
+
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::isChildAllowed):
+
 2013-08-22  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         Introduce a SVGUnknownElement class for unknown SVG elements
index 820f1314cd3e67e016b49598eeb3f6148d51f565..98a6742a4127eea82899f9ae29ea62b06a1702fc 100644 (file)
@@ -30,7 +30,7 @@
 #include "FlowThreadController.h"
 #include "InlineTextBox.h"
 #include "InspectorInstrumentation.h"
-#include "NodeRenderingContext.h"
+#include "NodeRenderingTraversal.h"
 #include "NodeTraversal.h"
 #include "Position.h"
 #include "Range.h"
@@ -38,6 +38,7 @@
 #include "RenderRegion.h"
 #include "RenderText.h"
 #include "RenderView.h"
+#include "ShadowRoot.h"
 #include "Text.h"
 #include "WebKitNamedFlow.h"
 
@@ -480,18 +481,16 @@ const AtomicString& RenderNamedFlowThread::flowThreadName() const
 
 bool RenderNamedFlowThread::isChildAllowed(RenderObject* child, RenderStyle* style) const
 {
-    ASSERT(child);
-    ASSERT(style);
-
     if (!child->node())
         return true;
 
     ASSERT(child->node()->isElementNode());
-    RenderObject* parentRenderer = NodeRenderingContext(child->node()).parentRenderer();
-    if (!parentRenderer)
+    Node* originalParent = NodeRenderingTraversal::parent(child->node());
+
+    if (!originalParent || !originalParent->renderer())
         return true;
 
-    return parentRenderer->isChildAllowed(child, style);
+    return originalParent->renderer()->isChildAllowed(child, style);
 }
 
 void RenderNamedFlowThread::dispatchRegionLayoutUpdateEvent()