Title: [224933] trunk/Source/WebCore
Revision
224933
Author
[email protected]
Date
2017-11-16 12:26:37 -0800 (Thu, 16 Nov 2017)

Log Message

Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
https://bugs.webkit.org/show_bug.cgi?id=178007

Reviewed by Antti Koivisto.

Based on Antti Koivisto's patch:
These call are currently skipped in some cases making them bug prone and difficult to reason about.
This is done as an optimization that doesn't appear to be valuable anymore.

Covered by existing tests.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::makeChildrenNonInline):
(WebCore::RenderBlock::dropAnonymousBoxChild):
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::splitAnonymousBoxesAroundChild):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveAllChildrenTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
(WebCore::RenderElement::takeChild):
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
(WebCore::RenderElement::handleDynamicFloatPositionChange):
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::splitFlow):
(WebCore::RenderInline::childBecameNonInline):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveInlineChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows):
* style/RenderTreeUpdaterMultiColumn.cpp:
(WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224932 => 224933)


--- trunk/Source/WebCore/ChangeLog	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/ChangeLog	2017-11-16 20:26:37 UTC (rev 224933)
@@ -1,3 +1,59 @@
+2017-11-16  Zalan Bujtas  <[email protected]>
+
+        Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
+        https://bugs.webkit.org/show_bug.cgi?id=178007
+
+        Reviewed by Antti Koivisto.
+
+        Based on Antti Koivisto's patch:
+        These call are currently skipped in some cases making them bug prone and difficult to reason about.
+        This is done as an optimization that doesn't appear to be valuable anymore.
+
+        Covered by existing tests.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::makeChildrenNonInline):
+        (WebCore::RenderBlock::dropAnonymousBoxChild):
+        (WebCore::RenderBlock::takeChild):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::styleDidChange):
+        (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::moveChildTo):
+        (WebCore::RenderBoxModelObject::moveChildrenTo):
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::moveChildTo):
+        (WebCore::RenderBoxModelObject::moveAllChildrenTo):
+        (WebCore::RenderBoxModelObject::moveChildrenTo):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::addChild):
+        (WebCore::RenderElement::takeChild):
+        (WebCore::RenderElement::insertChildInternal):
+        (WebCore::RenderElement::takeChildInternal):
+        (WebCore::RenderElement::handleDynamicFloatPositionChange):
+        * rendering/RenderElement.h:
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::splitInlines):
+        (WebCore::RenderInline::splitFlow):
+        (WebCore::RenderInline::childBecameNonInline):
+        * rendering/RenderMultiColumnFlow.cpp:
+        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
+        * rendering/RenderRubyBase.cpp:
+        (WebCore::RenderRubyBase::moveInlineChildren):
+        (WebCore::RenderRubyBase::moveBlockChildren):
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::takeChild):
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows):
+        * style/RenderTreeUpdaterMultiColumn.cpp:
+        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
+        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
+
 2017-11-14  Dean Jackson  <[email protected]>
 
         Add a base class for HTMLCanvasElement and OffscreenCanvas

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -704,8 +704,8 @@
 
         auto newBlock = createAnonymousBlock();
         auto& block = *newBlock;
-        insertChildInternal(WTFMove(newBlock), inlineRunStart, NotifyChildren);
-        moveChildrenTo(&block, inlineRunStart, child);
+        insertChildInternal(WTFMove(newBlock), inlineRunStart);
+        moveChildrenTo(&block, inlineRunStart, child, RenderBoxModelObject::NormalizeAfterInsertion::No);
     }
 
 #ifndef NDEBUG
@@ -810,8 +810,8 @@
     setChildrenInline(child.childrenInline());
     RenderObject* nextSibling = child.nextSibling();
 
-    auto toBeDeleted = takeChildInternal(child, child.hasLayer() ? NotifyChildren : DontNotifyChildren);
-    child.moveAllChildrenTo(this, nextSibling, child.hasLayer());
+    auto toBeDeleted = takeChildInternal(child);
+    child.moveAllChildrenTo(this, nextSibling, RenderBoxModelObject::NormalizeAfterInsertion::No);
     // Delete the now-empty block's lines and nuke it.
     child.deleteLines();
 }
@@ -843,14 +843,12 @@
             // column span flag if it is set.
             ASSERT(!inlineChildrenBlock.continuation());
             // Cache this value as it might get changed in setStyle() call.
-            bool inlineChildrenBlockHasLayer = inlineChildrenBlock.hasLayer();
             inlineChildrenBlock.setStyle(RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
-            auto blockToMove = takeChildInternal(inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
+            auto blockToMove = takeChildInternal(inlineChildrenBlock);
             
             // Now just put the inlineChildrenBlock inside the blockChildrenBlock.
             RenderObject* beforeChild = prev == &inlineChildrenBlock ? blockChildrenBlock.firstChild() : nullptr;
-            blockChildrenBlock.insertChildInternal(WTFMove(blockToMove), beforeChild,
-                (inlineChildrenBlockHasLayer || blockChildrenBlock.hasLayer()) ? NotifyChildren : DontNotifyChildren);
+            blockChildrenBlock.insertChildInternal(WTFMove(blockToMove), beforeChild);
             next->setNeedsLayoutAndPrefWidthsRecalc();
             
             // inlineChildrenBlock got reparented to blockChildrenBlock, so it is no longer a child
@@ -862,7 +860,7 @@
         } else {
             // Take all the children out of the |next| block and put them in
             // the |prev| block.
-            nextBlock.moveAllChildrenIncludingFloatsTo(prevBlock, nextBlock.hasLayer() || prevBlock.hasLayer());
+            nextBlock.moveAllChildrenIncludingFloatsTo(prevBlock, RenderBoxModelObject::NormalizeAfterInsertion::No);
             
             // Delete the now-empty block's lines and nuke it.
             nextBlock.deleteLines();

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2017-11-16 20:26:37 UTC (rev 224933)
@@ -438,7 +438,7 @@
     virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
 
     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
-    virtual void moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, bool fullRemoveInsert) { moveAllChildrenTo(&toBlock, fullRemoveInsert); }
+    virtual void moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, RenderBoxModelObject::NormalizeAfterInsertion normalizeAfterInsertion) { moveAllChildrenTo(&toBlock, normalizeAfterInsertion); }
 
     void addChildToContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild);
     void addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild) override;

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -2026,7 +2026,7 @@
     // 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())
-        downcast<RenderBoxModelObject>(*parent()).moveChildTo(&downcast<RenderBoxModelObject>(*previousSibling()), this);
+        downcast<RenderBoxModelObject>(*parent()).moveChildTo(&downcast<RenderBoxModelObject>(*previousSibling()), this, RenderBoxModelObject::NormalizeAfterInsertion::No);
 
     if (diff >= StyleDifferenceRepaint) {
         // FIXME: This could use a cheaper style-only test instead of SimpleLineLayout::canUseFor.
@@ -2108,10 +2108,10 @@
     }
 }
 
-void RenderBlockFlow::moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, bool fullRemoveInsert)
+void RenderBlockFlow::moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, RenderBoxModelObject::NormalizeAfterInsertion normalizeAfterInsertion)
 {
     auto& toBlockFlow = downcast<RenderBlockFlow>(toBlock);
-    moveAllChildrenTo(&toBlockFlow, fullRemoveInsert);
+    moveAllChildrenTo(&toBlockFlow, normalizeAfterInsertion);
     addFloatsToNewParent(toBlockFlow);
 }
 

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.h	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h	2017-11-16 20:26:37 UTC (rev 224933)
@@ -475,7 +475,7 @@
     void paintInlineChildren(PaintInfo&, const LayoutPoint&) override;
     void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase = false) override;
 
-    void moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, bool fullRemoveInsert) override;
+    void moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, RenderBoxModelObject::NormalizeAfterInsertion) override;
     void repaintOverhangingFloats(bool paintAllDescendants) final;
     void clipOutFloatingObjects(RenderBlock&, const PaintInfo*, const LayoutPoint&, const LayoutSize&) override;
 

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -4937,8 +4937,8 @@
             // so that the table repainting logic knows the structure is dirty.
             // See for example RenderTableCell:clippedOverflowRectForRepaint.
             markBoxForRelayoutAfterSplit(*parentBox);
-            parentBox->insertChildInternal(WTFMove(newPostBox), boxToSplit.nextSibling(), NotifyChildren);
-            boxToSplit.moveChildrenTo(&postBox, beforeChild, nullptr, true);
+            parentBox->insertChildInternal(WTFMove(newPostBox), boxToSplit.nextSibling());
+            boxToSplit.moveChildrenTo(&postBox, beforeChild, nullptr, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
 
             markBoxForRelayoutAfterSplit(boxToSplit);
             markBoxForRelayoutAfterSplit(postBox);

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -2679,32 +2679,31 @@
         transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
 }
 
-void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert)
+void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
 {
-    // We assume that callers have cleared their positioned objects list for child moves (!fullRemoveInsert) so the
+    // 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.
-    ASSERT(!fullRemoveInsert || !is<RenderBlock>(*this) || !downcast<RenderBlock>(*this).hasPositionedObjects());
+    ASSERT(normalizeAfterInsertion == NormalizeAfterInsertion::No || !is<RenderBlock>(*this) || !downcast<RenderBlock>(*this).hasPositionedObjects());
 
     ASSERT(this == child->parent());
     ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
-    if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObject->isRenderInline())) {
+    if (normalizeAfterInsertion == NormalizeAfterInsertion::Yes && (toBoxModelObject->isRenderBlock() || toBoxModelObject->isRenderInline())) {
         // Takes care of adding the new child correctly if toBlock and fromBlock
         // have different kind of children (block vs inline).
-        auto childToMove = takeChildInternal(*child, NotifyChildren);
+        auto childToMove = takeChildInternal(*child);
         toBoxModelObject->addChild(WTFMove(childToMove), beforeChild);
     } else {
-        NotifyChildrenType notifyType = fullRemoveInsert ? NotifyChildren : DontNotifyChildren;
-        auto childToMove = takeChildInternal(*child, notifyType);
-        toBoxModelObject->insertChildInternal(WTFMove(childToMove), beforeChild, notifyType);
+        auto childToMove = takeChildInternal(*child);
+        toBoxModelObject->insertChildInternal(WTFMove(childToMove), beforeChild);
     }
 }
 
-void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert)
+void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, 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)
     // or when fullRemoveInsert is false.
-    if (fullRemoveInsert && is<RenderBlock>(*this)) {
+    if (normalizeAfterInsertion == NormalizeAfterInsertion::Yes && is<RenderBlock>(*this)) {
         downcast<RenderBlock>(*this).removePositionedObjects(nullptr);
         if (is<RenderBlockFlow>(*this))
             downcast<RenderBlockFlow>(*this).removeFloatingObjects();
@@ -2732,7 +2731,7 @@
                 nextSibling = nextSibling->nextSibling();
         }
 
-        moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
+        moveChildTo(toBoxModelObject, child, beforeChild, normalizeAfterInsertion);
         child = nextSibling;
     }
 }

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2017-11-16 20:26:37 UTC (rev 224933)
@@ -277,28 +277,28 @@
     void setFirstLetterRemainingText(RenderTextFragment&);
     void clearFirstLetterRemainingText();
 
-    // These functions are only used internally to manipulate the render tree structure via remove/insert/appendChildNode.
-    // Since they are typically called only to move objects around within anonymous blocks, the default for fullRemoveInsert is false rather than true.
-    void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert = false);
-    void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, bool fullRemoveInsert = false)
+    // NormalizeAfterInsertion::Yes ensures that the destination subtree is consistent after the insertion (anonymous wrappers etc).
+    enum class NormalizeAfterInsertion { No, Yes };
+    void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, NormalizeAfterInsertion);
+    void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, NormalizeAfterInsertion normalizeAfterInsertion)
     {
-        moveChildTo(toBoxModelObject, child, nullptr, fullRemoveInsert);
+        moveChildTo(toBoxModelObject, child, nullptr, normalizeAfterInsertion);
     }
-    void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, bool fullRemoveInsert = false)
+    void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, NormalizeAfterInsertion normalizeAfterInsertion)
     {
-        moveAllChildrenTo(toBoxModelObject, nullptr, fullRemoveInsert);
+        moveAllChildrenTo(toBoxModelObject, nullptr, normalizeAfterInsertion);
     }
-    void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* beforeChild, bool fullRemoveInsert = false)
+    void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* beforeChild, NormalizeAfterInsertion normalizeAfterInsertion)
     {
-        moveChildrenTo(toBoxModelObject, firstChild(), nullptr, beforeChild, fullRemoveInsert);
+        moveChildrenTo(toBoxModelObject, firstChild(), nullptr, 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* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, bool fullRemoveInsert = false)
+    void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, NormalizeAfterInsertion normalizeAfterInsertion)
     {
-        moveChildrenTo(toBoxModelObject, startChild, endChild, nullptr, fullRemoveInsert);
+        moveChildrenTo(toBoxModelObject, startChild, endChild, nullptr, normalizeAfterInsertion);
     }
-    void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
+    void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, NormalizeAfterInsertion);
 
     enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffectiveZoom };
     LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize, ScaleByEffectiveZoomOrNot) const;

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -491,7 +491,7 @@
 
         table->addChild(WTFMove(newChild));
     } else
-        insertChildInternal(WTFMove(newChild), beforeChild, NotifyChildren);
+        insertChildInternal(WTFMove(newChild), beforeChild);
 
     if (is<RenderText>(child))
         downcast<RenderText>(child).styleDidChange(StyleDifferenceEqual, nullptr);
@@ -512,7 +512,7 @@
 
 RenderPtr<RenderObject> RenderElement::takeChild(RenderObject& oldChild)
 {
-    return takeChildInternal(oldChild, NotifyChildren);
+    return takeChildInternal(oldChild);
 }
 
 void RenderElement::removeAndDestroyChild(RenderObject& oldChild)
@@ -529,7 +529,7 @@
     }
 }
 
-void RenderElement::insertChildInternal(RenderPtr<RenderObject> newChildPtr, RenderObject* beforeChild, NotifyChildrenType notifyChildren)
+void RenderElement::insertChildInternal(RenderPtr<RenderObject> newChildPtr, RenderObject* beforeChild)
 {
     RELEASE_ASSERT_WITH_MESSAGE(!view().frameView().layoutContext().layoutState(), "Layout must not mutate render tree");
 
@@ -567,8 +567,7 @@
 
     newChild->initializeFragmentedFlowStateOnInsertion();
     if (!renderTreeBeingDestroyed()) {
-        if (notifyChildren == NotifyChildren)
-            newChild->insertedIntoTree();
+        newChild->insertedIntoTree();
         if (is<RenderElement>(*newChild))
             RenderCounter::rendererSubtreeAttached(downcast<RenderElement>(*newChild));
     }
@@ -586,7 +585,7 @@
         newChild->setHasOutlineAutoAncestor();
 }
 
-RenderPtr<RenderObject> RenderElement::takeChildInternal(RenderObject& oldChild, NotifyChildrenType notifyChildren)
+RenderPtr<RenderObject> RenderElement::takeChildInternal(RenderObject& oldChild)
 {
     RELEASE_ASSERT_WITH_MESSAGE(!view().frameView().layoutContext().layoutState(), "Layout must not mutate render tree");
 
@@ -599,7 +598,7 @@
     // So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or
     // that a positioned child got yanked). We also repaint, so that the area exposed when the child
     // disappears gets repainted properly.
-    if (!renderTreeBeingDestroyed() && notifyChildren == NotifyChildren && oldChild.everHadLayout()) {
+    if (!renderTreeBeingDestroyed() && oldChild.everHadLayout()) {
         oldChild.setNeedsLayoutAndPrefWidthsRecalc();
         // We only repaint |oldChild| if we have a RenderLayer as its visual overflow may not be tracked by its parent.
         if (oldChild.isBody())
@@ -622,7 +621,7 @@
     if (!renderTreeBeingDestroyed() && oldChild.isSelectionBorder())
         frame().selection().setNeedsSelectionUpdate();
 
-    if (!renderTreeBeingDestroyed() && notifyChildren == NotifyChildren)
+    if (!renderTreeBeingDestroyed())
         oldChild.willBeRemovedFromTree();
 
     oldChild.resetFragmentedFlowStateOnRemoval();
@@ -957,9 +956,9 @@
             // An anonymous block must be made to wrap this inline.
             auto newBlock = downcast<RenderBlock>(*parent()).createAnonymousBlock();
             auto& block = *newBlock;
-            parent()->insertChildInternal(WTFMove(newBlock), this, RenderElement::NotifyChildren);
-            auto thisToMove = parent()->takeChildInternal(*this, RenderElement::NotifyChildren);
-            block.insertChildInternal(WTFMove(thisToMove), nullptr, RenderElement::NotifyChildren);
+            parent()->insertChildInternal(WTFMove(newBlock), this);
+            auto thisToMove = parent()->takeChildInternal(*this);
+            block.insertChildInternal(WTFMove(thisToMove), nullptr);
         }
     }
 }

Modified: trunk/Source/WebCore/rendering/RenderElement.h (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderElement.h	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2017-11-16 20:26:37 UTC (rev 224933)
@@ -99,9 +99,8 @@
     void moveLayers(RenderLayer* oldParent, RenderLayer* newParent);
     RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint, bool checkParent = true);
 
-    enum NotifyChildrenType { NotifyChildren, DontNotifyChildren };
-    void insertChildInternal(RenderPtr<RenderObject>, RenderObject* beforeChild, NotifyChildrenType);
-    RenderPtr<RenderObject> takeChildInternal(RenderObject&, NotifyChildrenType) WARN_UNUSED_RETURN;
+    void insertChildInternal(RenderPtr<RenderObject>, RenderObject* beforeChild);
+    RenderPtr<RenderObject> takeChildInternal(RenderObject&) WARN_UNUSED_RETURN;
 
     virtual RenderElement* hoverAncestor() const;
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -402,7 +402,7 @@
             // 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 = rendererToMove->parent()->takeChildInternal(*rendererToMove, NotifyChildren);
+        auto childToMove = rendererToMove->parent()->takeChildInternal(*rendererToMove);
         cloneInline->addChildIgnoringContinuation(WTFMove(childToMove));
         rendererToMove->setNeedsLayoutAndPrefWidthsRecalc();
         rendererToMove = nextSibling;
@@ -440,7 +440,7 @@
             // *after* currentChild and append them all to the clone.
             for (auto* sibling = currentChild->nextSibling(); sibling;) {
                 auto* next = sibling->nextSibling();
-                auto childToMove = current->takeChildInternal(*sibling, NotifyChildren);
+                auto childToMove = current->takeChildInternal(*sibling);
                 cloneInline->addChildIgnoringContinuation(WTFMove(childToMove));
                 sibling->setNeedsLayoutAndPrefWidthsRecalc();
                 sibling = next;
@@ -458,14 +458,14 @@
         cloneBlockChild.resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants();
 
     // Now we are at the block level. We need to put the clone into the toBlock.
-    toBlock->insertChildInternal(WTFMove(cloneInline), nullptr, NotifyChildren);
+    toBlock->insertChildInternal(WTFMove(cloneInline), nullptr);
 
     // 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 = fromBlock->takeChildInternal(*current, NotifyChildren);
-        toBlock->insertChildInternal(WTFMove(childToMove), nullptr, NotifyChildren);
+        auto childToMove = fromBlock->takeChildInternal(*current);
+        toBlock->insertChildInternal(WTFMove(childToMove), nullptr);
         current = next;
     }
 }
@@ -503,9 +503,9 @@
 
     RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
     if (createdPre)
-        block->insertChildInternal(WTFMove(createdPre), boxFirst, NotifyChildren);
-    block->insertChildInternal(WTFMove(newBlockBox), boxFirst, NotifyChildren);
-    block->insertChildInternal(WTFMove(createdPost), boxFirst, NotifyChildren);
+        block->insertChildInternal(WTFMove(createdPre), boxFirst);
+    block->insertChildInternal(WTFMove(newBlockBox), boxFirst);
+    block->insertChildInternal(WTFMove(createdPost), boxFirst);
     block->setChildrenInline(false);
     
     if (madeNewBeforeBlock) {
@@ -513,8 +513,8 @@
         while (o) {
             RenderObject* no = o;
             o = no->nextSibling();
-            auto childToMove = block->takeChildInternal(*no, NotifyChildren);
-            pre->insertChildInternal(WTFMove(childToMove), nullptr, NotifyChildren);
+            auto childToMove = block->takeChildInternal(*no);
+            pre->insertChildInternal(WTFMove(childToMove), nullptr);
             no->setNeedsLayoutAndPrefWidthsRecalc();
         }
     }
@@ -1371,7 +1371,7 @@
         oldContinuation->removeFromContinuationChain();
     newBox->insertIntoContinuationChainAfter(*this);
     RenderObject* beforeChild = child.nextSibling();
-    auto removedChild = takeChildInternal(child, NotifyChildren);
+    auto removedChild = takeChildInternal(child);
     splitFlow(beforeChild, WTFMove(newBox), WTFMove(removedChild), oldContinuation);
 }
 

Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -368,7 +368,7 @@
                 // Insert after the placeholder, but don't let a notification happen.
                 gShiftingSpanner = true;
                 RenderBlockFlow& ancestorBlock = downcast<RenderBlockFlow>(*spanner->parent());
-                ancestorBlock.moveChildTo(placeholder.parentBox(), spanner, placeholder.nextSibling(), true);
+                ancestorBlock.moveChildTo(placeholder.parentBox(), spanner, placeholder.nextSibling(), RenderBoxModelObject::NormalizeAfterInsertion::Yes);
                 gShiftingSpanner = false;
                 
                 // We have to nuke the placeholder, since the ancestor already lost the mapping to it when

Modified: trunk/Source/WebCore/rendering/RenderRubyBase.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderRubyBase.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -99,11 +99,11 @@
         else {
             auto newToBlock = toBase->createAnonymousBlock();
             toBlock = newToBlock.get();
-            toBase->insertChildInternal(WTFMove(newToBlock), nullptr, NotifyChildren);
+            toBase->insertChildInternal(WTFMove(newToBlock), nullptr);
         }
     }
     // Move our inline children into the target block we determined above.
-    moveChildrenTo(toBlock, firstChild(), beforeChild);
+    moveChildrenTo(toBlock, firstChild(), beforeChild, RenderBoxModelObject::NormalizeAfterInsertion::No);
 }
 
 void RenderRubyBase::moveBlockChildren(RenderRubyBase* toBase, RenderObject* beforeChild)
@@ -124,12 +124,12 @@
             && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildThere->childrenInline()) {            
         RenderBlock* anonBlockHere = downcast<RenderBlock>(firstChildHere);
         RenderBlock* anonBlockThere = downcast<RenderBlock>(lastChildThere);
-        anonBlockHere->moveAllChildrenTo(anonBlockThere, true);
+        anonBlockHere->moveAllChildrenTo(anonBlockThere, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
         anonBlockHere->deleteLines();
         anonBlockHere->removeFromParentAndDestroy();
     }
     // Move all remaining children normally.
-    moveChildrenTo(toBase, firstChild(), beforeChild);
+    moveChildrenTo(toBase, firstChild(), beforeChild, RenderBoxModelObject::NormalizeAfterInsertion::No);
 }
 
 RenderRubyRun* RenderRubyBase::rubyRun() const

Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -167,8 +167,8 @@
                 RenderRubyBase* rightBase = rightRun.rubyBaseSafe();
                 // Collect all children in a single base, then swap the bases.
                 rightBase->mergeChildrenWithBase(*base);
-                moveChildTo(&rightRun, base);
-                rightRun.moveChildTo(this, rightBase);
+                moveChildTo(&rightRun, base, RenderBoxModelObject::NormalizeAfterInsertion::No);
+                rightRun.moveChildTo(this, rightBase, RenderBoxModelObject::NormalizeAfterInsertion::No);
                 // The now empty ruby base will be removed below.
                 ASSERT(!rubyBase()->firstChild());
             }

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (224932 => 224933)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -314,7 +314,7 @@
             currentRow = currentRow->nextRow();
             continue;
         }
-        currentRow->moveAllChildrenTo(rowToInsertInto);
+        currentRow->moveAllChildrenTo(rowToInsertInto, RenderBoxModelObject::NormalizeAfterInsertion::No);
         auto toDestroy = section->takeChild(*currentRow);
         currentRow = currentRow->nextRow();
     }

Modified: trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp (224932 => 224933)


--- trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp	2017-11-16 20:07:30 UTC (rev 224932)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp	2017-11-16 20:26:37 UTC (rev 224933)
@@ -57,12 +57,12 @@
     flow.RenderBlock::addChild(WTFMove(newFragmentedFlow));
 
     // Reparent children preceding the fragmented flow into the fragmented flow.
-    flow.moveChildrenTo(&fragmentedFlow, flow.firstChild(), &fragmentedFlow, true);
+    flow.moveChildrenTo(&fragmentedFlow, flow.firstChild(), &fragmentedFlow, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
     if (flow.isFieldset()) {
         // Keep legends out of the flow thread.
         for (auto& box : childrenOfType<RenderBox>(fragmentedFlow)) {
             if (box.isLegend())
-                fragmentedFlow.moveChildTo(&flow, &box, true);
+                fragmentedFlow.moveChildTo(&flow, &box, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
         }
     }
 
@@ -75,7 +75,7 @@
     flow.clearMultiColumnFlow();
 
     fragmentedFlow.deleteLines();
-    fragmentedFlow.moveAllChildrenTo(&flow, true);
+    fragmentedFlow.moveAllChildrenTo(&flow, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
 
     // Move spanners back to their original DOM position in the tree, and destroy the placeholders.
     auto spannerMap = fragmentedFlow.takeSpannerMap();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to