[RenderTreeBuilder] Replace remaining addChild calls with RenderTreeBuilder::insert
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 20:07:52 +0000 (20:07 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 20:07:52 +0000 (20:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181044
<rdar://problem/36157613>

Reviewed by Antti Koivisto.

Covered by existing test cases.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringContinuation):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChildIgnoringContinuation):
* rendering/RenderElement.h:
(WebCore::RenderElement::addChildIgnoringContinuation): Deleted.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h

index dfb8342..b779372 100644 (file)
@@ -1,3 +1,20 @@
+2017-12-20  Zalan Bujtas  <zalan@apple.com>
+
+        [RenderTreeBuilder] Replace remaining addChild calls with RenderTreeBuilder::insert
+        https://bugs.webkit.org/show_bug.cgi?id=181044
+        <rdar://problem/36157613>
+
+        Reviewed by Antti Koivisto.
+
+        Covered by existing test cases.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addChildIgnoringContinuation):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::addChildIgnoringContinuation):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::addChildIgnoringContinuation): Deleted.
+
 2017-12-20  Daniel Bates  <dabates@apple.com>
 
         Cleanup: Dereference value of optional directly instead of using checked value in WebCore::subdivide()
index fc9dc94..1f7d29f 100644 (file)
@@ -562,9 +562,9 @@ void RenderBlock::addChildIgnoringContinuation(RenderTreeBuilder& builder, Rende
                 ) {
                 // Insert the child into the anonymous block box instead of here.
                 if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild)
-                    beforeChild->parent()->addChild(builder, WTFMove(newChild), beforeChild);
+                    builder.insertChild(*beforeChild->parent(), WTFMove(newChild), beforeChild);
                 else
-                    addChild(builder, WTFMove(newChild), beforeChild->parent());
+                    builder.insertChild(*this, WTFMove(newChild), beforeChild->parent());
                 return;
             }
 
index 31a3611..879631f 100644 (file)
@@ -511,6 +511,11 @@ void RenderElement::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject>
     SVGRenderSupport::childAdded(*this, child);
 }
 
+void RenderElement::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
+{
+    builder.insertChild(*this, WTFMove(newChild), beforeChild);
+}
+
 RenderPtr<RenderObject> RenderElement::takeChild(RenderObject& oldChild)
 {
     return takeChildInternal(oldChild);
index 5e66e51..18c8f57 100644 (file)
@@ -88,7 +88,7 @@ public:
 
     virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const { return true; }
     virtual void addChild(RenderTreeBuilder&, RenderPtr<RenderObject>, RenderObject* beforeChild);
-    virtual void addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) { addChild(builder, WTFMove(newChild), beforeChild); }
+    virtual void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr);
     virtual RenderPtr<RenderObject> takeChild(RenderObject&) WARN_UNUSED_RETURN;
     void removeAndDestroyChild(RenderObject&);