Skip to content
Permalink
Browse files
[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:


Canonical link: https://commits.webkit.org/198569@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Feb 14, 2018
1 parent 51d5ae4 commit 16185ad1beeb29801d8cc3a826f8fd3abd9ae73b
@@ -1,3 +1,33 @@
2018-02-14 Zalan Bujtas <zalan@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 <dabates@apple.com>

Disallow cross-origin subresources from asking for credentials
@@ -90,11 +90,6 @@ void RenderSVGContainer::layout()
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);
@@ -48,7 +48,6 @@ class RenderSVGContainer : public RenderSVGModelObject {

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; }
@@ -123,9 +123,4 @@ void RenderSVGInline::updateFromStyle()
setInline(true);
}

void RenderSVGInline::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
{
builder.insertChildToSVGInline(*this, WTFMove(newChild), beforeChild);
}

}
@@ -60,8 +60,6 @@ class RenderSVGInline : public RenderInline {

void willBeDestroyed(RenderTreeBuilder&) final;
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;

void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) final;
};

} // namespace WebCore
@@ -303,11 +303,6 @@ void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldS
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()
@@ -82,7 +82,6 @@ class RenderSVGRoot final : public RenderReplaced {
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;

@@ -520,11 +520,6 @@ FloatRect RenderSVGText::repaintRectInLocalCoordinates() const
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
@@ -83,7 +83,6 @@ class RenderSVGText final : public RenderSVGBlock {

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; }
@@ -194,6 +194,26 @@ void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObjec
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 @@ void RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation(RenderInli
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);
@@ -69,10 +69,6 @@ class RenderTreeBuilder {
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);

0 comments on commit 16185ad

Please sign in to comment.