[RenderTreeBuilder] Introduce RenderTreebuilder::takeChild
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2018 23:28:51 +0000 (23:28 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2018 23:28:51 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182707
<rdar://problem/37473433>

Reviewed by Antti Koivisto.

All takeChild calls should go through RenderTreeBuilder::takeChild from now on.
This patch also moves the Ruby related takeChild calls to RenderTreeBuilder.

No change in functionality.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::takeChild):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild):
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild): Deleted.
(WebCore::RenderRubyAsBlock::takeChild): Deleted.
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):

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

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderRuby.cpp
Source/WebCore/rendering/RenderRuby.h
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderRubyRun.h
Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
Source/WebCore/rendering/updating/RenderTreeBuilder.h
Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderMultiColumn.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderTable.cpp

index 06904b9..f8a3253 100644 (file)
@@ -1,5 +1,53 @@
 2018-02-12  Zalan Bujtas  <zalan@apple.com>
 
 2018-02-12  Zalan Bujtas  <zalan@apple.com>
 
+        [RenderTreeBuilder] Introduce RenderTreebuilder::takeChild
+        https://bugs.webkit.org/show_bug.cgi?id=182707
+        <rdar://problem/37473433>
+
+        Reviewed by Antti Koivisto.
+
+        All takeChild calls should go through RenderTreeBuilder::takeChild from now on.
+        This patch also moves the Ruby related takeChild calls to RenderTreeBuilder.
+
+        No change in functionality.
+
+        * rendering/RenderButton.cpp:
+        (WebCore::RenderButton::takeChild):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::removeAndDestroyChild):
+        * rendering/RenderFullScreen.cpp:
+        (WebCore::RenderFullScreen::wrapExistingRenderer):
+        (WebCore::RenderFullScreen::unwrapRenderer):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::takeChild):
+        * rendering/RenderRuby.cpp:
+        (WebCore::RenderRubyAsInline::takeChild): Deleted.
+        (WebCore::RenderRubyAsBlock::takeChild): Deleted.
+        * rendering/RenderRuby.h:
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::takeChild): Deleted.
+        * rendering/RenderRubyRun.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::takeChild):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline): Deleted.
+        (WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock): Deleted.
+        (WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun): Deleted.
+        * rendering/updating/RenderTreeBuilder.h:
+        * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
+        (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
+        * rendering/updating/RenderTreeBuilderList.cpp:
+        (WebCore::RenderTreeBuilder::List::updateItemMarker):
+        * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
+        (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
+        (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
+        (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
+        * rendering/updating/RenderTreeBuilderRuby.cpp:
+        (WebCore::RenderTreeBuilder::Ruby::takeChild):
+        * rendering/updating/RenderTreeBuilderTable.cpp:
+        (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
+
+2018-02-12  Zalan Bujtas  <zalan@apple.com>
+
         [RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder
         https://bugs.webkit.org/show_bug.cgi?id=182704
         <rdar://problem/37469469>
         [RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder
         https://bugs.webkit.org/show_bug.cgi?id=182704
         <rdar://problem/37469469>
index ed8a1eb..b544fa6 100644 (file)
@@ -79,7 +79,7 @@ RenderPtr<RenderObject> RenderButton::takeChild(RenderTreeBuilder& builder, Rend
         ASSERT(&oldChild == m_inner || !m_inner);
         return RenderFlexibleBox::takeChild(builder, oldChild);
     }
         ASSERT(&oldChild == m_inner || !m_inner);
         return RenderFlexibleBox::takeChild(builder, oldChild);
     }
-    return m_inner->takeChild(builder, oldChild);
+    return builder.takeChild(*m_inner, oldChild);
 }
     
 void RenderButton::updateAnonymousChildStyle(RenderStyle& childStyle) const
 }
     
 void RenderButton::updateAnonymousChildStyle(RenderStyle& childStyle) const
index e28155d..2cdd78c 100644 (file)
@@ -497,7 +497,7 @@ void RenderElement::removeAndDestroyChild(RenderTreeBuilder& builder, RenderObje
             child.removeAndDestroyChild(builder, firstChild);
         }
     }
             child.removeAndDestroyChild(builder, firstChild);
         }
     }
-    auto toDestroy = takeChild(builder, oldChild);
+    auto toDestroy = builder.takeChild(*this, oldChild);
 }
 
 RenderObject* RenderElement::attachRendererInternal(RenderPtr<RenderObject> child, RenderObject* beforeChild)
 }
 
 RenderObject* RenderElement::attachRendererInternal(RenderPtr<RenderObject> child, RenderObject* beforeChild)
index 84993c0..e3e8315 100644 (file)
@@ -132,7 +132,7 @@ void RenderFullScreen::wrapExistingRenderer(RenderElement& renderer, Document& d
 
     builder.insertChild(parent, WTFMove(newFullscreenRenderer), &renderer);
 
 
     builder.insertChild(parent, WTFMove(newFullscreenRenderer), &renderer);
 
-    auto toMove = parent.takeChild(builder, renderer);
+    auto toMove = builder.takeChild(parent, renderer);
 
     // Always just do a full layout to ensure that line boxes get deleted properly.
     // Because objects moved from |parent| to |fullscreenRenderer|, we want to
 
     // Always just do a full layout to ensure that line boxes get deleted properly.
     // Because objects moved from |parent| to |fullscreenRenderer|, we want to
@@ -178,7 +178,7 @@ void RenderFullScreen::unwrapRenderer(bool& requiresRenderTreeRebuild)
             // lying around on the child.
             if (is<RenderBox>(*child))
                 downcast<RenderBox>(*child).clearOverrideSize();
             // lying around on the child.
             if (is<RenderBox>(*child))
                 downcast<RenderBox>(*child).clearOverrideSize();
-            auto childToMove = child->parent()->takeChild(builder, *child);
+            auto childToMove = builder.takeChild(*child->parent(), *child);
             builder.insertChild(*parent(), WTFMove(childToMove), this);
             parent()->setNeedsLayoutAndPrefWidthsRecalc();
         }
             builder.insertChild(*parent(), WTFMove(childToMove), this);
             parent()->setNeedsLayoutAndPrefWidthsRecalc();
         }
index 543c7f0..c6008ba 100644 (file)
@@ -176,7 +176,7 @@ RenderPtr<RenderObject> RenderMenuList::takeChild(RenderTreeBuilder& builder, Re
 {
     if (!m_innerBlock || &oldChild == m_innerBlock)
         return RenderFlexibleBox::takeChild(builder, oldChild);
 {
     if (!m_innerBlock || &oldChild == m_innerBlock)
         return RenderFlexibleBox::takeChild(builder, oldChild);
-    return m_innerBlock->takeChild(builder, oldChild);
+    return builder.takeChild(*m_innerBlock, oldChild);
 }
 
 void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 }
 
 void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
index 2b79edc..d9eb1c3 100644 (file)
@@ -60,11 +60,6 @@ void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle*
     propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
     propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
-RenderPtr<RenderObject> RenderRubyAsInline::takeChild(RenderTreeBuilder& builder, RenderObject& child)
-{
-    return builder.takeChildFromRenderRubyAsInline(*this, child);
-}
-
 //=== ruby as block object ===
 
 RenderRubyAsBlock::RenderRubyAsBlock(Element& element, RenderStyle&& style)
 //=== ruby as block object ===
 
 RenderRubyAsBlock::RenderRubyAsBlock(Element& element, RenderStyle&& style)
@@ -80,9 +75,4 @@ void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle*
     propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
     propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
-RenderPtr<RenderObject> RenderRubyAsBlock::takeChild(RenderTreeBuilder& builder, RenderObject& child)
-{
-    return builder.takeChildFromRenderRubyAsBlock(*this, child);
-}
-
 } // namespace WebCore
 } // namespace WebCore
index 6fa63c3..e0f1721 100644 (file)
@@ -56,8 +56,6 @@ public:
     RenderRubyAsInline(Element&, RenderStyle&&);
     virtual ~RenderRubyAsInline();
 
     RenderRubyAsInline(Element&, RenderStyle&&);
     virtual ~RenderRubyAsInline();
 
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject& child) override;
-
 protected:
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
 
 protected:
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
 
@@ -76,8 +74,6 @@ public:
 
     Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
 
 
     Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
 
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject& child) override;
-
 protected:
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
 
 protected:
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
 
index e447774..88d431f 100644 (file)
@@ -97,11 +97,6 @@ bool RenderRubyRun::isChildAllowed(const RenderObject& child, const RenderStyle&
     return child.isInline() || child.isRubyText();
 }
 
     return child.isInline() || child.isRubyText();
 }
 
-RenderPtr<RenderObject> RenderRubyRun::takeChild(RenderTreeBuilder& builder, RenderObject& child)
-{
-    return builder.takeChildFromRenderRubyRun(*this, child);
-}
-
 RenderPtr<RenderRubyBase> RenderRubyRun::createRubyBase() const
 {
     auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK);
 RenderPtr<RenderRubyBase> RenderRubyRun::createRubyBase() const
 {
     auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK);
index 043050c..6516690 100644 (file)
@@ -56,7 +56,6 @@ public:
     void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0) override;
 
     bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0) override;
 
     bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject&) override;
 
     RenderBlock* firstLineBlock() const override;
 
 
     RenderBlock* firstLineBlock() const override;
 
index 18bc79b..e2c995c 100644 (file)
@@ -187,6 +187,20 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
     parent.addChild(*this, WTFMove(child), beforeChild);
 }
 
     parent.addChild(*this, WTFMove(child), beforeChild);
 }
 
+RenderPtr<RenderObject> RenderTreeBuilder::takeChild(RenderElement& parent, RenderObject& child)
+{
+    if (is<RenderRubyAsInline>(parent))
+        return rubyBuilder().takeChild(downcast<RenderRubyAsInline>(parent), child);
+
+    if (is<RenderRubyAsBlock>(parent))
+        return rubyBuilder().takeChild(downcast<RenderRubyAsBlock>(parent), child);
+
+    if (is<RenderRubyRun>(parent))
+        return rubyBuilder().takeChild(downcast<RenderRubyRun>(parent), child);
+
+    return parent.takeChild(*this, child);
+}
+
 void RenderTreeBuilder::insertChild(RenderTreePosition& position, RenderPtr<RenderObject> child)
 {
     insertChild(position.parent(), WTFMove(child), position.nextSibling());
 void RenderTreeBuilder::insertChild(RenderTreePosition& position, RenderPtr<RenderObject> child)
 {
     insertChild(position.parent(), WTFMove(child), position.nextSibling());
@@ -476,21 +490,6 @@ void RenderTreeBuilder::insertChildToRenderMathMLFenced(RenderMathMLFenced& pare
     mathMLBuilder().insertChild(parent, WTFMove(child), beforeChild);
 }
 
     mathMLBuilder().insertChild(parent, WTFMove(child), beforeChild);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderRubyAsInline(RenderRubyAsInline& parent, RenderObject& child)
-{
-    return rubyBuilder().takeChild(parent, child);
-}
-
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderRubyAsBlock(RenderRubyAsBlock& parent, RenderObject& child)
-{
-    return rubyBuilder().takeChild(parent, child);
-}
-
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderRubyRun(RenderRubyRun& parent, RenderObject& child)
-{
-    return rubyBuilder().takeChild(parent, child);
-}
-
 RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild)
 {
     return blockBuilder().takeChild(parent, oldChild);
 RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild)
 {
     return blockBuilder().takeChild(parent, oldChild);
index ae45270..a456078 100644 (file)
@@ -51,6 +51,8 @@ public:
     void insertChild(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
     void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
 
     void insertChild(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
     void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
 
+    RenderPtr<RenderObject> takeChild(RenderElement&, RenderObject&) WARN_UNUSED_RETURN;
+
     void updateAfterDescendants(RenderElement&);
 
     // This avoids having to convert all sites that need RenderTreeBuilder in one go.
     void updateAfterDescendants(RenderElement&);
 
     // This avoids having to convert all sites that need RenderTreeBuilder in one go.
@@ -73,9 +75,6 @@ public:
     void insertChildToRenderTableRow(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
     void insertChildToRenderMathMLFenced(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
 
     void insertChildToRenderTableRow(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
     void insertChildToRenderMathMLFenced(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
 
-    RenderPtr<RenderObject> takeChildFromRenderRubyAsInline(RenderRubyAsInline& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChildFromRenderRubyAsBlock(RenderRubyAsBlock& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChildFromRenderRubyRun(RenderRubyRun& parent, RenderObject& child);
     RenderPtr<RenderObject> takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild);
 
     bool childRequiresTable(const RenderElement& parent, const RenderObject& child);
     RenderPtr<RenderObject> takeChildFromRenderBlock(RenderBlock& parent, RenderObject& oldChild);
 
     bool childRequiresTable(const RenderElement& parent, const RenderObject& child);
index 199fb17..1769d7f 100644 (file)
@@ -174,7 +174,7 @@ void RenderTreeBuilder::FirstLetter::updateStyle(RenderBlock& firstLetterBlock,
         while (RenderObject* child = firstLetter->firstChild()) {
             if (is<RenderText>(*child))
                 downcast<RenderText>(*child).removeAndDestroyTextBoxes();
         while (RenderObject* child = firstLetter->firstChild()) {
             if (is<RenderText>(*child))
                 downcast<RenderText>(*child).removeAndDestroyTextBoxes();
-            auto toMove = firstLetter->takeChild(m_builder, *child);
+            auto toMove = m_builder.takeChild(*firstLetter, *child);
             m_builder.insertChild(*newFirstLetter, WTFMove(toMove));
         }
 
             m_builder.insertChild(*newFirstLetter, WTFMove(toMove));
         }
 
index 3c196c6..317b214 100644 (file)
@@ -115,7 +115,7 @@ void RenderTreeBuilder::List::updateItemMarker(RenderListItem& listItemRenderer)
         return;
 
     if (currentParent)
         return;
 
     if (currentParent)
-        m_builder.insertChild(*newParent, currentParent->takeChild(m_builder, *markerRenderer), firstNonMarkerChild(*newParent));
+        m_builder.insertChild(*newParent, m_builder.takeChild(*currentParent, *markerRenderer), firstNonMarkerChild(*newParent));
     else
         m_builder.insertChild(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
 
     else
         m_builder.insertChild(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
 
index b21b67f..0b955ca 100644 (file)
@@ -160,7 +160,7 @@ void RenderTreeBuilder::MultiColumn::createFragmentedFlow(RenderBlockFlow& flow)
             // Move the spanner back to its original position.
             auto& spannerOriginalParent = *placeholder->parent();
             // Detaching the spanner takes care of removing the placeholder (and merges the RenderMultiColumnSets).
             // Move the spanner back to its original position.
             auto& spannerOriginalParent = *placeholder->parent();
             // Detaching the spanner takes care of removing the placeholder (and merges the RenderMultiColumnSets).
-            auto spannerToReInsert = spanner->parent()->takeChild(m_builder, *spanner);
+            auto spannerToReInsert = m_builder.takeChild(*spanner->parent(), *spanner);
             m_builder.insertChild(spannerOriginalParent, WTFMove(spannerToReInsert));
         }
     }
             m_builder.insertChild(spannerOriginalParent, WTFMove(spannerToReInsert));
         }
     }
@@ -208,7 +208,7 @@ void RenderTreeBuilder::MultiColumn::destroyFragmentedFlow(RenderBlockFlow& flow
             spannerOriginalParent = &flow;
         // Detaching the spanner takes care of removing the placeholder (and merges the RenderMultiColumnSets).
         auto* spanner = placeholder->spanner();
             spannerOriginalParent = &flow;
         // Detaching the spanner takes care of removing the placeholder (and merges the RenderMultiColumnSets).
         auto* spanner = placeholder->spanner();
-        parentAndSpannerList.append(std::make_pair(spannerOriginalParent, spanner->parent()->takeChild(m_builder, *spanner)));
+        parentAndSpannerList.append(std::make_pair(spannerOriginalParent, m_builder.takeChild(*spanner->parent(), *spanner)));
     }
     while (auto* columnSet = multiColumnFlow.firstMultiColumnSet())
         columnSet->removeFromParentAndDestroy(m_builder);
     }
     while (auto* columnSet = multiColumnFlow.firstMultiColumnSet())
         columnSet->removeFromParentAndDestroy(m_builder);
@@ -313,7 +313,7 @@ RenderObject* RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant(R
         auto newPlaceholder = RenderMultiColumnSpannerPlaceholder::createAnonymous(flow, downcast<RenderBox>(descendant), container->style());
         auto& placeholder = *newPlaceholder;
         m_builder.insertChild(*container, WTFMove(newPlaceholder), descendant.nextSibling());
         auto newPlaceholder = RenderMultiColumnSpannerPlaceholder::createAnonymous(flow, downcast<RenderBox>(descendant), container->style());
         auto& placeholder = *newPlaceholder;
         m_builder.insertChild(*container, WTFMove(newPlaceholder), descendant.nextSibling());
-        auto takenDescendant = container->takeChild(m_builder, descendant);
+        auto takenDescendant = m_builder.takeChild(*container, descendant);
 
         // This is a guard to stop an ancestor flow thread from processing the spanner.
         gShiftingSpanner = true;
 
         // This is a guard to stop an ancestor flow thread from processing the spanner.
         gShiftingSpanner = true;
index 2addb9b..8bdd3c8 100644 (file)
@@ -387,13 +387,13 @@ RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsInline& p
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
-        auto takenChild = parent.takeChild(m_builder, child);
+        auto takenChild = m_builder.takeChild(parent, child);
         parent.removeFromParentAndDestroy(m_builder);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
         parent.removeFromParentAndDestroy(m_builder);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
-    return findRubyRunParent(child).takeChild(m_builder, child);
+    return m_builder.takeChild(findRubyRunParent(child), child);
 }
 
 RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsBlock& parent, RenderObject& child)
 }
 
 RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsBlock& parent, RenderObject& child)
@@ -411,13 +411,13 @@ RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsBlock& pa
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
-        auto takenChild = parent.takeChild(m_builder, child);
+        auto takenChild = m_builder.takeChild(parent, child);
         parent.removeFromParentAndDestroy(m_builder);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
         parent.removeFromParentAndDestroy(m_builder);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
-    return findRubyRunParent(child).takeChild(m_builder, child);
+    return m_builder.takeChild(findRubyRunParent(child), child);
 }
 
 RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyRun& parent, RenderObject& child)
 }
 
 RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyRun& parent, RenderObject& child)
index a78b213..ce49d6b 100644 (file)
@@ -236,7 +236,7 @@ void RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows(RenderTabl
             continue;
         }
         currentRow->moveAllChildrenTo(m_builder, rowToInsertInto, RenderBoxModelObject::NormalizeAfterInsertion::No);
             continue;
         }
         currentRow->moveAllChildrenTo(m_builder, rowToInsertInto, RenderBoxModelObject::NormalizeAfterInsertion::No);
-        auto toDestroy = section->takeChild(m_builder, *currentRow);
+        auto toDestroy = m_builder.takeChild(*section, *currentRow);
         currentRow = currentRow->nextRow();
     }
     if (rowToInsertInto)
         currentRow = currentRow->nextRow();
     }
     if (rowToInsertInto)