Title: [228492] trunk/Source/WebCore
Revision
228492
Author
za...@apple.com
Date
2018-02-14 15:41:55 -0800 (Wed, 14 Feb 2018)

Log Message

[RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182811
<rdar://problem/37549714>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToSVGContainer): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGInline): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGRoot): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGText): Deleted.
* rendering/updating/RenderTreeBuilder.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228491 => 228492)


--- trunk/Source/WebCore/ChangeLog	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/ChangeLog	2018-02-14 23:41:55 UTC (rev 228492)
@@ -1,3 +1,33 @@
+2018-02-14  Zalan Bujtas  <za...@apple.com>
+
+        [RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182811
+        <rdar://problem/37549714>
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * rendering/svg/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::addChild): Deleted.
+        * rendering/svg/RenderSVGContainer.h:
+        * rendering/svg/RenderSVGInline.cpp:
+        (WebCore::RenderSVGInline::addChild): Deleted.
+        * rendering/svg/RenderSVGInline.h:
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::addChild): Deleted.
+        * rendering/svg/RenderSVGRoot.h:
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::addChild): Deleted.
+        * rendering/svg/RenderSVGText.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::insertChild):
+        (WebCore::RenderTreeBuilder::insertChildToSVGContainer): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToSVGInline): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToSVGRoot): Deleted.
+        (WebCore::RenderTreeBuilder::insertChildToSVGText): Deleted.
+        * rendering/updating/RenderTreeBuilder.h:
+
 2018-02-14  Daniel Bates  <daba...@apple.com>
 
         Disallow cross-origin subresources from asking for credentials

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp	2018-02-14 23:41:55 UTC (rev 228492)
@@ -90,11 +90,6 @@
     clearNeedsLayout();
 }
 
-void RenderSVGContainer::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
-    builder.insertChildToSVGContainer(*this, WTFMove(newChild), beforeChild);
-}
-
 bool RenderSVGContainer::selfWillPaint()
 {
     auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this);

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h	2018-02-14 23:41:55 UTC (rev 228492)
@@ -48,7 +48,6 @@
 
     void layout() override;
 
-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) final;
     void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final;
 
     FloatRect objectBoundingBox() const final { return m_objectBoundingBox; }

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp	2018-02-14 23:41:55 UTC (rev 228492)
@@ -123,9 +123,4 @@
     setInline(true);
 }
 
-void RenderSVGInline::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
-    builder.insertChildToSVGInline(*this, WTFMove(newChild), beforeChild);
 }
-
-}

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInline.h (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInline.h	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInline.h	2018-02-14 23:41:55 UTC (rev 228492)
@@ -60,8 +60,6 @@
 
     void willBeDestroyed(RenderTreeBuilder&) final;
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
-
-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2018-02-14 23:41:55 UTC (rev 228492)
@@ -303,11 +303,6 @@
     SVGResourcesCache::clientStyleChanged(*this, diff, style());
 }
 
-void RenderSVGRoot::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
-    builder.insertChildToSVGRoot(*this, WTFMove(newChild), beforeChild);
-}
-
 // RenderBox methods will expect coordinates w/o any transforms in coordinates
 // relative to our borderBox origin.  This method gives us exactly that.
 void RenderSVGRoot::buildLocalToBorderBoxTransform()

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h	2018-02-14 23:41:55 UTC (rev 228492)
@@ -82,7 +82,6 @@
     void willBeRemovedFromTree() override;
 
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
 
     const AffineTransform& localToParentTransform() const override;
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2018-02-14 23:41:55 UTC (rev 228492)
@@ -520,11 +520,6 @@
     return repaintRect;
 }
 
-void RenderSVGText::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
-    builder.insertChildToSVGText(*this, WTFMove(newChild), beforeChild);
-}
-
 // Fix for <rdar://problem/8048875>. We should not render :first-line CSS Style
 // in a SVG text element context.
 RenderBlock* RenderSVGText::firstLineBlock() const

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.h (228491 => 228492)


--- trunk/Source/WebCore/rendering/svg/RenderSVGText.h	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.h	2018-02-14 23:41:55 UTC (rev 228492)
@@ -83,7 +83,6 @@
 
     void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
     const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) override;
     void willBeDestroyed(RenderTreeBuilder&) override;
 
     const AffineTransform& localToParentTransform() const override { return m_localTransform; }

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228491 => 228492)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-14 23:41:55 UTC (rev 228492)
@@ -194,6 +194,26 @@
         return;
     }
 
+    if (is<RenderSVGContainer>(parent)) {
+        svgBuilder().insertChild(downcast<RenderSVGContainer>(parent), WTFMove(child), beforeChild);
+        return;
+    }
+
+    if (is<RenderSVGInline>(parent)) {
+        svgBuilder().insertChild(downcast<RenderSVGInline>(parent), WTFMove(child), beforeChild);
+        return;
+    }
+
+    if (is<RenderSVGRoot>(parent)) {
+        svgBuilder().insertChild(downcast<RenderSVGRoot>(parent), WTFMove(child), beforeChild);
+        return;
+    }
+
+    if (is<RenderSVGText>(parent)) {
+        svgBuilder().insertChild(downcast<RenderSVGText>(parent), WTFMove(child), beforeChild);
+        return;
+    }
+
     parent.addChild(*this, WTFMove(child), beforeChild);
 }
 
@@ -467,26 +487,6 @@
     inlineBuilder().insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
 }
 
-void RenderTreeBuilder::insertChildToSVGContainer(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    svgBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
-void RenderTreeBuilder::insertChildToSVGInline(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    svgBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
-void RenderTreeBuilder::insertChildToSVGRoot(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    svgBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
-void RenderTreeBuilder::insertChildToSVGText(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    svgBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
 void RenderTreeBuilder::insertChildToRenderTable(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
 {
     tableBuilder().insertChild(parent, WTFMove(child), beforeChild);

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228491 => 228492)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-14 23:31:50 UTC (rev 228491)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-14 23:41:55 UTC (rev 228492)
@@ -69,10 +69,6 @@
     void insertChildToRenderBlockFlow(RenderBlockFlow& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
     void insertChildToRenderInline(RenderInline& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
     void insertChildToRenderInlineIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChildToSVGContainer(RenderSVGContainer& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChildToSVGInline(RenderSVGInline& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChildToSVGRoot(RenderSVGRoot& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChildToSVGText(RenderSVGText& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
     void insertChildToRenderTable(RenderTable& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
     void insertChildToRenderTableSection(RenderTableSection& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
     void insertChildToRenderTableRow(RenderTableRow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to