Skip to content
Permalink
Browse files
[RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBui…
…lder

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:


Canonical link: https://commits.webkit.org/198513@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Feb 13, 2018
1 parent 43890f8 commit 17b296f152f1a0172ea5774d6d76567c5cbb1091
@@ -1,3 +1,21 @@
2018-02-12 Zalan Bujtas <zalan@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.kirsling@sony.com>

Unify UserAgent into WebCore/platform.
@@ -172,13 +172,6 @@ void RenderMenuList::addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child,
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);
@@ -70,7 +70,6 @@ class RenderMenuList final : public RenderFlexibleBox, private PopupMenuClient {
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;
@@ -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 @@ RenderPtr<RenderObject> RenderTreeBuilder::takeChild(RenderElement& parent, Rend
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 @@ RenderObject* RenderTreeBuilder::resolveMovedChildForMultiColumnFlow(RenderFragm
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);
}

}
@@ -30,6 +30,7 @@
namespace WebCore {

class RenderMathMLFenced;
class RenderMenuList;
class RenderRubyAsBlock;
class RenderRubyAsInline;
class RenderRubyBase;
@@ -103,6 +104,7 @@ class RenderTreeBuilder {
class MathML;

void removeAnonymousWrappersForInlineChildrenIfNeeded(RenderElement& parent);
RenderPtr<RenderObject> takeChildFromRenderMenuList(RenderMenuList& parent, RenderObject& child);

FirstLetter& firstLetterBuilder() { return *m_firstLetterBuilder; }
List& listBuilder() { return *m_listBuilder; }

0 comments on commit 17b296f

Please sign in to comment.