Title: [228428] trunk/Source/WebCore
Revision
228428
Author
za...@apple.com
Date
2018-02-13 11:52:46 -0800 (Tue, 13 Feb 2018)

Log Message

[RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182734
<rdar://problem/37500876>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::takeChild): Deleted.
* rendering/RenderGrid.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
* rendering/updating/RenderTreeBuilder.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228427 => 228428)


--- trunk/Source/WebCore/ChangeLog	2018-02-13 19:14:47 UTC (rev 228427)
+++ trunk/Source/WebCore/ChangeLog	2018-02-13 19:52:46 UTC (rev 228428)
@@ -1,3 +1,20 @@
+2018-02-13  Zalan Bujtas  <za...@apple.com>
+
+        [RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182734
+        <rdar://problem/37500876>
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::takeChild): Deleted.
+        * rendering/RenderGrid.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
+        * rendering/updating/RenderTreeBuilder.h:
+
 2018-02-13  Nan Wang  <n_w...@apple.com>
 
         AX: Remove AccessibleNode class

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (228427 => 228428)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2018-02-13 19:14:47 UTC (rev 228427)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2018-02-13 19:52:46 UTC (rev 228428)
@@ -85,21 +85,6 @@
     dirtyGrid();
 }
 
-RenderPtr<RenderObject> RenderGrid::takeChild(RenderTreeBuilder& builder, RenderObject& child)
-{
-    auto takenChild = RenderBlock::takeChild(builder, 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())
-        return takenChild;
-
-    // The grid needs to be recomputed as it might contain auto-placed items that
-    // will change their position.
-    dirtyGrid();
-    return takenChild;
-}
-
 StyleSelfAlignmentData RenderGrid::selfAlignmentForChild(GridAxis axis, const RenderBox& child, const RenderStyle* gridStyle) const
 {
     return axis == GridRowAxis ? justifySelfForChild(child, gridStyle) : alignSelfForChild(child, gridStyle);

Modified: trunk/Source/WebCore/rendering/RenderGrid.h (228427 => 228428)


--- trunk/Source/WebCore/rendering/RenderGrid.h	2018-02-13 19:14:47 UTC (rev 228427)
+++ trunk/Source/WebCore/rendering/RenderGrid.h	2018-02-13 19:52:46 UTC (rev 228428)
@@ -80,7 +80,6 @@
     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
 
     void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild) final;
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject&) final;
 
     StyleSelfAlignmentData selfAlignmentForChild(GridAxis, const RenderBox&, const RenderStyle* = nullptr) const;
     bool selfAlignmentChangedToStretch(GridAxis, const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderBox&) const;

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228427 => 228428)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 19:14:47 UTC (rev 228427)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 19:52:46 UTC (rev 228428)
@@ -28,6 +28,7 @@
 
 #include "RenderButton.h"
 #include "RenderElement.h"
+#include "RenderGrid.h"
 #include "RenderMenuList.h"
 #include "RenderRuby.h"
 #include "RenderRubyBase.h"
@@ -202,6 +203,12 @@
     if (is<RenderMenuList>(parent))
         return takeChildFromRenderMenuList(downcast<RenderMenuList>(parent), child);
 
+    if (is<RenderButton>(parent))
+        return takeChildFromRenderButton(downcast<RenderButton>(parent), child);
+
+    if (is<RenderGrid>(parent))
+        return takeChildFromRenderGrid(downcast<RenderGrid>(parent), child);
+
     return parent.takeChild(*this, child);
 }
 
@@ -532,4 +539,17 @@
     return takeChild(*innerRenderer, child);
 }
 
+RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderGrid(RenderGrid& parent, RenderObject& child)
+{
+    auto takenChild = parent.RenderBlock::takeChild(*this, 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())
+        return takenChild;
+
+    // The grid needs to be recomputed as it might contain auto-placed items that will change their position.
+    parent.dirtyGrid();
+    return takenChild;
 }
+
+}

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228427 => 228428)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 19:14:47 UTC (rev 228427)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 19:52:46 UTC (rev 228428)
@@ -30,6 +30,7 @@
 namespace WebCore {
 
 class RenderButton;
+class RenderGrid;
 class RenderMathMLFenced;
 class RenderMenuList;
 class RenderRubyAsBlock;
@@ -107,6 +108,7 @@
     void removeAnonymousWrappersForInlineChildrenIfNeeded(RenderElement& parent);
     RenderPtr<RenderObject> takeChildFromRenderMenuList(RenderMenuList& parent, RenderObject& child);
     RenderPtr<RenderObject> takeChildFromRenderButton(RenderButton& parent, RenderObject& child);
+    RenderPtr<RenderObject> takeChildFromRenderGrid(RenderGrid& parent, RenderObject& child);
 
     FirstLetter& firstLetterBuilder() { return *m_firstLetterBuilder; }
     List& listBuilder() { return *m_listBuilder; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to