Diff
Modified: trunk/Source/WebCore/ChangeLog (228577 => 228578)
--- trunk/Source/WebCore/ChangeLog 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/ChangeLog 2018-02-16 21:42:39 UTC (rev 228578)
@@ -1,3 +1,33 @@
+2018-02-16 Zalan Bujtas <[email protected]>
+
+ [RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=182876
+ <rdar://problem/37607604>
+
+ Reviewed by Antti Koivisto.
+
+ No change in functionality.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addChildIgnoringContinuation): Deleted.
+ * rendering/RenderBlock.h:
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::addChildIgnoringContinuation): Deleted.
+ * rendering/RenderElement.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::addChildIgnoringContinuation): Deleted.
+ * rendering/RenderInline.h:
+ * rendering/updating/RenderTreeBuilder.cpp:
+ (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation):
+ (WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation): Deleted.
+ (WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation): Deleted.
+ * rendering/updating/RenderTreeBuilder.h:
+ * rendering/updating/RenderTreeBuilderBlock.cpp:
+ (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
+ * rendering/updating/RenderTreeBuilderInline.cpp:
+ (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
+ (WebCore::RenderTreeBuilder::Inline::splitInlines):
+
2018-02-16 Basuke Suzuki <[email protected]>
[Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -466,11 +466,6 @@
return cloneBlock;
}
-void RenderBlock::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
- builder.insertChildToRenderBlockIgnoringContinuation(*this, WTFMove(newChild), beforeChild);
-}
-
void RenderBlock::deleteLines()
{
if (AXObjectCache* cache = document().existingAXObjectCache())
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2018-02-16 21:42:39 UTC (rev 228578)
@@ -391,7 +391,6 @@
void adjustBorderBoxRectForPainting(LayoutRect&) override;
LayoutRect paintRectToClipOutFromBorder(const LayoutRect&) override;
- void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild) override;
bool isInlineBlockOrInlineTable() const final { return isInline() && isReplaced(); }
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
virtual void moveAllChildrenIncludingFloatsTo(RenderTreeBuilder& builder, RenderBlock& toBlock, RenderBoxModelObject::NormalizeAfterInsertion normalizeAfterInsertion) { moveAllChildrenTo(builder, &toBlock, normalizeAfterInsertion); }
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -473,11 +473,6 @@
SVGRenderSupport::childAdded(*this, child);
}
-void RenderElement::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
- builder.insertChild(*this, WTFMove(newChild), beforeChild);
-}
-
void RenderElement::removeAndDestroyChild(RenderTreeBuilder& builder, RenderObject& oldChild)
{
if (is<RenderElement>(oldChild)) {
Modified: trunk/Source/WebCore/rendering/RenderElement.h (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderElement.h 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderElement.h 2018-02-16 21:42:39 UTC (rev 228578)
@@ -87,7 +87,6 @@
bool isRenderInline() const;
virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const { return true; }
- virtual void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr);
void removeAndDestroyChild(RenderTreeBuilder&, RenderObject&);
void didInsertChild(RenderObject& child, RenderObject* beforeChild);
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -255,11 +255,6 @@
return caretRect;
}
-void RenderInline::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
- builder.insertChildToRenderInlineIgnoringContinuation(*this, WTFMove(newChild), beforeChild);
-}
-
void RenderInline::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
m_lineBoxes.paint(this, paintInfo, paintOffset);
Modified: trunk/Source/WebCore/rendering/RenderInline.h (228577 => 228578)
--- trunk/Source/WebCore/rendering/RenderInline.h 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/RenderInline.h 2018-02-16 21:42:39 UTC (rev 228578)
@@ -92,8 +92,6 @@
bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset);
- void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) final;
-
protected:
void willBeDestroyed(RenderTreeBuilder&) override;
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -258,6 +258,21 @@
insertChildToRenderElement(parent, WTFMove(child), beforeChild);
}
+void RenderTreeBuilder::insertChildIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+{
+ if (is<RenderInline>(parent)) {
+ inlineBuilder().insertChildIgnoringContinuation(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
+ return;
+ }
+
+ if (is<RenderBlock>(parent)) {
+ blockBuilder().insertChildIgnoringContinuation(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
+ return;
+ }
+
+ insertChild(parent, WTFMove(child), beforeChild);
+}
+
RenderPtr<RenderObject> RenderTreeBuilder::takeChild(RenderElement& parent, RenderObject& child)
{
if (is<RenderRubyAsInline>(parent))
@@ -325,11 +340,6 @@
parent.didInsertChild(newChild, beforeChild);
}
-void RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
- blockBuilder().insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
-}
-
void RenderTreeBuilder::makeChildrenNonInline(RenderBlock& parent, RenderObject* insertionPoint)
{
// makeChildrenNonInline takes a block whose children are *all* inline and it
@@ -515,11 +525,6 @@
// WARNING: child is deleted here.
}
-void RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
- inlineBuilder().insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
-}
-
void RenderTreeBuilder::updateAfterDescendants(RenderElement& renderer)
{
if (is<RenderBlock>(renderer))
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228577 => 228578)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-02-16 21:42:39 UTC (rev 228578)
@@ -51,8 +51,9 @@
RenderTreeBuilder(RenderView&);
~RenderTreeBuilder();
+ void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
void insertChild(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
- void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
+ void insertChildIgnoringContinuation(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
RenderPtr<RenderObject> takeChild(RenderElement&, RenderObject&) WARN_UNUSED_RETURN;
@@ -63,9 +64,6 @@
static RenderTreeBuilder* current() { return s_current; }
// These functions are temporary until after all block/inline/continuation code is moved over.
- void insertChildToRenderBlockIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
- void insertChildToRenderInlineIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-
RenderPtr<RenderObject> takeChildFromRenderElement(RenderElement& parent, RenderObject& child) WARN_UNUSED_RETURN;
void childFlowStateChangesAndAffectsParentBlock(RenderElement& child);
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -124,7 +124,7 @@
}
if (child->isFloatingOrOutOfFlowPositioned()) {
- beforeChildParent->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
return;
}
@@ -133,7 +133,7 @@
bool flowIsNormal = flow->isInline() || !flow->style().columnSpan();
if (flow == beforeChildParent) {
- flow->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child), beforeChild);
return;
}
@@ -140,14 +140,14 @@
// The goal here is to match up if we can, so that we can coalesce and create the
// minimal # of continuations needed for the inline.
if (childIsNormal == bcpIsNormal) {
- beforeChildParent->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
return;
}
if (flowIsNormal == childIsNormal) {
- flow->addChildIgnoringContinuation(m_builder, WTFMove(child), nullptr); // Just treat like an append.
+ m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
return;
}
- beforeChildParent->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ m_builder.insertChildIgnoringContinuation(*beforeChildParent, WTFMove(child), beforeChild);
}
void RenderTreeBuilder::Block::insertChildIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp (228577 => 228578)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp 2018-02-16 21:39:38 UTC (rev 228577)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp 2018-02-16 21:42:39 UTC (rev 228578)
@@ -139,10 +139,10 @@
ASSERT_NOT_REACHED();
if (child->isFloatingOrOutOfFlowPositioned())
- return beforeChildAncestor->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
if (flow == beforeChildAncestor)
- return flow->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ return m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child), beforeChild);
// A continuation always consists of two potential candidates: an inline or an anonymous
// block box holding block children.
bool childInline = newChildIsInline(parent, *child);
@@ -149,10 +149,10 @@
// The goal here is to match up if we can, so that we can coalesce and create the
// minimal # of continuations needed for the inline.
if (childInline == beforeChildAncestor->isInline())
- return beforeChildAncestor->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
if (flow->isInline() == childInline)
- return flow->addChildIgnoringContinuation(m_builder, WTFMove(child)); // Just treat like an append.
- return beforeChildAncestor->addChildIgnoringContinuation(m_builder, WTFMove(child), beforeChild);
+ return m_builder.insertChildIgnoringContinuation(*flow, WTFMove(child)); // Just treat like an append.
+ return m_builder.insertChildIgnoringContinuation(*beforeChildAncestor, WTFMove(child), beforeChild);
}
void RenderTreeBuilder::Inline::insertChildIgnoringContinuation(RenderInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
@@ -306,7 +306,7 @@
// every time, which is a bit wasteful.
}
auto childToMove = m_builder.takeChildFromRenderElement(*rendererToMove->parent(), *rendererToMove);
- cloneInline->addChildIgnoringContinuation(m_builder, WTFMove(childToMove));
+ m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(childToMove));
rendererToMove->setNeedsLayoutAndPrefWidthsRecalc();
rendererToMove = nextSibling;
}
@@ -334,7 +334,7 @@
cloneInline = cloneAsContinuation(downcast<RenderInline>(*current));
// Insert our child clone as the first child.
- cloneInline->addChildIgnoringContinuation(m_builder, WTFMove(cloneChild));
+ m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(cloneChild));
// Hook the clone up as a continuation of |curr|.
cloneInline->insertIntoContinuationChainAfter(*current);
@@ -344,7 +344,7 @@
for (auto* sibling = currentChild->nextSibling(); sibling;) {
auto* next = sibling->nextSibling();
auto childToMove = m_builder.takeChildFromRenderElement(*current, *sibling);
- cloneInline->addChildIgnoringContinuation(m_builder, WTFMove(childToMove));
+ m_builder.insertChildIgnoringContinuation(*cloneInline, WTFMove(childToMove));
sibling->setNeedsLayoutAndPrefWidthsRecalc();
sibling = next;
}