Title: [228441] trunk/Source/WebCore
Revision
228441
Author
za...@apple.com
Date
2018-02-13 15:34:49 -0800 (Tue, 13 Feb 2018)

Log Message

[RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182746
<rdar://problem/37512871>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild): Deleted.
* rendering/RenderBlock.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
(WebCore::RenderTreeBuilder::takeChildFromRenderBlock): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228440 => 228441)


--- trunk/Source/WebCore/ChangeLog	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/ChangeLog	2018-02-13 23:34:49 UTC (rev 228441)
@@ -1,3 +1,26 @@
+2018-02-13  Zalan Bujtas  <za...@apple.com>
+
+        [RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182746
+        <rdar://problem/37512871>
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::takeChild): Deleted.
+        * rendering/RenderBlock.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::takeChild):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderButton):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderBlock): Deleted.
+        * rendering/updating/RenderTreeBuilder.h:
+        * rendering/updating/RenderTreeBuilderBlock.cpp:
+        (WebCore::RenderTreeBuilder::Block::takeChild):
+
 2018-02-13  Antoine Quint  <grao...@apple.com>
 
         [Web Animations] Make KeyframeEffect target nullable and read-write

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (228440 => 228441)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2018-02-13 23:34:49 UTC (rev 228441)
@@ -482,11 +482,6 @@
         cache->deferRecomputeIsIgnored(element());
 }
 
-RenderPtr<RenderObject> RenderBlock::takeChild(RenderTreeBuilder& builder, RenderObject& oldChild)
-{
-    return builder.takeChildFromRenderBlock(*this, oldChild);
-}
-
 bool RenderBlock::childrenPreventSelfCollapsing() const
 {
     // Whether or not we collapse is dependent on whether all our normal flow children

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (228440 => 228441)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2018-02-13 23:34:49 UTC (rev 228441)
@@ -74,7 +74,6 @@
     virtual void deleteLines();
 
     void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject&) override;
 
     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0);
 

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228440 => 228441)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 23:34:49 UTC (rev 228441)
@@ -227,6 +227,9 @@
     if (is<RenderBlockFlow>(parent))
         return blockBuilder().takeChild(downcast<RenderBlockFlow>(parent), child);
 
+    if (is<RenderBlock>(parent))
+        return blockBuilder().takeChild(downcast<RenderBlock>(parent), child);
+
     return parent.takeChild(*this, child);
 }
 
@@ -514,11 +517,6 @@
     mathMLBuilder().insertChild(parent, WTFMove(child), beforeChild);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild)
-{
-    return blockBuilder().takeChild(parent, oldChild);
-}
-
 void RenderTreeBuilder::updateAfterDescendants(RenderElement& renderer)
 {
     if (is<RenderBlock>(renderer))
@@ -538,7 +536,7 @@
 {
     auto* innerRenderer = parent.innerRenderer();
     if (!innerRenderer || &child == innerRenderer)
-        return parent.RenderBlock::takeChild(*this, child);
+        return blockBuilder().takeChild(parent, child);
     return takeChild(*innerRenderer, child);
 }
 
@@ -547,7 +545,7 @@
     auto* innerRenderer = parent.innerRenderer();
     if (!innerRenderer || &child == innerRenderer || child.parent() == &parent) {
         ASSERT(&child == innerRenderer || !innerRenderer);
-        return parent.RenderBlock::takeChild(*this, child);
+        return blockBuilder().takeChild(parent, child);
     }
     return takeChild(*innerRenderer, child);
 }
@@ -554,7 +552,7 @@
 
 RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderGrid(RenderGrid& parent, RenderObject& child)
 {
-    auto takenChild = parent.RenderBlock::takeChild(*this, child);
+    auto takenChild = blockBuilder().takeChild(parent, child);
     // Positioned grid items do not take up space or otherwise participate in the layout of the grid,
     // for that reason we don't need to mark the grid as dirty when they are removed.
     if (child.isOutOfFlowPositioned())

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228440 => 228441)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 23:34:49 UTC (rev 228441)
@@ -78,8 +78,6 @@
     void insertChildToRenderTableRow(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
     void insertChildToRenderMathMLFenced(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
 
-    RenderPtr<RenderObject> takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild);
-
     bool childRequiresTable(const RenderElement& parent, const RenderObject& child);
     void makeChildrenNonInline(RenderBlock& parent, RenderObject* insertionPoint = nullptr);
     RenderObject* splitAnonymousBoxesAroundChild(RenderBox& parent, RenderObject* beforeChild);

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp (228440 => 228441)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp	2018-02-13 23:23:09 UTC (rev 228440)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp	2018-02-13 23:34:49 UTC (rev 228441)
@@ -373,7 +373,7 @@
         if (fragmentedFlow && fragmentedFlow != &child)
             m_builder.multiColumnBuilder().multiColumnRelativeWillBeRemoved(*fragmentedFlow, child);
     }
-    return parent.RenderBlock::takeChild(m_builder, child);
+    return takeChild(static_cast<RenderBlock&>(parent), child);
 }
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to