Title: [228414] trunk/Source/WebCore
Revision
228414
Author
za...@apple.com
Date
2018-02-12 19:26:50 -0800 (Mon, 12 Feb 2018)

Log Message

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

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
* rendering/updating/RenderTreeBuilder.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228413 => 228414)


--- trunk/Source/WebCore/ChangeLog	2018-02-13 02:26:17 UTC (rev 228413)
+++ trunk/Source/WebCore/ChangeLog	2018-02-13 03:26:50 UTC (rev 228414)
@@ -1,3 +1,21 @@
+2018-02-12  Zalan Bujtas  <za...@apple.com>
+
+        [RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182715
+        <rdar://problem/37477050>
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::takeChild): Deleted.
+        * rendering/RenderMenuList.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::takeChild):
+        (WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
+        * rendering/updating/RenderTreeBuilder.h:
+
 2018-02-12  Ross Kirsling  <ross.kirsl...@sony.com>
 
         Unify UserAgent into WebCore/platform.

Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (228413 => 228414)


--- trunk/Source/WebCore/rendering/RenderMenuList.cpp	2018-02-13 02:26:17 UTC (rev 228413)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp	2018-02-13 03:26:50 UTC (rev 228414)
@@ -172,13 +172,6 @@
         cache->childrenChanged(this, child.get());
 }
 
-RenderPtr<RenderObject> RenderMenuList::takeChild(RenderTreeBuilder& builder, RenderObject& oldChild)
-{
-    if (!m_innerBlock || &oldChild == m_innerBlock)
-        return RenderFlexibleBox::takeChild(builder, oldChild);
-    return builder.takeChild(*m_innerBlock, oldChild);
-}
-
 void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);

Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (228413 => 228414)


--- trunk/Source/WebCore/rendering/RenderMenuList.h	2018-02-13 02:26:17 UTC (rev 228413)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h	2018-02-13 03:26:50 UTC (rev 228414)
@@ -70,7 +70,6 @@
     bool isMenuList() const override { return true; }
 
     void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
-    RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject&) override;
     bool createsAnonymousWrapper() const override { return true; }
 
     void updateFromElement() override;

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228413 => 228414)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 02:26:17 UTC (rev 228413)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-13 03:26:50 UTC (rev 228414)
@@ -28,6 +28,7 @@
 
 #include "RenderButton.h"
 #include "RenderElement.h"
+#include "RenderMenuList.h"
 #include "RenderRuby.h"
 #include "RenderRubyBase.h"
 #include "RenderRubyRun.h"
@@ -198,6 +199,9 @@
     if (is<RenderRubyRun>(parent))
         return rubyBuilder().takeChild(downcast<RenderRubyRun>(parent), child);
 
+    if (is<RenderMenuList>(parent))
+        return takeChildFromRenderMenuList(downcast<RenderMenuList>(parent), child);
+
     return parent.takeChild(*this, child);
 }
 
@@ -510,4 +514,12 @@
     return multiColumnBuilder().resolveMovedChild(enclosingFragmentedFlow, beforeChild);
 }
 
+RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderMenuList(RenderMenuList& parent, RenderObject& child)
+{
+    auto* innerRenderer = parent.innerRenderer();
+    if (!innerRenderer || &child == innerRenderer)
+        return parent.RenderBlock::takeChild(*this, child);
+    return takeChild(*innerRenderer, child);
 }
+
+}

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228413 => 228414)


--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 02:26:17 UTC (rev 228413)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-13 03:26:50 UTC (rev 228414)
@@ -30,6 +30,7 @@
 namespace WebCore {
 
 class RenderMathMLFenced;
+class RenderMenuList;
 class RenderRubyAsBlock;
 class RenderRubyAsInline;
 class RenderRubyBase;
@@ -103,6 +104,7 @@
     class MathML;
 
     void removeAnonymousWrappersForInlineChildrenIfNeeded(RenderElement& parent);
+    RenderPtr<RenderObject> takeChildFromRenderMenuList(RenderMenuList& 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