Skip to content
Permalink
Browse files
[RenderTreeBuilder] Move RenderButton::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182732
<rdar://problem/37500564>

Reviewed by Antti Koivisto.

No change of functionality.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::setInnerRenderer):
(WebCore::RenderButton::takeChild): Deleted.
* rendering/RenderButton.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
* rendering/updating/RenderTreeBuilder.h:


Canonical link: https://commits.webkit.org/198522@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Feb 13, 2018
1 parent 03f73c5 commit 920be692d074acd5952bd530b5f5c72f0aac969d
@@ -1,3 +1,21 @@
2018-02-13 Zalan Bujtas <zalan@apple.com>

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

Reviewed by Antti Koivisto.

No change of functionality.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::setInnerRenderer):
(WebCore::RenderButton::takeChild): Deleted.
* rendering/RenderButton.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
* rendering/updating/RenderTreeBuilder.h:

2018-02-13 Alicia Boya García <aboya@igalia.com>

[Gstreamer][MSE] Add string representation for GStreamerMediaSample
@@ -69,18 +69,6 @@ void RenderButton::setInnerRenderer(RenderBlock& innerRenderer)
m_inner = makeWeakPtr(innerRenderer);
updateAnonymousChildStyle(m_inner->mutableStyle());
}

RenderPtr<RenderObject> RenderButton::takeChild(RenderTreeBuilder& builder, RenderObject& oldChild)
{
// m_inner should be the only child, but checking for direct children who
// are not m_inner prevents security problems when that assumption is
// violated.
if (&oldChild == m_inner || !m_inner || oldChild.parent() == this) {
ASSERT(&oldChild == m_inner || !m_inner);
return RenderFlexibleBox::takeChild(builder, oldChild);
}
return builder.takeChild(*m_inner, oldChild);
}

void RenderButton::updateAnonymousChildStyle(RenderStyle& childStyle) const
{
@@ -41,7 +41,6 @@ class RenderButton final : public RenderFlexibleBox {

bool canBeSelectionLeaf() const override;

RenderPtr<RenderObject> takeChild(RenderTreeBuilder&, RenderObject&) override;
bool createsAnonymousWrapper() const override { return true; }

void updateFromElement() override;
@@ -522,4 +522,14 @@ RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderMenuList(RenderMen
return takeChild(*innerRenderer, child);
}

RenderPtr<RenderObject> RenderTreeBuilder::takeChildFromRenderButton(RenderButton& parent, RenderObject& child)
{
auto* innerRenderer = parent.innerRenderer();
if (!innerRenderer || &child == innerRenderer || child.parent() == &parent) {
ASSERT(&child == innerRenderer || !innerRenderer);
return parent.RenderBlock::takeChild(*this, child);
}
return takeChild(*innerRenderer, child);
}

}
@@ -29,6 +29,7 @@

namespace WebCore {

class RenderButton;
class RenderMathMLFenced;
class RenderMenuList;
class RenderRubyAsBlock;
@@ -105,6 +106,7 @@ class RenderTreeBuilder {

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

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

0 comments on commit 920be69

Please sign in to comment.