[RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Feb 2018 23:19:44 +0000 (23:19 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Feb 2018 23:19:44 +0000 (23:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183061
<rdar://problem/37800269>

Reviewed by Ryosuke Niwa.

...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()

No change in functionality.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
(WebCore::Document::setFullScreenRenderer):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::didAttachChild):
(WebCore::RenderElement::didInsertChild): Deleted.
* rendering/RenderElement.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
(WebCore::RenderFullScreen::createPlaceholder):
* rendering/RenderMenuList.cpp:
(RenderMenuList::didAttachChild):
(RenderMenuList::setText):
(RenderMenuList::didInsertChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::updateTextRenderer):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::setText):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroy):
(WebCore::RenderTreeBuilder::attach):
(WebCore::RenderTreeBuilder::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::detach):
(WebCore::RenderTreeBuilder::attachToRenderElement):
(WebCore::RenderTreeBuilder::attachToRenderElementInternal):
(WebCore::RenderTreeBuilder::move):
(WebCore::RenderTreeBuilder::moveAllChildren):
(WebCore::RenderTreeBuilder::moveChildren):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
(WebCore::RenderTreeBuilder::detachFromRenderGrid):
(WebCore::RenderTreeBuilder::detachFromRenderElement):
(WebCore::RenderTreeBuilder::attachToRenderGrid):
(WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
(WebCore::RenderTreeBuilder::insertChild): Deleted.
(WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::takeChild): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
(WebCore::RenderTreeBuilder::moveChildTo): Deleted.
(WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
(WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attach):
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
(WebCore::RenderTreeBuilder::Block::detach):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
(WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::attach):
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
(WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/updating/RenderTreeBuilderBlockFlow.h:
* rendering/updating/RenderTreeBuilderContinuation.cpp:
(WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::attach):
(WebCore::RenderTreeBuilder::FormControls::detach):
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
(WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderFormControls.h:
* rendering/updating/RenderTreeBuilderFullScreen.cpp:
(WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::attach):
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::splitFlow):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
(WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
* rendering/updating/RenderTreeBuilderInline.h:
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::attach):
(WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
* rendering/updating/RenderTreeBuilderMathML.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::attach):
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
(WebCore::RenderTreeBuilder::Ruby::detach):
(WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderRuby.h:
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::attach):
(WebCore::RenderTreeBuilder::SVG::detach):
(WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
(WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderSVG.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Table::attach):
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
(WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
* rendering/updating/RenderTreeBuilderTable.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::RenderTreeUpdater::createTextRenderer):
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers):

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

36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderMenuList.h
Source/WebCore/rendering/RenderQuote.cpp
Source/WebCore/rendering/RenderTextFragment.cpp
Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
Source/WebCore/rendering/updating/RenderTreeBuilder.h
Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderBlock.h
Source/WebCore/rendering/updating/RenderTreeBuilderBlockFlow.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderBlockFlow.h
Source/WebCore/rendering/updating/RenderTreeBuilderContinuation.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderFormControls.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderFormControls.h
Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderInline.h
Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderMathML.h
Source/WebCore/rendering/updating/RenderTreeBuilderMultiColumn.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderRuby.h
Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h
Source/WebCore/rendering/updating/RenderTreeBuilderTable.cpp
Source/WebCore/rendering/updating/RenderTreeBuilderTable.h
Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp

index 9056b25..085545d 100644 (file)
@@ -1,3 +1,159 @@
+2018-02-22  Zalan Bujtas  <zalan@apple.com>
+
+        [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
+        https://bugs.webkit.org/show_bug.cgi?id=183061
+        <rdar://problem/37800269>
+
+        Reviewed by Ryosuke Niwa.
+
+        ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
+        removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
+
+        No change in functionality.
+
+        * dom/Document.cpp:
+        (WebCore::Document::destroyRenderTree):
+        (WebCore::Document::setFullScreenRenderer):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::styleDidChange):
+        * rendering/RenderButton.cpp:
+        (WebCore::RenderButton::setText):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::didAttachChild):
+        (WebCore::RenderElement::didInsertChild): Deleted.
+        * rendering/RenderElement.h:
+        * rendering/RenderFullScreen.cpp:
+        (WebCore::RenderFullScreen::wrapNewRenderer):
+        (WebCore::RenderFullScreen::wrapExistingRenderer):
+        (WebCore::RenderFullScreen::unwrapRenderer):
+        (WebCore::RenderFullScreen::createPlaceholder):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::didAttachChild):
+        (RenderMenuList::setText):
+        (RenderMenuList::didInsertChild): Deleted.
+        * rendering/RenderMenuList.h:
+        * rendering/RenderQuote.cpp:
+        (WebCore::RenderQuote::updateTextRenderer):
+        * rendering/RenderTextFragment.cpp:
+        (WebCore::RenderTextFragment::setText):
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::destroy):
+        (WebCore::RenderTreeBuilder::attach):
+        (WebCore::RenderTreeBuilder::attachIgnoringContinuation):
+        (WebCore::RenderTreeBuilder::detach):
+        (WebCore::RenderTreeBuilder::attachToRenderElement):
+        (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
+        (WebCore::RenderTreeBuilder::move):
+        (WebCore::RenderTreeBuilder::moveAllChildren):
+        (WebCore::RenderTreeBuilder::moveChildren):
+        (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
+        (WebCore::RenderTreeBuilder::makeChildrenNonInline):
+        (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
+        (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
+        (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
+        (WebCore::RenderTreeBuilder::detachFromRenderGrid):
+        (WebCore::RenderTreeBuilder::detachFromRenderElement):
+        (WebCore::RenderTreeBuilder::attachToRenderGrid):
+        (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
+        (WebCore::RenderTreeBuilder::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
+        (WebCore::RenderTreeBuilder::takeChild): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
+        (WebCore::RenderTreeBuilder::moveChildTo): Deleted.
+        (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
+        (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
+        (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
+        (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
+        (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
+        (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
+        * rendering/updating/RenderTreeBuilder.h:
+        * rendering/updating/RenderTreeBuilderBlock.cpp:
+        (WebCore::RenderTreeBuilder::Block::attach):
+        (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
+        (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
+        (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
+        (WebCore::RenderTreeBuilder::Block::detach):
+        (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
+        (WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
+        (WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
+        * rendering/updating/RenderTreeBuilderBlock.h:
+        * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
+        (WebCore::RenderTreeBuilder::BlockFlow::attach):
+        (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
+        (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
+        * rendering/updating/RenderTreeBuilderBlockFlow.h:
+        * rendering/updating/RenderTreeBuilderContinuation.cpp:
+        (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
+        * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
+        (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
+        (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
+        (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
+        * rendering/updating/RenderTreeBuilderFormControls.cpp:
+        (WebCore::RenderTreeBuilder::FormControls::attach):
+        (WebCore::RenderTreeBuilder::FormControls::detach):
+        (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
+        (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
+        * rendering/updating/RenderTreeBuilderFormControls.h:
+        * rendering/updating/RenderTreeBuilderFullScreen.cpp:
+        (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
+        * rendering/updating/RenderTreeBuilderInline.cpp:
+        (WebCore::RenderTreeBuilder::Inline::attach):
+        (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
+        (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
+        (WebCore::RenderTreeBuilder::Inline::splitFlow):
+        (WebCore::RenderTreeBuilder::Inline::splitInlines):
+        (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
+        (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
+        * rendering/updating/RenderTreeBuilderInline.h:
+        * rendering/updating/RenderTreeBuilderList.cpp:
+        (WebCore::RenderTreeBuilder::List::updateItemMarker):
+        * rendering/updating/RenderTreeBuilderMathML.cpp:
+        (WebCore::RenderTreeBuilder::MathML::makeFences):
+        (WebCore::RenderTreeBuilder::MathML::attach):
+        (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
+        * rendering/updating/RenderTreeBuilderMathML.h:
+        * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
+        (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
+        (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
+        (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
+        (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
+        * rendering/updating/RenderTreeBuilderRuby.cpp:
+        (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
+        (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
+        (WebCore::RenderTreeBuilder::Ruby::attach):
+        (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
+        (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
+        (WebCore::RenderTreeBuilder::Ruby::detach):
+        (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
+        * rendering/updating/RenderTreeBuilderRuby.h:
+        * rendering/updating/RenderTreeBuilderSVG.cpp:
+        (WebCore::RenderTreeBuilder::SVG::attach):
+        (WebCore::RenderTreeBuilder::SVG::detach):
+        (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
+        (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
+        * rendering/updating/RenderTreeBuilderSVG.h:
+        * rendering/updating/RenderTreeBuilderTable.cpp:
+        (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
+        (WebCore::RenderTreeBuilder::Table::attach):
+        (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
+        (WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
+        * rendering/updating/RenderTreeBuilderTable.h:
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::createRenderer):
+        (WebCore::RenderTreeUpdater::createTextRenderer):
+        (WebCore::RenderTreeUpdater::tearDownRenderers):
+        (WebCore::RenderTreeUpdater::tearDownTextRenderer):
+        (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
+        * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
+        (WebCore::createContentRenderers):
+
 2018-02-22  Chris Dumez  <cdumez@apple.com>
 
         ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
index 167fa6a..0a5a1df 100644 (file)
@@ -2320,7 +2320,7 @@ void Document::destroyRenderTree()
         RenderTreeBuilder builder(*m_renderView);
         // FIXME: This is a workaround for leftover content (see webkit.org/b/182547).
         while (m_renderView->firstChild())
-            builder.removeAndDestroy(*m_renderView->firstChild());
+            builder.destroy(*m_renderView->firstChild());
         m_renderView->destroy();
     }
     m_renderView.release();
@@ -6321,7 +6321,7 @@ void Document::setFullScreenRenderer(RenderTreeBuilder& builder, RenderFullScree
     }
 
     if (m_fullScreenRenderer)
-        builder.removeAndDestroy(*m_fullScreenRenderer);
+        builder.destroy(*m_fullScreenRenderer);
     ASSERT(!m_fullScreenRenderer);
 
     m_fullScreenRenderer = makeWeakPtr(renderer);
index a7c04af..23ee182 100644 (file)
@@ -2023,7 +2023,7 @@ void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol
     // Fresh floats need to be reparented if they actually belong to the previous anonymous block.
     // It copies the logic of RenderBlock::addChildIgnoringContinuation
     if (noLongerAffectsParentBlock() && style().isFloating() && previousSibling() && previousSibling()->isAnonymousBlock())
-        RenderTreeBuilder::current()->moveChildTo(downcast<RenderBoxModelObject>(*parent()), downcast<RenderBoxModelObject>(*previousSibling()), *this, RenderTreeBuilder::NormalizeAfterInsertion::No);
+        RenderTreeBuilder::current()->move(downcast<RenderBoxModelObject>(*parent()), downcast<RenderBoxModelObject>(*previousSibling()), *this, RenderTreeBuilder::NormalizeAfterInsertion::No);
 
     if (diff >= StyleDifferenceRepaint) {
         // FIXME: This could use a cheaper style-only test instead of SimpleLineLayout::canUseFor.
index 695f0c9..39f42ce 100644 (file)
@@ -106,9 +106,9 @@ void RenderButton::setText(const String& str)
         m_buttonText = makeWeakPtr(*newButtonText);
         // FIXME: This mutation should go through the normal RenderTreeBuilder path.
         if (RenderTreeBuilder::current())
-            RenderTreeBuilder::current()->insertChild(*this, WTFMove(newButtonText));
+            RenderTreeBuilder::current()->attach(*this, WTFMove(newButtonText));
         else
-            RenderTreeBuilder(*document().renderView()).insertChild(*this, WTFMove(newButtonText));
+            RenderTreeBuilder(*document().renderView()).attach(*this, WTFMove(newButtonText));
         return;
     }
 
@@ -117,9 +117,9 @@ void RenderButton::setText(const String& str)
         return;
     }
     if (RenderTreeBuilder::current())
-        RenderTreeBuilder::current()->removeAndDestroy(*m_buttonText);
+        RenderTreeBuilder::current()->destroy(*m_buttonText);
     else
-        RenderTreeBuilder(*document().renderView()).removeAndDestroy(*m_buttonText);
+        RenderTreeBuilder(*document().renderView()).destroy(*m_buttonText);
 }
 
 String RenderButton::text() const
index ed14d71..24ce116 100644 (file)
@@ -456,7 +456,7 @@ void RenderElement::setStyle(RenderStyle&& style, StyleDifference minimalStyleDi
     }
 }
 
-void RenderElement::didInsertChild(RenderObject& child, RenderObject*)
+void RenderElement::didAttachChild(RenderObject& child, RenderObject*)
 {
     if (is<RenderText>(child))
         downcast<RenderText>(child).styleDidChange(StyleDifferenceEqual, nullptr);
index 2f11947..af95e3e 100644 (file)
@@ -87,7 +87,7 @@ public:
     bool isRenderInline() const;
 
     virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const { return true; }
-    void didInsertChild(RenderObject& child, RenderObject* beforeChild);
+    void didAttachChild(RenderObject& child, RenderObject* beforeChild);
 
     // The following functions are used when the render tree hierarchy changes to make sure layers get
     // properly added and removed. Since containership can be implemented by any subclass, and since a hierarchy
index 5385fa8..0552229 100644 (file)
@@ -98,7 +98,7 @@ RenderPtr<RenderFullScreen> RenderFullScreen::wrapNewRenderer(RenderTreeBuilder&
     if (!parent.isChildAllowed(fullscreenRenderer, fullscreenRenderer.style()))
         return nullptr;
 
-    builder.insertChild(fullscreenRenderer, WTFMove(renderer));
+    builder.attach(fullscreenRenderer, WTFMove(renderer));
     fullscreenRenderer.setNeedsLayoutAndPrefWidthsRecalc();
 
     document.setFullScreenRenderer(builder, &fullscreenRenderer);
@@ -125,9 +125,9 @@ void RenderFullScreen::wrapExistingRenderer(RenderElement& renderer, Document& d
     // the line box tree underneath our |containingBlock| is not longer valid.
     containingBlock->deleteLines();
 
-    builder.insertChild(parent, WTFMove(newFullscreenRenderer), &renderer);
+    builder.attach(parent, WTFMove(newFullscreenRenderer), &renderer);
 
-    auto toMove = builder.takeChild(parent, renderer);
+    auto toMove = builder.detach(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
@@ -135,7 +135,7 @@ void RenderFullScreen::wrapExistingRenderer(RenderElement& renderer, Document& d
     parent.setNeedsLayoutAndPrefWidthsRecalc();
     containingBlock->setNeedsLayoutAndPrefWidthsRecalc();
 
-    builder.insertChild(fullscreenRenderer, WTFMove(toMove));
+    builder.attach(fullscreenRenderer, WTFMove(toMove));
     fullscreenRenderer.setNeedsLayoutAndPrefWidthsRecalc();
 
     document.setFullScreenRenderer(builder, &fullscreenRenderer);
@@ -164,7 +164,7 @@ void RenderFullScreen::unwrapRenderer(bool& requiresRenderTreeRebuild)
                 if (auto* nonAnonymousChild = downcast<RenderBlock>(*child).firstChild())
                     child = nonAnonymousChild;
                 else {
-                    builder.removeAndDestroy(*child);
+                    builder.destroy(*child);
                     continue;
                 }
             }
@@ -173,16 +173,16 @@ void RenderFullScreen::unwrapRenderer(bool& requiresRenderTreeRebuild)
             // lying around on the child.
             if (is<RenderBox>(*child))
                 downcast<RenderBox>(*child).clearOverrideSize();
-            auto childToMove = builder.takeChild(*child->parent(), *child);
-            builder.insertChild(*parent(), WTFMove(childToMove), this);
+            auto childToMove = builder.detach(*child->parent(), *child);
+            builder.attach(*parent(), WTFMove(childToMove), this);
             parent()->setNeedsLayoutAndPrefWidthsRecalc();
         }
     }
     if (placeholder())
-        builder.removeAndDestroy(*placeholder());
+        builder.destroy(*placeholder());
     ASSERT(!placeholder());
 
-    builder.removeAndDestroy(*this);
+    builder.destroy(*this);
 }
 
 void RenderFullScreen::createPlaceholder(std::unique_ptr<RenderStyle> style, const LayoutRect& frameRect)
@@ -205,7 +205,7 @@ void RenderFullScreen::createPlaceholder(std::unique_ptr<RenderStyle> style, con
 
     m_placeholder = makeWeakPtr(*newPlaceholder);
 
-    RenderTreeBuilder::current()->insertChild(*parent(), WTFMove(newPlaceholder), this);
+    RenderTreeBuilder::current()->attach(*parent(), WTFMove(newPlaceholder), this);
     parent()->setNeedsLayoutAndPrefWidthsRecalc();
 }
 
index de57fa1..d8895b9 100644 (file)
@@ -165,7 +165,7 @@ HTMLSelectElement& RenderMenuList::selectElement() const
     return downcast<HTMLSelectElement>(nodeForNonAnonymous());
 }
 
-void RenderMenuList::didInsertChild(RenderObject& child, RenderObject*)
+void RenderMenuList::didAttachChild(RenderObject& child, RenderObject*)
 {
     if (AXObjectCache* cache = document().existingAXObjectCache())
         cache->childrenChanged(this, &child);
@@ -279,9 +279,9 @@ void RenderMenuList::setText(const String& s)
         m_buttonText = makeWeakPtr(*newButtonText);
         // FIXME: This mutation should go through the normal RenderTreeBuilder path.
         if (RenderTreeBuilder::current())
-            RenderTreeBuilder::current()->insertChild(*this, WTFMove(newButtonText));
+            RenderTreeBuilder::current()->attach(*this, WTFMove(newButtonText));
         else
-            RenderTreeBuilder(*document().renderView()).insertChild(*this, WTFMove(newButtonText));
+            RenderTreeBuilder(*document().renderView()).attach(*this, WTFMove(newButtonText));
     }
 
     adjustInnerStyle();
index 62f6300..05a9c16 100644 (file)
@@ -62,7 +62,7 @@ public:
     RenderBlock* innerRenderer() const { return m_innerBlock.get(); }
     void setInnerRenderer(RenderBlock&);
 
-    void didInsertChild(RenderObject& child, RenderObject* beforeChild);
+    void didAttachChild(RenderObject& child, RenderObject* beforeChild);
 
 private:
     void willBeDestroyed() override;
index 797318e..34a54e4 100644 (file)
@@ -362,7 +362,7 @@ void RenderQuote::updateTextRenderer(RenderTreeBuilder& builder)
         renderText->dirtyLineBoxes(false);
         return;
     }
-    builder.insertChild(*this, createRenderer<RenderTextFragment>(document(), m_text));
+    builder.attach(*this, createRenderer<RenderTextFragment>(document(), m_text));
 }
 
 String RenderQuote::computeText() const
index 527234e..c9cd667 100644 (file)
@@ -85,9 +85,9 @@ void RenderTextFragment::setText(const String& newText, bool force)
     if (!m_firstLetter)
         return;
     if (RenderTreeBuilder::current())
-        RenderTreeBuilder::current()->removeAndDestroy(*m_firstLetter);
+        RenderTreeBuilder::current()->destroy(*m_firstLetter);
     else
-        RenderTreeBuilder(*document().renderView()).removeAndDestroy(*m_firstLetter);
+        RenderTreeBuilder(*document().renderView()).destroy(*m_firstLetter);
     ASSERT(!m_firstLetter);
     ASSERT(!textNode() || textNode()->renderer() == this);
 }
index 3b375b2..e25a9fc 100644 (file)
@@ -146,10 +146,10 @@ RenderTreeBuilder::~RenderTreeBuilder()
     s_current = m_previous;
 }
 
-void RenderTreeBuilder::removeAndDestroy(RenderObject& renderer)
+void RenderTreeBuilder::destroy(RenderObject& renderer)
 {
     ASSERT(renderer.parent());
-    auto toDestroy = takeChild(*renderer.parent(), renderer);
+    auto toDestroy = detach(*renderer.parent(), renderer);
 
 #if ENABLE(FULLSCREEN_API)
     if (is<RenderFullScreen>(renderer))
@@ -163,7 +163,7 @@ void RenderTreeBuilder::removeAndDestroy(RenderObject& renderer)
         continuationBuilder().cleanupOnDestroy(downcast<RenderBoxModelObject>(renderer));
 
     // We need to detach the subtree first so that the descendants don't have
-    // access to previous/next sublings at takeChild().
+    // access to previous/next sublings at detach().
     // FIXME: webkit.org/b/182909.
     if (!is<RenderElement>(toDestroy.get()))
         return;
@@ -173,18 +173,18 @@ void RenderTreeBuilder::removeAndDestroy(RenderObject& renderer)
         auto& firstChild = *childToDestroy.firstChild();
         if (auto* node = firstChild.node())
             node->setRenderer(nullptr);
-        removeAndDestroy(firstChild);
+        destroy(firstChild);
     }
 }
 
-void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::attach(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto insertRecursiveIfNeeded = [&](RenderElement& parentCandidate) {
         if (&parent == &parentCandidate) {
-            insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+            attachToRenderElement(parent, WTFMove(child), beforeChild);
             return;
         }
-        insertChild(parentCandidate, WTFMove(child), beforeChild);
+        attach(parentCandidate, WTFMove(child), beforeChild);
     };
 
     ASSERT(&parent.view() == &m_view);
@@ -197,7 +197,7 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
     if (is<RenderTableRow>(parent)) {
         auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTableRow>(parent), *child, beforeChild);
         if (&parentCandidate == &parent) {
-            tableBuilder().insertChild(downcast<RenderTableRow>(parentCandidate), WTFMove(child), beforeChild);
+            tableBuilder().attach(downcast<RenderTableRow>(parentCandidate), WTFMove(child), beforeChild);
             return;
         }
         insertRecursiveIfNeeded(parentCandidate);
@@ -207,7 +207,7 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
     if (is<RenderTableSection>(parent)) {
         auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTableSection>(parent), *child, beforeChild);
         if (&parent == &parentCandidate) {
-            tableBuilder().insertChild(downcast<RenderTableSection>(parent), WTFMove(child), beforeChild);
+            tableBuilder().attach(downcast<RenderTableSection>(parent), WTFMove(child), beforeChild);
             return;
         }
         insertRecursiveIfNeeded(parentCandidate);
@@ -217,7 +217,7 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
     if (is<RenderTable>(parent)) {
         auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTable>(parent), *child, beforeChild);
         if (&parentCandidate == &parent) {
-            tableBuilder().insertChild(downcast<RenderTable>(parentCandidate), WTFMove(child), beforeChild);
+            tableBuilder().attach(downcast<RenderTable>(parentCandidate), WTFMove(child), beforeChild);
             return;
         }
         insertRecursiveIfNeeded(parentCandidate);
@@ -235,130 +235,130 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
     }
 
     if (is<RenderRubyRun>(parent)) {
-        rubyBuilder().insertChild(downcast<RenderRubyRun>(parent), WTFMove(child), beforeChild);
+        rubyBuilder().attach(downcast<RenderRubyRun>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderButton>(parent)) {
-        formControlsBuilder().insertChild(downcast<RenderButton>(parent), WTFMove(child), beforeChild);
+        formControlsBuilder().attach(downcast<RenderButton>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderMenuList>(parent)) {
-        formControlsBuilder().insertChild(downcast<RenderMenuList>(parent), WTFMove(child), beforeChild);
+        formControlsBuilder().attach(downcast<RenderMenuList>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderSVGContainer>(parent)) {
-        svgBuilder().insertChild(downcast<RenderSVGContainer>(parent), WTFMove(child), beforeChild);
+        svgBuilder().attach(downcast<RenderSVGContainer>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderSVGInline>(parent)) {
-        svgBuilder().insertChild(downcast<RenderSVGInline>(parent), WTFMove(child), beforeChild);
+        svgBuilder().attach(downcast<RenderSVGInline>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderSVGRoot>(parent)) {
-        svgBuilder().insertChild(downcast<RenderSVGRoot>(parent), WTFMove(child), beforeChild);
+        svgBuilder().attach(downcast<RenderSVGRoot>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderSVGText>(parent)) {
-        svgBuilder().insertChild(downcast<RenderSVGText>(parent), WTFMove(child), beforeChild);
+        svgBuilder().attach(downcast<RenderSVGText>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderMathMLFenced>(parent)) {
-        mathMLBuilder().insertChild(downcast<RenderMathMLFenced>(parent), WTFMove(child), beforeChild);
+        mathMLBuilder().attach(downcast<RenderMathMLFenced>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderGrid>(parent)) {
-        insertChildToRenderGrid(downcast<RenderGrid>(parent), WTFMove(child), beforeChild);
+        attachToRenderGrid(downcast<RenderGrid>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderBlockFlow>(parent)) {
-        blockFlowBuilder().insertChild(downcast<RenderBlockFlow>(parent), WTFMove(child), beforeChild);
+        blockFlowBuilder().attach(downcast<RenderBlockFlow>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderBlock>(parent)) {
-        blockBuilder().insertChild(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
+        blockBuilder().attach(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderInline>(parent)) {
-        inlineBuilder().insertChild(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
+        inlineBuilder().attach(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
         return;
     }
 
-    insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    attachToRenderElement(parent, WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::insertChildIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::attachIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (is<RenderInline>(parent)) {
-        inlineBuilder().insertChildIgnoringContinuation(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
+        inlineBuilder().attachIgnoringContinuation(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
         return;
     }
 
     if (is<RenderBlock>(parent)) {
-        blockBuilder().insertChildIgnoringContinuation(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
+        blockBuilder().attachIgnoringContinuation(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
         return;
     }
 
-    insertChild(parent, WTFMove(child), beforeChild);
+    attach(parent, WTFMove(child), beforeChild);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::takeChild(RenderElement& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::detach(RenderElement& parent, RenderObject& child)
 {
     if (is<RenderRubyAsInline>(parent))
-        return rubyBuilder().takeChild(downcast<RenderRubyAsInline>(parent), child);
+        return rubyBuilder().detach(downcast<RenderRubyAsInline>(parent), child);
 
     if (is<RenderRubyAsBlock>(parent))
-        return rubyBuilder().takeChild(downcast<RenderRubyAsBlock>(parent), child);
+        return rubyBuilder().detach(downcast<RenderRubyAsBlock>(parent), child);
 
     if (is<RenderRubyRun>(parent))
-        return rubyBuilder().takeChild(downcast<RenderRubyRun>(parent), child);
+        return rubyBuilder().detach(downcast<RenderRubyRun>(parent), child);
 
     if (is<RenderMenuList>(parent))
-        return formControlsBuilder().takeChild(downcast<RenderMenuList>(parent), child);
+        return formControlsBuilder().detach(downcast<RenderMenuList>(parent), child);
 
     if (is<RenderButton>(parent))
-        return formControlsBuilder().takeChild(downcast<RenderButton>(parent), child);
+        return formControlsBuilder().detach(downcast<RenderButton>(parent), child);
 
     if (is<RenderGrid>(parent))
-        return takeChildFromRenderGrid(downcast<RenderGrid>(parent), child);
+        return detachFromRenderGrid(downcast<RenderGrid>(parent), child);
 
     if (is<RenderSVGText>(parent))
-        return svgBuilder().takeChild(downcast<RenderSVGText>(parent), child);
+        return svgBuilder().detach(downcast<RenderSVGText>(parent), child);
 
     if (is<RenderSVGInline>(parent))
-        return svgBuilder().takeChild(downcast<RenderSVGInline>(parent), child);
+        return svgBuilder().detach(downcast<RenderSVGInline>(parent), child);
 
     if (is<RenderSVGContainer>(parent))
-        return svgBuilder().takeChild(downcast<RenderSVGContainer>(parent), child);
+        return svgBuilder().detach(downcast<RenderSVGContainer>(parent), child);
 
     if (is<RenderSVGRoot>(parent))
-        return svgBuilder().takeChild(downcast<RenderSVGRoot>(parent), child);
+        return svgBuilder().detach(downcast<RenderSVGRoot>(parent), child);
 
     if (is<RenderBlockFlow>(parent))
-        return blockBuilder().takeChild(downcast<RenderBlockFlow>(parent), child);
+        return blockBuilder().detach(downcast<RenderBlockFlow>(parent), child);
 
     if (is<RenderBlock>(parent))
-        return blockBuilder().takeChild(downcast<RenderBlock>(parent), child);
+        return blockBuilder().detach(downcast<RenderBlock>(parent), child);
 
-    return takeChildFromRenderElement(parent, child);
+    return detachFromRenderElement(parent, child);
 }
 
-void RenderTreeBuilder::insertChild(RenderTreePosition& position, RenderPtr<RenderObject> child)
+void RenderTreeBuilder::attach(RenderTreePosition& position, RenderPtr<RenderObject> child)
 {
-    insertChild(position.parent(), WTFMove(child), position.nextSibling());
+    attach(position.parent(), WTFMove(child), position.nextSibling());
 }
 
-void RenderTreeBuilder::insertChildToRenderElement(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::attachToRenderElement(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (tableBuilder().childRequiresTable(parent, *child)) {
         RenderTable* table;
@@ -368,18 +368,18 @@ void RenderTreeBuilder::insertChildToRenderElement(RenderElement& parent, Render
         else {
             auto newTable = RenderTable::createAnonymousWithParentRenderer(parent);
             table = newTable.get();
-            insertChild(parent, WTFMove(newTable), beforeChild);
+            attach(parent, WTFMove(newTable), beforeChild);
         }
 
-        insertChild(*table, WTFMove(child));
+        attach(*table, WTFMove(child));
         return;
     }
     auto& newChild = *child.get();
-    insertChildToRenderElementInternal(parent, WTFMove(child), beforeChild);
-    parent.didInsertChild(newChild, beforeChild);
+    attachToRenderElementInternal(parent, WTFMove(child), beforeChild);
+    parent.didAttachChild(newChild, beforeChild);
 }
 
-void RenderTreeBuilder::insertChildToRenderElementInternal(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::attachToRenderElementInternal(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     RELEASE_ASSERT_WITH_MESSAGE(!parent.view().frameView().layoutContext().layoutState(), "Layout must not mutate render tree");
     ASSERT(parent.canHaveChildren() || parent.canHaveGeneratedChildren());
@@ -420,7 +420,7 @@ void RenderTreeBuilder::insertChildToRenderElementInternal(RenderElement& parent
         newChild->setHasOutlineAutoAncestor();
 }
 
-void RenderTreeBuilder::moveChildTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::move(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
 {
     // We assume that callers have cleared their positioned objects list for child moves so the
     // positioned renderer maps don't become stale. It would be too slow to do the map lookup on each call.
@@ -431,35 +431,35 @@ void RenderTreeBuilder::moveChildTo(RenderBoxModelObject& from, RenderBoxModelOb
     if (normalizeAfterInsertion == NormalizeAfterInsertion::Yes && (to.isRenderBlock() || to.isRenderInline())) {
         // Takes care of adding the new child correctly if toBlock and fromBlock
         // have different kind of children (block vs inline).
-        auto childToMove = takeChildFromRenderElement(from, child);
-        insertChild(to, WTFMove(childToMove), beforeChild);
+        auto childToMove = detachFromRenderElement(from, child);
+        attach(to, WTFMove(childToMove), beforeChild);
     } else {
-        auto childToMove = takeChildFromRenderElement(from, child);
-        insertChildToRenderElementInternal(to, WTFMove(childToMove), beforeChild);
+        auto childToMove = detachFromRenderElement(from, child);
+        attachToRenderElementInternal(to, WTFMove(childToMove), beforeChild);
     }
 }
 
-void RenderTreeBuilder::moveChildTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::move(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    moveChildTo(from, to, child, nullptr, normalizeAfterInsertion);
+    move(from, to, child, nullptr, normalizeAfterInsertion);
 }
 
-void RenderTreeBuilder::moveAllChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::moveAllChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    moveAllChildrenTo(from, to, nullptr, normalizeAfterInsertion);
+    moveAllChildren(from, to, nullptr, normalizeAfterInsertion);
 }
 
-void RenderTreeBuilder::moveAllChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::moveAllChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    moveChildrenTo(from, to, from.firstChild(), nullptr, beforeChild, normalizeAfterInsertion);
+    moveChildren(from, to, from.firstChild(), nullptr, beforeChild, normalizeAfterInsertion);
 }
 
-void RenderTreeBuilder::moveChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::moveChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    moveChildrenTo(from, to, startChild, endChild, nullptr, normalizeAfterInsertion);
+    moveChildren(from, to, startChild, endChild, nullptr, normalizeAfterInsertion);
 }
 
-void RenderTreeBuilder::moveChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::moveChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
 {
     // This condition is rarely hit since this function is usually called on
     // anonymous blocks which can no longer carry positioned objects (see r120761)
@@ -492,18 +492,18 @@ void RenderTreeBuilder::moveChildrenTo(RenderBoxModelObject& from, RenderBoxMode
                 nextSibling = nextSibling->nextSibling();
         }
 
-        moveChildTo(from, to, *child, beforeChild, normalizeAfterInsertion);
+        move(from, to, *child, beforeChild, normalizeAfterInsertion);
         child = nextSibling;
     }
 }
 
-void RenderTreeBuilder::moveAllChildrenIncludingFloatsTo(RenderBlock& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::moveAllChildrenIncludingFloats(RenderBlock& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion normalizeAfterInsertion)
 {
     if (is<RenderBlockFlow>(from)) {
-        blockFlowBuilder().moveAllChildrenIncludingFloatsTo(downcast<RenderBlockFlow>(from), to, normalizeAfterInsertion);
+        blockFlowBuilder().moveAllChildrenIncludingFloats(downcast<RenderBlockFlow>(from), to, normalizeAfterInsertion);
         return;
     }
-    moveAllChildrenTo(from, to, normalizeAfterInsertion);
+    moveAllChildren(from, to, normalizeAfterInsertion);
 }
 
 void RenderTreeBuilder::makeChildrenNonInline(RenderBlock& parent, RenderObject* insertionPoint)
@@ -538,8 +538,8 @@ void RenderTreeBuilder::makeChildrenNonInline(RenderBlock& parent, RenderObject*
 
         auto newBlock = parent.createAnonymousBlock();
         auto& block = *newBlock;
-        insertChildToRenderElementInternal(parent, WTFMove(newBlock), inlineRunStart);
-        moveChildrenTo(parent, block, inlineRunStart, child, RenderTreeBuilder::NormalizeAfterInsertion::No);
+        attachToRenderElementInternal(parent, WTFMove(newBlock), inlineRunStart);
+        moveChildren(parent, block, inlineRunStart, child, RenderTreeBuilder::NormalizeAfterInsertion::No);
     }
 #ifndef NDEBUG
     for (RenderObject* c = parent.firstChild(); c; c = c->nextSibling())
@@ -567,8 +567,8 @@ RenderObject* RenderTreeBuilder::splitAnonymousBoxesAroundChild(RenderBox& paren
             // so that the table repainting logic knows the structure is dirty.
             // See for example RenderTableCell:clippedOverflowRectForRepaint.
             markBoxForRelayoutAfterSplit(*parentBox);
-            insertChildToRenderElementInternal(*parentBox, WTFMove(newPostBox), boxToSplit.nextSibling());
-            moveChildrenTo(boxToSplit, postBox, beforeChild, nullptr, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+            attachToRenderElementInternal(*parentBox, WTFMove(newPostBox), boxToSplit.nextSibling());
+            moveChildren(boxToSplit, postBox, beforeChild, nullptr, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
 
             markBoxForRelayoutAfterSplit(boxToSplit);
             markBoxForRelayoutAfterSplit(postBox);
@@ -597,9 +597,9 @@ void RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock(RenderElement
         // An anonymous block must be made to wrap this inline.
         auto newBlock = downcast<RenderBlock>(*parent).createAnonymousBlock();
         auto& block = *newBlock;
-        insertChildToRenderElementInternal(*parent, WTFMove(newBlock), &child);
-        auto thisToMove = takeChildFromRenderElement(*parent, child);
-        insertChildToRenderElementInternal(block, WTFMove(thisToMove));
+        attachToRenderElementInternal(*parent, WTFMove(newBlock), &child);
+        auto thisToMove = detachFromRenderElement(*parent, child);
+        attachToRenderElementInternal(block, WTFMove(thisToMove));
     }
 }
 
@@ -661,11 +661,11 @@ static RenderObject& findDestroyRootIncludingAnonymous(RenderObject& renderer)
     return *destroyRoot;
 }
 
-void RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers(RenderObject& child)
+void RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers(RenderObject& child)
 {
     // If the tree is destroyed, there is no need for a clean-up phase.
     if (child.renderTreeBeingDestroyed()) {
-        removeAndDestroy(child);
+        destroy(child);
         return;
     }
 
@@ -677,12 +677,12 @@ void RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers(Re
         tableBuilder().collapseAndDestroyAnonymousSiblingRows(downcast<RenderTableRow>(destroyRoot));
 
     auto& destroyRootParent = *destroyRoot.parent();
-    removeAndDestroy(destroyRoot);
+    destroy(destroyRoot);
     removeAnonymousWrappersForInlineChildrenIfNeeded(destroyRootParent);
 
     // Anonymous parent might have become empty, try to delete it too.
     if (isAnonymousAndSafeToDelete(destroyRootParent) && !destroyRootParent.firstChild())
-        removeFromParentAndDestroyCleaningUpAnonymousWrappers(destroyRootParent);
+        destroyAndCleanUpAnonymousWrappers(destroyRootParent);
     // WARNING: child is deleted here.
 }
 
@@ -696,9 +696,9 @@ void RenderTreeBuilder::updateAfterDescendants(RenderElement& renderer)
         multiColumnBuilder().updateAfterDescendants(downcast<RenderBlockFlow>(renderer));
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderGrid(RenderGrid& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::detachFromRenderGrid(RenderGrid& parent, RenderObject& child)
 {
-    auto takenChild = blockBuilder().takeChild(parent, child);
+    auto takenChild = blockBuilder().detach(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())
@@ -709,7 +709,7 @@ RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderGrid(RenderGrid& p
     return takenChild;
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderElement(RenderElement& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::detachFromRenderElement(RenderElement& parent, RenderObject& child)
 {
     RELEASE_ASSERT_WITH_MESSAGE(!parent.view().frameView().layoutContext().layoutState(), "Layout must not mutate render tree");
 
@@ -768,10 +768,10 @@ RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderElement(RenderElem
     return childToTake;
 }
 
-void RenderTreeBuilder::insertChildToRenderGrid(RenderGrid& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::attachToRenderGrid(RenderGrid& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& newChild = *child;
-    blockBuilder().insertChild(parent, WTFMove(child), beforeChild);
+    blockBuilder().attach(parent, WTFMove(child), beforeChild);
 
     // 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 added.
index 23f661c..57b075b 100644 (file)
@@ -41,39 +41,40 @@ public:
     // FIXME: Remove.
     static RenderTreeBuilder* current() { return s_current; }
 
-    void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
-    void insertChild(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
+    void attach(RenderTreePosition&, RenderPtr<RenderObject>);
+    void attach(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
 
-    void removeAndDestroy(RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderElement&, RenderObject&) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderElement&, RenderObject&) WARN_UNUSED_RETURN;
+
+    void destroy(RenderObject& renderer);
 
     // NormalizeAfterInsertion::Yes ensures that the destination subtree is consistent after the insertion (anonymous wrappers etc).
     enum class NormalizeAfterInsertion { No, Yes };
-    void moveChildTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, NormalizeAfterInsertion);
+    void move(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, NormalizeAfterInsertion);
 
     void updateAfterDescendants(RenderElement&);
-    void removeFromParentAndDestroyCleaningUpAnonymousWrappers(RenderObject& child);
+    void destroyAndCleanUpAnonymousWrappers(RenderObject& child);
 
     void childFlowStateChangesAndAffectsParentBlock(RenderElement& child);
     void childFlowStateChangesAndNoLongerAffectsParentBlock(RenderElement& child);
 
 private:
-    void insertChildIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChildToRenderGrid(RenderGrid& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
-    void insertChildToRenderElement(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
-    void insertChildToRenderElementInternal(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
+    void attachIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
+    void attachToRenderGrid(RenderGrid& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
+    void attachToRenderElement(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
+    void attachToRenderElementInternal(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
 
-    RenderPtr<RenderObject> takeChildFromRenderElement(RenderElement& parent, RenderObject& child) WARN_UNUSED_RETURN;
-    RenderPtr<RenderObject> takeChildFromRenderGrid(RenderGrid& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detachFromRenderElement(RenderElement& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detachFromRenderGrid(RenderGrid& parent, RenderObject& child) WARN_UNUSED_RETURN;
 
-    void moveChildTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, RenderObject* beforeChild, NormalizeAfterInsertion);
+    void move(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject& child, RenderObject* beforeChild, NormalizeAfterInsertion);
     // Move all of the kids from |startChild| up to but excluding |endChild|. 0 can be passed as the |endChild| to denote
     // that all the kids from |startChild| onwards should be moved.
-    void moveChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, NormalizeAfterInsertion);
-    void moveChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, NormalizeAfterInsertion);
-    void moveAllChildrenIncludingFloatsTo(RenderBlock& from, RenderBlock& toBlock, RenderTreeBuilder::NormalizeAfterInsertion);
-    void moveAllChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, NormalizeAfterInsertion);
-    void moveAllChildrenTo(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* beforeChild, NormalizeAfterInsertion);
+    void moveChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, NormalizeAfterInsertion);
+    void moveChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, NormalizeAfterInsertion);
+    void moveAllChildrenIncludingFloats(RenderBlock& from, RenderBlock& toBlock, RenderTreeBuilder::NormalizeAfterInsertion);
+    void moveAllChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, NormalizeAfterInsertion);
+    void moveAllChildren(RenderBoxModelObject& from, RenderBoxModelObject& to, RenderObject* beforeChild, NormalizeAfterInsertion);
 
     RenderObject* splitAnonymousBoxesAroundChild(RenderBox& parent, RenderObject* beforeChild);
     void makeChildrenNonInline(RenderBlock& parent, RenderObject* insertionPoint = nullptr);
index fd225b7..0ae39a6 100644 (file)
@@ -106,12 +106,12 @@ RenderTreeBuilder::Block::Block(RenderTreeBuilder& builder)
 {
 }
 
-void RenderTreeBuilder::Block::insertChild(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Block::attach(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (parent.continuation() && !parent.isAnonymousBlock())
         insertChildToContinuation(parent, WTFMove(child), beforeChild);
     else
-        insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
+        attachIgnoringContinuation(parent, WTFMove(child), beforeChild);
 }
 
 void RenderTreeBuilder::Block::insertChildToContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
@@ -130,7 +130,7 @@ void RenderTreeBuilder::Block::insertChildToContinuation(RenderBlock& parent, Re
     }
 
     if (child->isFloatingOrOutOfFlowPositioned()) {
-        m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
+        m_builder.attachIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
         return;
     }
 
@@ -139,24 +139,24 @@ void RenderTreeBuilder::Block::insertChildToContinuation(RenderBlock& parent, Re
     bool flowIsNormal = flow->isInline() || !flow->style().columnSpan();
 
     if (flow == beforeChildParent) {
-        m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child), beforeChild);
+        m_builder.attachIgnoringContinuation(*flow, WTFMove(child), beforeChild);
         return;
     }
 
     // The goal here is to match up if we can, so that we can coalesce and create the
     // minimal # of continuations needed for the inline.
     if (childIsNormal == bcpIsNormal) {
-        m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
+        m_builder.attachIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
         return;
     }
     if (flowIsNormal == childIsNormal) {
-        m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
+        m_builder.attachIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
         return;
     }
-    m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
+    m_builder.attachIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Block::attachIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (beforeChild && beforeChild->parent() != &parent) {
         RenderElement* beforeChildContainer = beforeChild->parent();
@@ -179,9 +179,9 @@ void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& pare
                 ) {
                 // Insert the child into the anonymous block box instead of here.
                 if (child->isInline() || beforeChild->parent()->firstChild() != beforeChild)
-                    m_builder.insertChild(*beforeChild->parent(), WTFMove(child), beforeChild);
+                    m_builder.attach(*beforeChild->parent(), WTFMove(child), beforeChild);
                 else
-                    m_builder.insertChild(parent, WTFMove(child), beforeChild->parent());
+                    m_builder.attach(parent, WTFMove(child), beforeChild->parent());
                 return;
             }
 
@@ -189,7 +189,7 @@ void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& pare
 
             if (child->isTablePart()) {
                 // Insert into the anonymous table.
-                m_builder.insertChild(*beforeChildAnonymousContainer, WTFMove(child), beforeChild);
+                m_builder.attach(*beforeChildAnonymousContainer, WTFMove(child), beforeChild);
                 return;
             }
 
@@ -221,7 +221,7 @@ void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& pare
         RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : parent.lastChild();
 
         if (afterChild && afterChild->isAnonymousBlock()) {
-            m_builder.insertChild(downcast<RenderBlock>(*afterChild), WTFMove(child));
+            m_builder.attach(downcast<RenderBlock>(*afterChild), WTFMove(child));
             return;
         }
 
@@ -229,15 +229,15 @@ void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& pare
             // No suitable existing anonymous box - create a new one.
             auto newBox = parent.createAnonymousBlock();
             auto& box = *newBox;
-            m_builder.insertChildToRenderElement(parent, WTFMove(newBox), beforeChild);
-            m_builder.insertChild(box, WTFMove(child));
+            m_builder.attachToRenderElement(parent, WTFMove(newBox), beforeChild);
+            m_builder.attach(box, WTFMove(child));
             return;
         }
     }
 
     parent.invalidateLineLayoutPath();
 
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
 
     if (madeBoxesNonInline && is<RenderBlock>(parent.parent()) && parent.isAnonymousBlock())
         removeLeftoverAnonymousBlock(parent);
@@ -267,16 +267,16 @@ void RenderTreeBuilder::Block::removeLeftoverAnonymousBlock(RenderBlock& anonymo
 
     // FIXME: This should really just be a moveAllChilrenTo (see webkit.org/b/182495)
     moveAllChildrenToInternal(anonymousBlock, *parent);
-    auto toBeDestroyed = m_builder.takeChildFromRenderElement(*parent, anonymousBlock);
+    auto toBeDestroyed = m_builder.detachFromRenderElement(*parent, anonymousBlock);
     // anonymousBlock is dead here.
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::Block::takeChild(RenderBlock& parent, RenderObject& oldChild)
+RenderPtr<RenderObject> RenderTreeBuilder::Block::detach(RenderBlock& parent, RenderObject& oldChild)
 {
     // No need to waste time in merging or removing empty anonymous blocks.
     // We can just bail out if our document is getting destroyed.
     if (parent.renderTreeBeingDestroyed())
-        return m_builder.takeChildFromRenderElement(parent, oldChild);
+        return m_builder.detachFromRenderElement(parent, oldChild);
 
     // If this child is a block, and if our previous and next siblings are both anonymous blocks
     // with inline content, then we can fold the inline content back together.
@@ -299,11 +299,11 @@ RenderPtr<RenderObject> RenderTreeBuilder::Block::takeChild(RenderBlock& parent,
             ASSERT(!inlineChildrenBlock.continuation());
             // Cache this value as it might get changed in setStyle() call.
             inlineChildrenBlock.setStyle(RenderStyle::createAnonymousStyleWithDisplay(parent.style(), BLOCK));
-            auto blockToMove = m_builder.takeChildFromRenderElement(parent, inlineChildrenBlock);
+            auto blockToMove = m_builder.detachFromRenderElement(parent, inlineChildrenBlock);
 
             // Now just put the inlineChildrenBlock inside the blockChildrenBlock.
             RenderObject* beforeChild = prev == &inlineChildrenBlock ? blockChildrenBlock.firstChild() : nullptr;
-            m_builder.insertChildToRenderElementInternal(blockChildrenBlock, WTFMove(blockToMove), beforeChild);
+            m_builder.attachToRenderElementInternal(blockChildrenBlock, WTFMove(blockToMove), beforeChild);
             next->setNeedsLayoutAndPrefWidthsRecalc();
 
             // inlineChildrenBlock got reparented to blockChildrenBlock, so it is no longer a child
@@ -315,18 +315,18 @@ RenderPtr<RenderObject> RenderTreeBuilder::Block::takeChild(RenderBlock& parent,
         } else {
             // Take all the children out of the |next| block and put them in
             // the |prev| block.
-            m_builder.moveAllChildrenIncludingFloatsTo(nextBlock, prevBlock, RenderTreeBuilder::NormalizeAfterInsertion::No);
+            m_builder.moveAllChildrenIncludingFloats(nextBlock, prevBlock, RenderTreeBuilder::NormalizeAfterInsertion::No);
 
             // Delete the now-empty block's lines and nuke it.
             nextBlock.deleteLines();
-            m_builder.removeAndDestroy(nextBlock);
+            m_builder.destroy(nextBlock);
             next = nullptr;
         }
     }
 
     parent.invalidateLineLayoutPath();
 
-    auto takenChild = m_builder.takeChildFromRenderElement(parent, oldChild);
+    auto takenChild = m_builder.detachFromRenderElement(parent, oldChild);
 
     RenderObject* child = prev ? prev : next;
     if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && parent.canDropAnonymousBlockChild()) {
@@ -366,20 +366,20 @@ void RenderTreeBuilder::Block::dropAnonymousBoxChild(RenderBlock& parent, Render
     parent.setChildrenInline(child.childrenInline());
     auto* nextSibling = child.nextSibling();
 
-    auto toBeDeleted = m_builder.takeChildFromRenderElement(parent, child);
-    m_builder.moveAllChildrenTo(child, parent, nextSibling, RenderTreeBuilder::NormalizeAfterInsertion::No);
+    auto toBeDeleted = m_builder.detachFromRenderElement(parent, child);
+    m_builder.moveAllChildren(child, parent, nextSibling, RenderTreeBuilder::NormalizeAfterInsertion::No);
     // Delete the now-empty block's lines and nuke it.
     child.deleteLines();
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::Block::takeChild(RenderBlockFlow& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::Block::detach(RenderBlockFlow& parent, RenderObject& child)
 {
     if (!parent.renderTreeBeingDestroyed()) {
         auto* fragmentedFlow = parent.multiColumnFlow();
         if (fragmentedFlow && fragmentedFlow != &child)
             m_builder.multiColumnBuilder().multiColumnRelativeWillBeRemoved(*fragmentedFlow, child);
     }
-    return takeChild(static_cast<RenderBlock&>(parent), child);
+    return detach(static_cast<RenderBlock&>(parent), child);
 }
 
 }
index 4929eb1..262042d 100644 (file)
@@ -33,11 +33,11 @@ class RenderTreeBuilder::Block {
 public:
     Block(RenderTreeBuilder&);
 
-    void insertChild(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChildIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attachIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
-    RenderPtr<RenderObject> takeChild(RenderBlock& parent, RenderObject& oldChild);
-    RenderPtr<RenderObject> takeChild(RenderBlockFlow& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderBlock& parent, RenderObject& oldChild);
+    RenderPtr<RenderObject> detach(RenderBlockFlow& parent, RenderObject& child);
 
     void dropAnonymousBoxChild(RenderBlock& parent, RenderBlock& child);
     void childBecameNonInline(RenderBlock& parent, RenderElement& child);
index 30e4197..3bc82c6 100644 (file)
@@ -35,19 +35,19 @@ RenderTreeBuilder::BlockFlow::BlockFlow(RenderTreeBuilder& builder)
 {
 }
 
-void RenderTreeBuilder::BlockFlow::insertChild(RenderBlockFlow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::BlockFlow::attach(RenderBlockFlow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (parent.multiColumnFlow() && (!parent.isFieldset() || !child->isLegend()))
-        return m_builder.insertChild(*parent.multiColumnFlow(), WTFMove(child), beforeChild);
+        return m_builder.attach(*parent.multiColumnFlow(), WTFMove(child), beforeChild);
     auto* beforeChildOrPlaceholder = beforeChild;
     if (auto* containingFragmentedFlow = parent.enclosingFragmentedFlow())
         beforeChildOrPlaceholder = m_builder.multiColumnBuilder().resolveMovedChild(*containingFragmentedFlow, beforeChild);
-    m_builder.blockBuilder().insertChild(parent, WTFMove(child), beforeChildOrPlaceholder);
+    m_builder.blockBuilder().attach(parent, WTFMove(child), beforeChildOrPlaceholder);
 }
 
-void RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo(RenderBlockFlow& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion normalizeAfterInsertion)
+void RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats(RenderBlockFlow& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    m_builder.moveAllChildrenTo(from, to, normalizeAfterInsertion);
+    m_builder.moveAllChildren(from, to, normalizeAfterInsertion);
     from.addFloatsToNewParent(downcast<RenderBlockFlow>(to));
 }
 
index fcc1c9e..6859851 100644 (file)
@@ -33,8 +33,8 @@ class RenderTreeBuilder::BlockFlow {
 public:
     BlockFlow(RenderTreeBuilder&);
 
-    void insertChild(RenderBlockFlow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void moveAllChildrenIncludingFloatsTo(RenderBlockFlow& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion);
+    void attach(RenderBlockFlow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void moveAllChildrenIncludingFloats(RenderBlockFlow& from, RenderBlock& to, RenderTreeBuilder::NormalizeAfterInsertion);
 
 private:
     RenderTreeBuilder& m_builder;
index 8d3cadc..c4ca3a6 100644 (file)
@@ -44,7 +44,7 @@ void RenderTreeBuilder::Continuation::cleanupOnDestroy(RenderBoxModelObject& ren
     ASSERT(renderer.continuationChainNode());
     auto& continuationChainNode = *renderer.continuationChainNode();
     while (continuationChainNode.next)
-        m_builder.removeAndDestroy(*continuationChainNode.next->renderer);
+        m_builder.destroy(*continuationChainNode.next->renderer);
     renderer.removeFromContinuationChain();
 }
 
index 9280dec..a5c1cbb 100644 (file)
@@ -155,7 +155,7 @@ void RenderTreeBuilder::FirstLetter::cleanupOnDestroy(RenderTextFragment& textFr
 {
     if (!textFragment.firstLetter())
         return;
-    m_builder.removeAndDestroy(*textFragment.firstLetter());
+    m_builder.destroy(*textFragment.firstLetter());
 }
 
 void RenderTreeBuilder::FirstLetter::updateStyle(RenderBlock& firstLetterBlock, RenderObject& currentChild)
@@ -181,8 +181,8 @@ void RenderTreeBuilder::FirstLetter::updateStyle(RenderBlock& firstLetterBlock,
         while (RenderObject* child = firstLetter->firstChild()) {
             if (is<RenderText>(*child))
                 downcast<RenderText>(*child).removeAndDestroyTextBoxes();
-            auto toMove = m_builder.takeChild(*firstLetter, *child);
-            m_builder.insertChild(*newFirstLetter, WTFMove(toMove));
+            auto toMove = m_builder.detach(*firstLetter, *child);
+            m_builder.attach(*newFirstLetter, WTFMove(toMove));
         }
 
         RenderObject* nextSibling = firstLetter->nextSibling();
@@ -192,8 +192,8 @@ void RenderTreeBuilder::FirstLetter::updateStyle(RenderBlock& firstLetterBlock,
             remainingText->setFirstLetter(*newFirstLetter);
             newFirstLetter->setFirstLetterRemainingText(*remainingText);
         }
-        m_builder.removeAndDestroy(*firstLetter);
-        m_builder.insertChild(*firstLetterContainer, WTFMove(newFirstLetter), nextSibling);
+        m_builder.destroy(*firstLetter);
+        m_builder.attach(*firstLetterContainer, WTFMove(newFirstLetter), nextSibling);
         return;
     }
 
@@ -213,7 +213,7 @@ void RenderTreeBuilder::FirstLetter::createRenderers(RenderBlock& firstLetterBlo
     newFirstLetter->setIsFirstLetter();
 
     auto& firstLetter = *newFirstLetter;
-    m_builder.insertChild(*firstLetterContainer, WTFMove(newFirstLetter), &currentTextChild);
+    m_builder.attach(*firstLetterContainer, WTFMove(newFirstLetter), &currentTextChild);
 
     // The original string is going to be either a generated content string or a DOM node's
     // string. We want the original string before it got transformed in case first-letter has
@@ -248,7 +248,7 @@ void RenderTreeBuilder::FirstLetter::createRenderers(RenderBlock& firstLetterBlo
 
         auto* textNode = currentTextChild.textNode();
         auto* beforeChild = currentTextChild.nextSibling();
-        m_builder.removeAndDestroy(currentTextChild);
+        m_builder.destroy(currentTextChild);
 
         // Construct a text fragment for the text after the first letter.
         // This text fragment might be empty.
@@ -260,14 +260,14 @@ void RenderTreeBuilder::FirstLetter::createRenderers(RenderBlock& firstLetterBlo
             newRemainingText = createRenderer<RenderTextFragment>(firstLetterBlock.document(), oldText, length, oldText.length() - length);
 
         RenderTextFragment& remainingText = *newRemainingText;
-        m_builder.insertChild(*firstLetterContainer, WTFMove(newRemainingText), beforeChild);
+        m_builder.attach(*firstLetterContainer, WTFMove(newRemainingText), beforeChild);
         remainingText.setFirstLetter(firstLetter);
         firstLetter.setFirstLetterRemainingText(remainingText);
 
         // construct text fragment for the first letter
         auto letter = createRenderer<RenderTextFragment>(firstLetterBlock.document(), oldText, 0, length);
 
-        m_builder.insertChild(firstLetter, WTFMove(letter));
+        m_builder.attach(firstLetter, WTFMove(letter));
     }
 }
 
index a489532..827c8bb 100644 (file)
@@ -36,34 +36,34 @@ RenderTreeBuilder::FormControls::FormControls(RenderTreeBuilder& builder)
 {
 }
 
-void RenderTreeBuilder::FormControls::insertChild(RenderButton& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::FormControls::attach(RenderButton& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
-    m_builder.blockBuilder().insertChild(findOrCreateParentForChild(parent), WTFMove(child), beforeChild);
+    m_builder.blockBuilder().attach(findOrCreateParentForChild(parent), WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::FormControls::insertChild(RenderMenuList& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::FormControls::attach(RenderMenuList& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& newChild = *child.get();
-    m_builder.blockBuilder().insertChild(findOrCreateParentForChild(parent), WTFMove(child), beforeChild);
-    parent.didInsertChild(newChild, beforeChild);
+    m_builder.blockBuilder().attach(findOrCreateParentForChild(parent), WTFMove(child), beforeChild);
+    parent.didAttachChild(newChild, beforeChild);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::FormControls::takeChild(RenderMenuList& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::FormControls::detach(RenderMenuList& parent, RenderObject& child)
 {
     auto* innerRenderer = parent.innerRenderer();
     if (!innerRenderer || &child == innerRenderer)
-        return m_builder.blockBuilder().takeChild(parent, child);
-    return m_builder.takeChild(*innerRenderer, child);
+        return m_builder.blockBuilder().detach(parent, child);
+    return m_builder.detach(*innerRenderer, child);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::FormControls::takeChild(RenderButton& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::FormControls::detach(RenderButton& parent, RenderObject& child)
 {
     auto* innerRenderer = parent.innerRenderer();
     if (!innerRenderer || &child == innerRenderer || child.parent() == &parent) {
         ASSERT(&child == innerRenderer || !innerRenderer);
-        return m_builder.blockBuilder().takeChild(parent, child);
+        return m_builder.blockBuilder().detach(parent, child);
     }
-    return m_builder.takeChild(*innerRenderer, child);
+    return m_builder.detach(*innerRenderer, child);
 }
 
 
@@ -75,7 +75,7 @@ RenderBlock& RenderTreeBuilder::FormControls::findOrCreateParentForChild(RenderB
 
     auto wrapper = parent.createAnonymousBlock(parent.style().display());
     innerRenderer = wrapper.get();
-    m_builder.blockBuilder().insertChild(parent, WTFMove(wrapper), nullptr);
+    m_builder.blockBuilder().attach(parent, WTFMove(wrapper), nullptr);
     parent.setInnerRenderer(*innerRenderer);
     return *innerRenderer;
 }
@@ -88,7 +88,7 @@ RenderBlock& RenderTreeBuilder::FormControls::findOrCreateParentForChild(RenderM
 
     auto wrapper = parent.createAnonymousBlock();
     innerRenderer = wrapper.get();
-    m_builder.blockBuilder().insertChild(parent, WTFMove(wrapper), nullptr);
+    m_builder.blockBuilder().attach(parent, WTFMove(wrapper), nullptr);
     parent.setInnerRenderer(*innerRenderer);
     return *innerRenderer;
 }
index 8f26f47..c2606f3 100644 (file)
@@ -37,11 +37,11 @@ class RenderTreeBuilder::FormControls {
 public:
     FormControls(RenderTreeBuilder&);
 
-    void insertChild(RenderButton& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderMenuList& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderButton& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderMenuList& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
-    RenderPtr<RenderObject> takeChild(RenderButton& parent, RenderObject& child) WARN_UNUSED_RETURN;
-    RenderPtr<RenderObject> takeChild(RenderMenuList& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderButton& parent, RenderObject& child) WARN_UNUSED_RETURN;
+    RenderPtr<RenderObject> detach(RenderMenuList& parent, RenderObject& child) WARN_UNUSED_RETURN;
 
 private:
     RenderBlock& findOrCreateParentForChild(RenderButton&);
index cbc59ac..6b9a3f0 100644 (file)
@@ -41,7 +41,7 @@ void RenderTreeBuilder::FullScreen::cleanupOnDestroy(RenderFullScreen& fullScree
 {
     if (!fullScreenRenderer.placeholder())
         return;
-    m_builder.removeAndDestroy(*fullScreenRenderer.placeholder());
+    m_builder.destroy(*fullScreenRenderer.placeholder());
 }
 
 }
index 2c5d269..9f2631d 100644 (file)
@@ -102,7 +102,7 @@ RenderTreeBuilder::Inline::Inline(RenderTreeBuilder& builder)
 {
 }
 
-void RenderTreeBuilder::Inline::insertChild(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Inline::attach(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto* beforeChildOrPlaceholder = beforeChild;
     if (auto* fragmentedFlow = parent.enclosingFragmentedFlow())
@@ -111,7 +111,7 @@ void RenderTreeBuilder::Inline::insertChild(RenderInline& parent, RenderPtr<Rend
         insertChildToContinuation(parent, WTFMove(child), beforeChildOrPlaceholder);
         return;
     }
-    insertChildIgnoringContinuation(parent, WTFMove(child), beforeChildOrPlaceholder);
+    attachIgnoringContinuation(parent, WTFMove(child), beforeChildOrPlaceholder);
 }
 
 void RenderTreeBuilder::Inline::insertChildToContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
@@ -139,23 +139,23 @@ void RenderTreeBuilder::Inline::insertChildToContinuation(RenderInline& parent,
         ASSERT_NOT_REACHED();
 
     if (child->isFloatingOrOutOfFlowPositioned())
-        return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
+        return m_builder.attachIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
 
     if (flow == beforeChildAncestor)
-        return m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child), beforeChild);
+        return m_builder.attachIgnoringContinuation(*flow, WTFMove(child), beforeChild);
     // A continuation always consists of two potential candidates: an inline or an anonymous
     // block box holding block children.
     bool childInline = newChildIsInline(parent, *child);
     // The goal here is to match up if we can, so that we can coalesce and create the
     // minimal # of continuations needed for the inline.
     if (childInline == beforeChildAncestor->isInline())
-        return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
+        return m_builder.attachIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
     if (flow->isInline() == childInline)
-        return m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
-    return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
+        return m_builder.attachIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
+    return m_builder.attachIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::Inline::insertChildIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Inline::attachIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     // Make sure we don't append things after :after-generated content if we have it.
     if (!beforeChild && parent.isAfterContent(parent.lastChild()))
@@ -188,7 +188,7 @@ void RenderTreeBuilder::Inline::insertChildIgnoringContinuation(RenderInline& pa
     }
 
     auto& childToAdd = *child;
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
     childToAdd.setNeedsLayoutAndPrefWidthsRecalc();
 }
 
@@ -225,9 +225,9 @@ void RenderTreeBuilder::Inline::splitFlow(RenderInline& parent, RenderObject* be
 
     RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
     if (createdPre)
-        m_builder.insertChildToRenderElementInternal(*block, WTFMove(createdPre), boxFirst);
-    m_builder.insertChildToRenderElementInternal(*block, WTFMove(newBlockBox), boxFirst);
-    m_builder.insertChildToRenderElementInternal(*block, WTFMove(createdPost), boxFirst);
+        m_builder.attachToRenderElementInternal(*block, WTFMove(createdPre), boxFirst);
+    m_builder.attachToRenderElementInternal(*block, WTFMove(newBlockBox), boxFirst);
+    m_builder.attachToRenderElementInternal(*block, WTFMove(createdPost), boxFirst);
     block->setChildrenInline(false);
 
     if (madeNewBeforeBlock) {
@@ -235,8 +235,8 @@ void RenderTreeBuilder::Inline::splitFlow(RenderInline& parent, RenderObject* be
         while (o) {
             RenderObject* no = o;
             o = no->nextSibling();
-            auto childToMove = m_builder.takeChildFromRenderElement(*block, *no);
-            m_builder.insertChildToRenderElementInternal(*pre, WTFMove(childToMove));
+            auto childToMove = m_builder.detachFromRenderElement(*block, *no);
+            m_builder.attachToRenderElementInternal(*pre, WTFMove(childToMove));
             no->setNeedsLayoutAndPrefWidthsRecalc();
         }
     }
@@ -250,7 +250,7 @@ void RenderTreeBuilder::Inline::splitFlow(RenderInline& parent, RenderObject* be
     // We delayed adding the newChild until now so that the |newBlockBox| would be fully
     // connected, thus allowing newChild access to a renderArena should it need
     // to wrap itself in additional boxes (e.g., table construction).
-    m_builder.insertChild(addedBlockBox, WTFMove(child));
+    m_builder.attach(addedBlockBox, WTFMove(child));
 
     // Always just do a full layout in order to ensure that line boxes (especially wrappers for images)
     // get deleted properly. Because objects moves from the pre block into the post block, we want to
@@ -305,8 +305,8 @@ void RenderTreeBuilder::Inline::splitInlines(RenderInline& parent, RenderBlock*
             // FIXME: When the anonymous wrapper has multiple children, we end up traversing up to the topmost wrapper
             // every time, which is a bit wasteful.
         }
-        auto childToMove = m_builder.takeChildFromRenderElement(*rendererToMove->parent(), *rendererToMove);
-        m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(childToMove));
+        auto childToMove = m_builder.detachFromRenderElement(*rendererToMove->parent(), *rendererToMove);
+        m_builder.attachIgnoringContinuation(*cloneInline, WTFMove(childToMove));
         rendererToMove->setNeedsLayoutAndPrefWidthsRecalc();
         rendererToMove = nextSibling;
     }
@@ -334,7 +334,7 @@ void RenderTreeBuilder::Inline::splitInlines(RenderInline& parent, RenderBlock*
             cloneInline = cloneAsContinuation(downcast<RenderInline>(*current));
 
             // Insert our child clone as the first child.
-            m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(cloneChild));
+            m_builder.attachIgnoringContinuation(*cloneInline, WTFMove(cloneChild));
 
             // Hook the clone up as a continuation of |curr|.
             cloneInline->insertIntoContinuationChainAfter(*current);
@@ -343,8 +343,8 @@ void RenderTreeBuilder::Inline::splitInlines(RenderInline& parent, RenderBlock*
             // *after* currentChild and append them all to the clone.
             for (auto* sibling = currentChild->nextSibling(); sibling;) {
                 auto* next = sibling->nextSibling();
-                auto childToMove = m_builder.takeChildFromRenderElement(*current, *sibling);
-                m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(childToMove));
+                auto childToMove = m_builder.detachFromRenderElement(*current, *sibling);
+                m_builder.attachIgnoringContinuation(*cloneInline, WTFMove(childToMove));
                 sibling->setNeedsLayoutAndPrefWidthsRecalc();
                 sibling = next;
             }
@@ -361,14 +361,14 @@ void RenderTreeBuilder::Inline::splitInlines(RenderInline& parent, RenderBlock*
         cloneBlockChild.resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants();
 
     // Now we are at the block level. We need to put the clone into the toBlock.
-    m_builder.insertChildToRenderElementInternal(*toBlock, WTFMove(cloneInline));
+    m_builder.attachToRenderElementInternal(*toBlock, WTFMove(cloneInline));
 
     // Now take all the children after currentChild and remove them from the fromBlock
     // and put them in the toBlock.
     for (auto* current = currentChild->nextSibling(); current;) {
         auto* next = current->nextSibling();
-        auto childToMove = m_builder.takeChildFromRenderElement(*fromBlock, *current);
-        m_builder.insertChildToRenderElementInternal(*toBlock, WTFMove(childToMove));
+        auto childToMove = m_builder.detachFromRenderElement(*fromBlock, *current);
+        m_builder.attachToRenderElementInternal(*toBlock, WTFMove(childToMove));
         current = next;
     }
 }
@@ -389,7 +389,7 @@ void RenderTreeBuilder::Inline::childBecameNonInline(RenderInline& parent, Rende
         oldContinuation->removeFromContinuationChain();
     newBox->insertIntoContinuationChainAfter(parent);
     auto* beforeChild = child.nextSibling();
-    auto removedChild = m_builder.takeChildFromRenderElement(parent, child);
+    auto removedChild = m_builder.detachFromRenderElement(parent, child);
     splitFlow(parent, beforeChild, WTFMove(newBox), WTFMove(removedChild), oldContinuation);
 }
 
index 42b5c94..f4bf033 100644 (file)
@@ -33,8 +33,8 @@ class RenderTreeBuilder::Inline {
 public:
     Inline(RenderTreeBuilder&);
 
-    void insertChild(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChildIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attachIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
     // Make this private once all the mutation code is in RenderTreeBuilder.
     void childBecameNonInline(RenderInline& parent, RenderElement& child);
index 0c9aa86..a2efdc5 100644 (file)
@@ -80,7 +80,7 @@ void RenderTreeBuilder::List::updateItemMarker(RenderListItem& listItemRenderer)
 
     if (style.listStyleType() == NoneListStyle && (!style.listStyleImage() || style.listStyleImage()->errorOccurred())) {
         if (auto* marker = listItemRenderer.markerRenderer())
-            m_builder.removeAndDestroy(*marker);
+            m_builder.destroy(*marker);
         return;
     }
 
@@ -115,13 +115,13 @@ void RenderTreeBuilder::List::updateItemMarker(RenderListItem& listItemRenderer)
         return;
 
     if (currentParent)
-        m_builder.insertChild(*newParent, m_builder.takeChild(*currentParent, *markerRenderer), firstNonMarkerChild(*newParent));
+        m_builder.attach(*newParent, m_builder.detach(*currentParent, *markerRenderer), firstNonMarkerChild(*newParent));
     else
-        m_builder.insertChild(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
+        m_builder.attach(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
 
     // If current parent is an anonymous block that has lost all its children, destroy it.
     if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !downcast<RenderBlock>(*currentParent).continuation())
-        m_builder.removeAndDestroy(*currentParent);
+        m_builder.destroy(*currentParent);
 }
 
 }
index edd2be2..5cb478b 100644 (file)
@@ -48,14 +48,14 @@ RenderPtr<RenderMathMLFencedOperator> RenderTreeBuilder::MathML::createMathMLOpe
 void RenderTreeBuilder::MathML::makeFences(RenderMathMLFenced& parent)
 {
     auto openFence = createMathMLOperator(parent, parent.openingBrace(), MathMLOperatorDictionary::Prefix, MathMLOperatorDictionary::Fence);
-    m_builder.blockBuilder().insertChild(parent, WTFMove(openFence), parent.firstChild());
+    m_builder.blockBuilder().attach(parent, WTFMove(openFence), parent.firstChild());
 
     auto closeFence = createMathMLOperator(parent, parent.closingBrace(), MathMLOperatorDictionary::Postfix, MathMLOperatorDictionary::Fence);
     parent.setCloseFenceRenderer(*closeFence);
-    m_builder.blockBuilder().insertChild(parent, WTFMove(closeFence), nullptr);
+    m_builder.blockBuilder().attach(parent, WTFMove(closeFence), nullptr);
 }
 
-void RenderTreeBuilder::MathML::insertChild(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::MathML::attach(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     // make the fences if the render object is empty
     if (!parent.firstChild()) {
@@ -96,14 +96,14 @@ void RenderTreeBuilder::MathML::insertChild(RenderMathMLFenced& parent, RenderPt
 
     if (beforeChild) {
         // Adding |x| before an existing |y| e.g. in element (y) - first insert our new child |x|, then its separator, to get (x, y).
-        m_builder.blockBuilder().insertChild(parent, WTFMove(child), beforeChild);
+        m_builder.blockBuilder().attach(parent, WTFMove(child), beforeChild);
         if (separatorRenderer)
-            m_builder.blockBuilder().insertChild(parent, WTFMove(separatorRenderer), beforeChild);
+            m_builder.blockBuilder().attach(parent, WTFMove(separatorRenderer), beforeChild);
     } else {
         // Adding |y| at the end of an existing element e.g. (x) - insert the separator first before the closing fence, then |y|, to get (x, y).
         if (separatorRenderer)
-            m_builder.blockBuilder().insertChild(parent, WTFMove(separatorRenderer), parent.closeFenceRenderer());
-        m_builder.blockBuilder().insertChild(parent, WTFMove(child), parent.closeFenceRenderer());
+            m_builder.blockBuilder().attach(parent, WTFMove(separatorRenderer), parent.closeFenceRenderer());
+        m_builder.blockBuilder().attach(parent, WTFMove(child), parent.closeFenceRenderer());
     }
 }
 
index 9a5f4df..baf02e0 100644 (file)
@@ -37,7 +37,7 @@ class RenderTreeBuilder::MathML {
 public:
     MathML(RenderTreeBuilder&);
 
-    void insertChild(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
 private:
     void makeFences(RenderMathMLFenced& parent);
index 9bedab1..788f3c6 100644 (file)
@@ -161,23 +161,23 @@ 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).
-            auto spannerToReInsert = m_builder.takeChild(*spanner->parent(), *spanner);
-            m_builder.insertChild(spannerOriginalParent, WTFMove(spannerToReInsert));
+            auto spannerToReInsert = m_builder.detach(*spanner->parent(), *spanner);
+            m_builder.attach(spannerOriginalParent, WTFMove(spannerToReInsert));
         }
     }
 
     auto newFragmentedFlow = !flow.style().hasLinesClamp() ? WebCore::createRenderer<RenderMultiColumnFlow>(flow.document(), RenderStyle::createAnonymousStyleWithDisplay(flow.style(), BLOCK)) :  WebCore::createRenderer<RenderLinesClampFlow>(flow.document(), RenderStyle::createAnonymousStyleWithDisplay(flow.style(), BLOCK));
     newFragmentedFlow->initializeStyle();
     auto& fragmentedFlow = *newFragmentedFlow;
-    m_builder.blockBuilder().insertChild(flow, WTFMove(newFragmentedFlow), nullptr);
+    m_builder.blockBuilder().attach(flow, WTFMove(newFragmentedFlow), nullptr);
 
     // Reparent children preceding the fragmented flow into the fragmented flow.
-    m_builder.moveChildrenTo(flow, fragmentedFlow, flow.firstChild(), &fragmentedFlow, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+    m_builder.moveChildren(flow, fragmentedFlow, flow.firstChild(), &fragmentedFlow, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
     if (flow.isFieldset()) {
         // Keep legends out of the flow thread.
         for (auto& box : childrenOfType<RenderBox>(fragmentedFlow)) {
             if (box.isLegend())
-                m_builder.moveChildTo(fragmentedFlow, flow, box, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+                m_builder.move(fragmentedFlow, flow, box, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
         }
     }
 
@@ -185,7 +185,7 @@ void RenderTreeBuilder::MultiColumn::createFragmentedFlow(RenderBlockFlow& flow)
         // Keep the middle block out of the flow thread.
         for (auto& element : childrenOfType<RenderElement>(fragmentedFlow)) {
             if (!downcast<RenderLinesClampFlow>(fragmentedFlow).isChildAllowedInFragmentedFlow(flow, element))
-                m_builder.moveChildTo(fragmentedFlow, flow, element, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+                m_builder.move(fragmentedFlow, flow, element, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
         }
     }
 
@@ -209,16 +209,16 @@ 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();
-        parentAndSpannerList.append(std::make_pair(spannerOriginalParent, m_builder.takeChild(*spanner->parent(), *spanner)));
+        parentAndSpannerList.append(std::make_pair(spannerOriginalParent, m_builder.detach(*spanner->parent(), *spanner)));
     }
     while (auto* columnSet = multiColumnFlow.firstMultiColumnSet())
-        m_builder.removeAndDestroy(*columnSet);
+        m_builder.destroy(*columnSet);
 
     flow.clearMultiColumnFlow();
-    m_builder.moveAllChildrenTo(multiColumnFlow, flow, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
-    m_builder.removeAndDestroy(multiColumnFlow);
+    m_builder.moveAllChildren(multiColumnFlow, flow, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+    m_builder.destroy(multiColumnFlow);
     for (auto& parentAndSpanner : parentAndSpannerList)
-        m_builder.insertChild(*parentAndSpanner.first, WTFMove(parentAndSpanner.second));
+        m_builder.attach(*parentAndSpanner.first, WTFMove(parentAndSpanner.second));
 }
 
 
@@ -313,12 +313,12 @@ RenderObject* RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant(R
         // end flowing one column set and move to the next one.
         auto newPlaceholder = RenderMultiColumnSpannerPlaceholder::createAnonymous(flow, downcast<RenderBox>(descendant), container->style());
         auto& placeholder = *newPlaceholder;
-        m_builder.insertChild(*container, WTFMove(newPlaceholder), descendant.nextSibling());
-        auto takenDescendant = m_builder.takeChild(*container, descendant);
+        m_builder.attach(*container, WTFMove(newPlaceholder), descendant.nextSibling());
+        auto takenDescendant = m_builder.detach(*container, descendant);
 
         // This is a guard to stop an ancestor flow thread from processing the spanner.
         gShiftingSpanner = true;
-        m_builder.blockBuilder().insertChild(*multicolContainer, WTFMove(takenDescendant), insertBeforeMulticolChild);
+        m_builder.blockBuilder().attach(*multicolContainer, WTFMove(takenDescendant), insertBeforeMulticolChild);
         gShiftingSpanner = false;
 
         // The spanner has now been moved out from the flow thread, but we don't want to
@@ -355,7 +355,7 @@ RenderObject* RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant(R
     auto newSet = flow.createMultiColumnSet(RenderStyle::createAnonymousStyleWithDisplay(multicolContainer->style(), BLOCK));
     newSet->initializeStyle();
     auto& set = *newSet;
-    m_builder.blockBuilder().insertChild(*multicolContainer, WTFMove(newSet), insertBeforeMulticolChild);
+    m_builder.blockBuilder().attach(*multicolContainer, WTFMove(newSet), insertBeforeMulticolChild);
     flow.invalidateFragments();
 
     // We cannot handle immediate column set siblings at the moment (and there's no need for
@@ -372,13 +372,13 @@ void RenderTreeBuilder::MultiColumn::handleSpannerRemoval(RenderMultiColumnFlow&
 {
     // The placeholder may already have been removed, but if it hasn't, do so now.
     if (auto placeholder = flow.spannerMap().take(&downcast<RenderBox>(spanner)))
-        m_builder.removeAndDestroy(*placeholder);
+        m_builder.destroy(*placeholder);
 
     if (auto* next = spanner.nextSibling()) {
         if (auto* previous = spanner.previousSibling()) {
             if (previous->isRenderMultiColumnSet() && next->isRenderMultiColumnSet()) {
                 // Merge two sets that no longer will be separated by a spanner.
-                m_builder.removeAndDestroy(*next);
+                m_builder.destroy(*next);
                 previous->setNeedsLayout();
             }
         }
index f25b297..5185e24 100644 (file)
@@ -139,12 +139,12 @@ void RenderTreeBuilder::Ruby::moveInlineChildren(RenderRubyBase& from, RenderRub
         else {
             auto newToBlock = to.createAnonymousBlock();
             toBlock = newToBlock.get();
-            m_builder.insertChildToRenderElementInternal(to, WTFMove(newToBlock));
+            m_builder.attachToRenderElementInternal(to, WTFMove(newToBlock));
         }
     }
     ASSERT(toBlock);
     // Move our inline children into the target block we determined above.
-    m_builder.moveChildrenTo(from, *toBlock, from.firstChild(), beforeChild, RenderTreeBuilder::NormalizeAfterInsertion::No);
+    m_builder.moveChildren(from, *toBlock, from.firstChild(), beforeChild, RenderTreeBuilder::NormalizeAfterInsertion::No);
 }
 
 void RenderTreeBuilder::Ruby::moveBlockChildren(RenderRubyBase& from, RenderRubyBase& to, RenderObject* beforeChild)
@@ -164,12 +164,12 @@ void RenderTreeBuilder::Ruby::moveBlockChildren(RenderRubyBase& from, RenderRuby
         && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildThere->childrenInline()) {
         auto* anonBlockHere = downcast<RenderBlock>(firstChildHere);
         auto* anonBlockThere = downcast<RenderBlock>(lastChildThere);
-        m_builder.moveAllChildrenTo(*anonBlockHere, *anonBlockThere, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
+        m_builder.moveAllChildren(*anonBlockHere, *anonBlockThere, RenderTreeBuilder::NormalizeAfterInsertion::Yes);
         anonBlockHere->deleteLines();
-        m_builder.removeAndDestroy(*anonBlockHere);
+        m_builder.destroy(*anonBlockHere);
     }
     // Move all remaining children normally.
-    m_builder.moveChildrenTo(from, to, from.firstChild(), beforeChild, RenderTreeBuilder::NormalizeAfterInsertion::No);
+    m_builder.moveChildren(from, to, from.firstChild(), beforeChild, RenderTreeBuilder::NormalizeAfterInsertion::No);
 }
 
 void RenderTreeBuilder::Ruby::moveChildren(RenderRubyBase& from, RenderRubyBase& to)
@@ -194,14 +194,14 @@ void RenderTreeBuilder::Ruby::moveChildrenInternal(RenderRubyBase& from, RenderR
     to.setNeedsLayoutAndPrefWidthsRecalc();
 }
 
-void RenderTreeBuilder::Ruby::insertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Ruby::attach(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (child->isRubyText()) {
         if (!beforeChild) {
             // RenderRuby has already ascertained that we can add the child here.
             ASSERT(!parent.hasRubyText());
             // prepend ruby texts as first child
-            m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), parent.firstChild());
+            m_builder.blockFlowBuilder().attach(parent, WTFMove(child), parent.firstChild());
             return;
         }
         if (beforeChild->isRubyText()) {
@@ -212,15 +212,15 @@ void RenderTreeBuilder::Ruby::insertChild(RenderRubyRun& parent, RenderPtr<Rende
             RenderElement* ruby = parent.parent();
             ASSERT(isRuby(ruby));
             auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
-            m_builder.insertChild(*ruby, WTFMove(newRun), parent.nextSibling());
+            m_builder.attach(*ruby, WTFMove(newRun), parent.nextSibling());
             // Add the new ruby text and move the old one to the new run
             // Note: Doing it in this order and not using RenderRubyRun's methods,
             // in order to avoid automatic removal of the ruby run in case there is no
             // other child besides the old ruby text.
-            m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), beforeChild);
-            auto takenBeforeChild = m_builder.blockBuilder().takeChild(parent, *beforeChild);
+            m_builder.blockFlowBuilder().attach(parent, WTFMove(child), beforeChild);
+            auto takenBeforeChild = m_builder.blockBuilder().detach(parent, *beforeChild);
 
-            m_builder.insertChild(*newRun, WTFMove(takenBeforeChild));
+            m_builder.attach(*newRun, WTFMove(takenBeforeChild));
             return;
         }
         if (parent.hasRubyBase()) {
@@ -229,8 +229,8 @@ void RenderTreeBuilder::Ruby::insertChild(RenderRubyRun& parent, RenderPtr<Rende
             RenderElement* ruby = parent.parent();
             auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
             auto& run = *newRun;
-            m_builder.insertChild(*ruby, WTFMove(newRun), &parent);
-            m_builder.insertChild(run, WTFMove(child));
+            m_builder.attach(*ruby, WTFMove(newRun), &parent);
+            m_builder.attach(run, WTFMove(child));
             moveChildrenInternal(rubyBaseSafe(parent), rubyBaseSafe(run), beforeChild);
         }
         return;
@@ -239,7 +239,7 @@ void RenderTreeBuilder::Ruby::insertChild(RenderRubyRun& parent, RenderPtr<Rende
     // (append it instead if beforeChild is the ruby text)
     if (beforeChild && beforeChild->isRubyText())
         beforeChild = nullptr;
-    m_builder.insertChild(rubyBaseSafe(parent), WTFMove(child), beforeChild);
+    m_builder.attach(rubyBaseSafe(parent), WTFMove(child), beforeChild);
 }
 
 RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsBlock& parent, const RenderObject& child, RenderObject*& beforeChild)
@@ -254,7 +254,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsB
         if (!beforeBlock) {
             auto newBlock = createAnonymousRubyInlineBlock(parent);
             beforeBlock = newBlock.get();
-            m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newBlock), parent.firstChild());
+            m_builder.blockFlowBuilder().attach(parent, WTFMove(newBlock), parent.firstChild());
         }
         beforeChild = nullptr;
         return *beforeBlock;
@@ -269,7 +269,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsB
         if (!afterBlock) {
             auto newBlock = createAnonymousRubyInlineBlock(parent);
             afterBlock = newBlock.get();
-            m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newBlock), nullptr);
+            m_builder.blockFlowBuilder().attach(parent, WTFMove(newBlock), nullptr);
         }
         beforeChild = nullptr;
         return *afterBlock;
@@ -298,7 +298,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsB
     if (!lastRun || lastRun->hasRubyText()) {
         auto newRun = RenderRubyRun::staticCreateRubyRun(&parent);
         lastRun = newRun.get();
-        m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newRun), beforeChild);
+        m_builder.blockFlowBuilder().attach(parent, WTFMove(newRun), beforeChild);
     }
     beforeChild = nullptr;
     return *lastRun;
@@ -316,7 +316,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsI
         if (!beforeBlock) {
             auto newBlock = createAnonymousRubyInlineBlock(parent);
             beforeBlock = newBlock.get();
-            m_builder.inlineBuilder().insertChild(parent, WTFMove(newBlock), parent.firstChild());
+            m_builder.inlineBuilder().attach(parent, WTFMove(newBlock), parent.firstChild());
         }
         beforeChild = nullptr;
         return *beforeBlock;
@@ -331,7 +331,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsI
         if (!afterBlock) {
             auto newBlock = createAnonymousRubyInlineBlock(parent);
             afterBlock = newBlock.get();
-            m_builder.inlineBuilder().insertChild(parent, WTFMove(newBlock), nullptr);
+            m_builder.inlineBuilder().attach(parent, WTFMove(newBlock), nullptr);
         }
         beforeChild = nullptr;
         return *afterBlock;
@@ -360,7 +360,7 @@ RenderElement& RenderTreeBuilder::Ruby::findOrCreateParentForChild(RenderRubyAsI
     if (!lastRun || lastRun->hasRubyText()) {
         auto newRun = RenderRubyRun::staticCreateRubyRun(&parent);
         lastRun = newRun.get();
-        m_builder.inlineBuilder().insertChild(parent, WTFMove(newRun), beforeChild);
+        m_builder.inlineBuilder().attach(parent, WTFMove(newRun), beforeChild);
     }
     beforeChild = nullptr;
     return *lastRun;
@@ -372,12 +372,12 @@ RenderRubyBase& RenderTreeBuilder::Ruby::rubyBaseSafe(RenderRubyRun& rubyRun)
     if (!base) {
         auto newBase = rubyRun.createRubyBase();
         base = newBase.get();
-        m_builder.blockFlowBuilder().insertChild(rubyRun, WTFMove(newBase), nullptr);
+        m_builder.blockFlowBuilder().attach(rubyRun, WTFMove(newBase), nullptr);
     }
     return *base;
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsInline& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::Ruby::detach(RenderRubyAsInline& parent, RenderObject& child)
 {
     // If the child's parent is *this (must be a ruby run or generated content or anonymous block),
     // just use the normal remove method.
@@ -385,23 +385,23 @@ RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsInline& p
 #ifndef ASSERT_DISABLED
         ASSERT(isRubyChildForNormalRemoval(child));
 #endif
-        return m_builder.takeChildFromRenderElement(parent, child);
+        return m_builder.detachFromRenderElement(parent, child);
     }
     // If the child's parent is an anoymous block (must be generated :before/:after content)
     // just use the block's remove method.
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
-        auto takenChild = m_builder.takeChild(parent, child);
-        m_builder.removeAndDestroy(parent);
+        auto takenChild = m_builder.detach(parent, child);
+        m_builder.destroy(parent);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
-    return m_builder.takeChild(findRubyRunParent(child), child);
+    return m_builder.detach(findRubyRunParent(child), child);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsBlock& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::Ruby::detach(RenderRubyAsBlock& parent, RenderObject& child)
 {
     // If the child's parent is *this (must be a ruby run or generated content or anonymous block),
     // just use the normal remove method.
@@ -409,23 +409,23 @@ RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyAsBlock& pa
 #ifndef ASSERT_DISABLED
         ASSERT(isRubyChildForNormalRemoval(child));
 #endif
-        return m_builder.blockBuilder().takeChild(parent, child);
+        return m_builder.blockBuilder().detach(parent, child);
     }
     // If the child's parent is an anoymous block (must be generated :before/:after content)
     // just use the block's remove method.
     if (isAnonymousRubyInlineBlock(child.parent())) {
         ASSERT(child.isBeforeContent() || child.isAfterContent());
         auto& parent = *child.parent();
-        auto takenChild = m_builder.takeChild(parent, child);
-        m_builder.removeAndDestroy(parent);
+        auto takenChild = m_builder.detach(parent, child);
+        m_builder.destroy(parent);
         return takenChild;
     }
 
     // Otherwise find the containing run and remove it from there.
-    return m_builder.takeChild(findRubyRunParent(child), child);
+    return m_builder.detach(findRubyRunParent(child), child);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyRun& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::Ruby::detach(RenderRubyRun& parent, RenderObject& child)
 {
     // If the child is a ruby text, then merge the ruby base with the base of
     // the right sibling run, if possible.
@@ -439,21 +439,21 @@ RenderPtr<RenderObject> RenderTreeBuilder::Ruby::takeChild(RenderRubyRun& parent
                 RenderRubyBase* rightBase = rightRun.rubyBase();
                 // Collect all children in a single base, then swap the bases.
                 moveChildren(*rightBase, *base);
-                m_builder.moveChildTo(parent, rightRun, *base, RenderTreeBuilder::NormalizeAfterInsertion::No);
-                m_builder.moveChildTo(rightRun, parent, *rightBase, RenderTreeBuilder::NormalizeAfterInsertion::No);
+                m_builder.move(parent, rightRun, *base, RenderTreeBuilder::NormalizeAfterInsertion::No);
+                m_builder.move(rightRun, parent, *rightBase, RenderTreeBuilder::NormalizeAfterInsertion::No);
                 // The now empty ruby base will be removed below.
                 ASSERT(!parent.rubyBase()->firstChild());
             }
         }
     }
 
-    auto takenChild = m_builder.blockBuilder().takeChild(parent, child);
+    auto takenChild = m_builder.blockBuilder().detach(parent, child);
 
     if (!parent.beingDestroyed() && !parent.renderTreeBeingDestroyed()) {
         // Check if our base (if any) is now empty. If so, destroy it.
         RenderBlock* base = parent.rubyBase();
         if (base && !base->firstChild()) {
-            auto takenBase = m_builder.blockBuilder().takeChild(parent, *base);
+            auto takenBase = m_builder.blockBuilder().detach(parent, *base);
             base->deleteLines();
         }
     }
index cb83d95..7ec9bfe 100644 (file)
@@ -41,10 +41,10 @@ class RenderTreeBuilder::Ruby {
 public:
     Ruby(RenderTreeBuilder&);
 
-    void insertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    RenderPtr<RenderObject> takeChild(RenderRubyAsInline& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderRubyAsBlock& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderRubyRun& parent, RenderObject& child);
+    void attach(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    RenderPtr<RenderObject> detach(RenderRubyAsInline& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderRubyAsBlock& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderRubyRun& parent, RenderObject& child);
 
     void moveChildren(RenderRubyBase& from, RenderRubyBase& to);
 
index 6a220da..27874b2 100644 (file)
@@ -40,75 +40,75 @@ RenderTreeBuilder::SVG::SVG(RenderTreeBuilder& builder)
 {
 }
 
-void RenderTreeBuilder::SVG::insertChild(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::SVG::attach(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& childToAdd = *child;
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
     SVGResourcesCache::clientWasAddedToTree(childToAdd);
 }
 
-void RenderTreeBuilder::SVG::insertChild(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::SVG::attach(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& childToAdd = *child;
-    m_builder.inlineBuilder().insertChild(parent, WTFMove(child), beforeChild);
+    m_builder.inlineBuilder().attach(parent, WTFMove(child), beforeChild);
     SVGResourcesCache::clientWasAddedToTree(childToAdd);
 
     if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(parent))
         textAncestor->subtreeChildWasAdded(&childToAdd);
 }
 
-void RenderTreeBuilder::SVG::insertChild(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::SVG::attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& childToAdd = *child;
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
     SVGResourcesCache::clientWasAddedToTree(childToAdd);
 }
 
-void RenderTreeBuilder::SVG::insertChild(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::SVG::attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     auto& childToAdd = *child;
-    m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), beforeChild);
+    m_builder.blockFlowBuilder().attach(parent, WTFMove(child), beforeChild);
 
     SVGResourcesCache::clientWasAddedToTree(childToAdd);
     parent.subtreeChildWasAdded(&childToAdd);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::SVG::takeChild(RenderSVGText& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGText& parent, RenderObject& child)
 {
     SVGResourcesCache::clientWillBeRemovedFromTree(child);
 
     Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
     parent.subtreeChildWillBeRemoved(&child, affectedAttributes);
-    auto takenChild = m_builder.blockBuilder().takeChild(parent, child);
+    auto takenChild = m_builder.blockBuilder().detach(parent, child);
     parent.subtreeChildWasRemoved(affectedAttributes);
     return takenChild;
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::SVG::takeChild(RenderSVGInline& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGInline& parent, RenderObject& child)
 {
     SVGResourcesCache::clientWillBeRemovedFromTree(child);
 
     auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(parent);
     if (!textAncestor)
-        return m_builder.takeChildFromRenderElement(parent, child);
+        return m_builder.detachFromRenderElement(parent, child);
 
     Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
     textAncestor->subtreeChildWillBeRemoved(&child, affectedAttributes);
-    auto takenChild = m_builder.takeChildFromRenderElement(parent, child);
+    auto takenChild = m_builder.detachFromRenderElement(parent, child);
     textAncestor->subtreeChildWasRemoved(affectedAttributes);
     return takenChild;
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::SVG::takeChild(RenderSVGContainer& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGContainer& parent, RenderObject& child)
 {
     SVGResourcesCache::clientWillBeRemovedFromTree(child);
-    return m_builder.takeChildFromRenderElement(parent, child);
+    return m_builder.detachFromRenderElement(parent, child);
 }
 
-RenderPtr<RenderObject> RenderTreeBuilder::SVG::takeChild(RenderSVGRoot& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGRoot& parent, RenderObject& child)
 {
     SVGResourcesCache::clientWillBeRemovedFromTree(child);
-    return m_builder.takeChildFromRenderElement(parent, child);
+    return m_builder.detachFromRenderElement(parent, child);
 }
 
 }
index 7437c65..1dc9e30 100644 (file)
@@ -38,15 +38,15 @@ class RenderTreeBuilder::SVG {
 public:
     SVG(RenderTreeBuilder&);
 
-    void insertChild(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-
-    RenderPtr<RenderObject> takeChild(RenderSVGText& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderSVGInline& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderSVGContainer& parent, RenderObject& child);
-    RenderPtr<RenderObject> takeChild(RenderSVGRoot& parent, RenderObject& child);
+    void attach(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+
+    RenderPtr<RenderObject> detach(RenderSVGText& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child);
+    RenderPtr<RenderObject> detach(RenderSVGRoot& parent, RenderObject& child);
 
 private:
     RenderTreeBuilder& m_builder;
index c704fe8..c6ac808 100644 (file)
@@ -70,7 +70,7 @@ RenderElement& RenderTreeBuilder::Table::findOrCreateParentForChild(RenderTableR
                 if (is<RenderTableRow>(*lastChildParent)) {
                     auto newCell = RenderTableCell::createAnonymousWithParentRenderer(parent);
                     auto& cell = *newCell;
-                    m_builder.insertChild(*lastChildParent, WTFMove(newCell), beforeChild);
+                    m_builder.attach(*lastChildParent, WTFMove(newCell), beforeChild);
                     beforeChild = nullptr;
                     return cell;
                 }
@@ -79,7 +79,7 @@ RenderElement& RenderTreeBuilder::Table::findOrCreateParentForChild(RenderTableR
     }
     auto newCell = RenderTableCell::createAnonymousWithParentRenderer(parent);
     auto& cell = *newCell;
-    m_builder.insertChild(parent, WTFMove(newCell), beforeChild);
+    m_builder.attach(parent, WTFMove(newCell), beforeChild);
     beforeChild = nullptr;
     return cell;
 }
@@ -114,7 +114,7 @@ RenderElement& RenderTreeBuilder::Table::findOrCreateParentForChild(RenderTableS
 
     auto newRow = RenderTableRow::createAnonymousWithParentRenderer(parent);
     auto& row = *newRow;
-    m_builder.insertChild(parent, WTFMove(newRow), beforeChild);
+    m_builder.attach(parent, WTFMove(newRow), beforeChild);
     beforeChild = nullptr;
     return row;
 }
@@ -156,25 +156,25 @@ RenderElement& RenderTreeBuilder::Table::findOrCreateParentForChild(RenderTable&
 
     auto newSection = RenderTableSection::createAnonymousWithParentRenderer(parent);
     auto& section = *newSection;
-    m_builder.insertChild(parent, WTFMove(newSection), beforeChild);
+    m_builder.attach(parent, WTFMove(newSection), beforeChild);
     beforeChild = nullptr;
     return section;
 }
 
-void RenderTreeBuilder::Table::insertChild(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Table::attach(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (beforeChild && beforeChild->parent() != &parent)
         beforeChild = m_builder.splitAnonymousBoxesAroundChild(parent, beforeChild);
 
     auto& newChild = *child.get();
     ASSERT(!beforeChild || is<RenderTableCell>(*beforeChild));
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
     // FIXME: child should always be a RenderTableCell at this point.
     if (is<RenderTableCell>(newChild))
         parent.didInsertTableCell(downcast<RenderTableCell>(newChild), beforeChild);
 }
 
-void RenderTreeBuilder::Table::insertChild(RenderTableSection& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Table::attach(RenderTableSection& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (beforeChild && beforeChild->parent() != &parent)
         beforeChild = m_builder.splitAnonymousBoxesAroundChild(parent, beforeChild);
@@ -183,10 +183,10 @@ void RenderTreeBuilder::Table::insertChild(RenderTableSection& parent, RenderPtr
     if (is<RenderTableRow>(*child.get()))
         parent.willInsertTableRow(downcast<RenderTableRow>(*child.get()), beforeChild);
     ASSERT(!beforeChild || is<RenderTableRow>(*beforeChild));
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::Table::insertChild(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::Table::attach(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     if (beforeChild && beforeChild->parent() != &parent)
         beforeChild = m_builder.splitAnonymousBoxesAroundChild(parent, beforeChild);
@@ -197,7 +197,7 @@ void RenderTreeBuilder::Table::insertChild(RenderTable& parent, RenderPtr<Render
     else if (is<RenderTableCol>(newChild))
         parent.willInsertTableColumn(downcast<RenderTableCol>(newChild), beforeChild);
 
-    m_builder.insertChildToRenderElement(parent, WTFMove(child), beforeChild);
+    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
 }
 
 bool RenderTreeBuilder::Table::childRequiresTable(const RenderElement& parent, const RenderObject& child)
@@ -248,8 +248,8 @@ void RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows(RenderTabl
             currentRow = currentRow->nextRow();
             continue;
         }
-        m_builder.moveAllChildrenTo(*currentRow, *rowToInsertInto, RenderTreeBuilder::NormalizeAfterInsertion::No);
-        auto toDestroy = m_builder.takeChild(*section, *currentRow);
+        m_builder.moveAllChildren(*currentRow, *rowToInsertInto, RenderTreeBuilder::NormalizeAfterInsertion::No);
+        auto toDestroy = m_builder.detach(*section, *currentRow);
         currentRow = currentRow->nextRow();
     }
     if (rowToInsertInto)
index 0e0c3e7..1a11ef2 100644 (file)
@@ -44,9 +44,9 @@ public:
     RenderElement& findOrCreateParentForChild(RenderTableSection& parent, const RenderObject& child, RenderObject*& beforeChild);
     RenderElement& findOrCreateParentForChild(RenderTable& parent, const RenderObject& child, RenderObject*& beforeChild);
 
-    void insertChild(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderTableSection& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-    void insertChild(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderTableSection& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+    void attach(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
 
     bool childRequiresTable(const RenderElement& parent, const RenderObject& child);
 
index e824483..670648a 100644 (file)
@@ -383,7 +383,7 @@ void RenderTreeUpdater::createRenderer(Element& element, RenderStyle&& style)
     }
 #endif
 
-    m_builder.insertChild(insertionPosition, WTFMove(newRenderer));
+    m_builder.attach(insertionPosition, WTFMove(newRenderer));
 
     if (AXObjectCache* cache = m_document.axObjectCache())
         cache->updateCacheAfterNodeIsAttached(&element);
@@ -457,14 +457,14 @@ void RenderTreeUpdater::createTextRenderer(Text& textNode, const Style::TextUpda
         auto newDisplayContentsAnonymousWrapper = WebCore::createRenderer<RenderInline>(textNode.document(), RenderStyle::clone(**textUpdate->inheritedDisplayContentsStyle));
         newDisplayContentsAnonymousWrapper->initializeStyle();
         auto& displayContentsAnonymousWrapper = *newDisplayContentsAnonymousWrapper;
-        m_builder.insertChild(renderTreePosition, WTFMove(newDisplayContentsAnonymousWrapper));
+        m_builder.attach(renderTreePosition, WTFMove(newDisplayContentsAnonymousWrapper));
 
         textRenderer->setInlineWrapperForDisplayContents(&displayContentsAnonymousWrapper);
-        m_builder.insertChild(displayContentsAnonymousWrapper, WTFMove(textRenderer));
+        m_builder.attach(displayContentsAnonymousWrapper, WTFMove(textRenderer));
         return;
     }
 
-    m_builder.insertChild(renderTreePosition, WTFMove(textRenderer));
+    m_builder.attach(renderTreePosition, WTFMove(textRenderer));
 }
 
 void RenderTreeUpdater::updateTextRenderer(Text& text, const Style::TextUpdate* textUpdate)
@@ -551,7 +551,7 @@ void RenderTreeUpdater::tearDownRenderers(Element& root, TeardownType teardownTy
             GeneratedContent::removeAfterPseudoElement(element);
 
             if (auto* renderer = element.renderer()) {
-                RenderTreeBuilder::current()->removeFromParentAndDestroyCleaningUpAnonymousWrappers(*renderer);
+                RenderTreeBuilder::current()->destroyAndCleanUpAnonymousWrappers(*renderer);
                 element.setRenderer(nullptr);
             }
 
@@ -588,7 +588,7 @@ void RenderTreeUpdater::tearDownTextRenderer(Text& text)
     auto* renderer = text.renderer();
     if (!renderer)
         return;
-    RenderTreeBuilder::current()->removeFromParentAndDestroyCleaningUpAnonymousWrappers(*renderer);
+    RenderTreeBuilder::current()->destroyAndCleanUpAnonymousWrappers(*renderer);
     text.setRenderer(nullptr);
 }
 
@@ -599,7 +599,7 @@ void RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded(Element& roo
     for (auto* child = root.document().renderView()->firstChild(); child;) {
         auto* nextSibling = child->nextSibling();
         if (is<RenderMultiColumnFlow>(*child) || is<RenderMultiColumnSet>(*child))
-            RenderTreeBuilder::current()->removeFromParentAndDestroyCleaningUpAnonymousWrappers(*child);
+            RenderTreeBuilder::current()->destroyAndCleanUpAnonymousWrappers(*child);
         child = nextSibling;
     }
 }
index 8b7058e..392b10f 100644 (file)
@@ -75,7 +75,7 @@ static void createContentRenderers(RenderTreeBuilder& builder, RenderElement& ps
     for (const ContentData* content = style.contentData(); content; content = content->next()) {
         auto child = content->createContentRenderer(pseudoRenderer.document(), style);
         if (pseudoRenderer.isChildAllowed(*child, style))
-            builder.insertChild(pseudoRenderer, WTFMove(child));
+            builder.attach(pseudoRenderer, WTFMove(child));
     }
 }