Diff
Modified: trunk/Source/WebCore/ChangeLog (228558 => 228559)
--- trunk/Source/WebCore/ChangeLog 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/ChangeLog 2018-02-16 15:13:31 UTC (rev 228559)
@@ -1,3 +1,41 @@
+2018-02-16 Zalan Bujtas <[email protected]>
+
+ [RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=182862
+ <rdar://problem/37595464>
+
+ Reviewed by Antti Koivisto.
+
+ No change in functionality.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addChild): Deleted.
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::addChild): Deleted.
+ * rendering/RenderBlockFlow.h:
+ * rendering/updating/RenderTreeBuilder.cpp:
+ (WebCore::RenderTreeBuilder::insertChild):
+ (WebCore::RenderTreeBuilder::insertChildToRenderBlock): Deleted.
+ (WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow): Deleted.
+ * rendering/updating/RenderTreeBuilder.h:
+ * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
+ (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
+ * rendering/updating/RenderTreeBuilderFormControls.cpp:
+ (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
+ * rendering/updating/RenderTreeBuilderMathML.cpp:
+ (WebCore::RenderTreeBuilder::MathML::makeFences):
+ (WebCore::RenderTreeBuilder::MathML::insertChild):
+ * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
+ (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
+ (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
+ * rendering/updating/RenderTreeBuilderRuby.cpp:
+ (WebCore::RenderTreeBuilder::Ruby::insertChild):
+ (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
+ (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
+ * rendering/updating/RenderTreeBuilderSVG.cpp:
+ (WebCore::RenderTreeBuilder::SVG::insertChild):
+
2018-02-16 Wenson Hsieh <[email protected]>
[Extra zoom mode] Add basic support for <input type='date'> using date picker UI
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -466,11 +466,6 @@
return cloneBlock;
}
-void RenderBlock::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
- builder.insertChildToRenderBlock(*this, WTFMove(newChild), beforeChild);
-}
-
void RenderBlock::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
{
builder.insertChildToRenderBlockIgnoringContinuation(*this, WTFMove(newChild), beforeChild);
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (228558 => 228559)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2018-02-16 15:13:31 UTC (rev 228559)
@@ -73,8 +73,6 @@
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
virtual void deleteLines();
- void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
-
virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0);
virtual void invalidateLineLayoutPath() { }
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -3844,11 +3844,6 @@
fragmentedFlow->layoutFlowExcludedObjects(relayoutChildren);
}
-void RenderBlockFlow::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
-{
- builder.insertChildToRenderBlockFlow(*this, WTFMove(newChild), beforeChild);
-}
-
void RenderBlockFlow::checkForPaginationLogicalHeightChange(bool& relayoutChildren, LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged)
{
// If we don't use columns or flow threads, then bail.
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (228558 => 228559)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.h 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h 2018-02-16 15:13:31 UTC (rev 228559)
@@ -378,8 +378,6 @@
LayoutUnit logicalHeightForChildForFragmentation(const RenderBox& child) const;
bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
- void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
-
void updateColumnProgressionFromStyle(RenderStyle&);
void updateStylesForColumnChildren();
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -240,6 +240,16 @@
return;
}
+ if (is<RenderBlockFlow>(parent)) {
+ blockFlowBuilder().insertChild(downcast<RenderBlockFlow>(parent), WTFMove(child), beforeChild);
+ return;
+ }
+
+ if (is<RenderBlock>(parent)) {
+ blockBuilder().insertChild(downcast<RenderBlock>(parent), WTFMove(child), beforeChild);
+ return;
+ }
+
if (is<RenderInline>(parent)) {
inlineBuilder().insertChild(downcast<RenderInline>(parent), WTFMove(child), beforeChild);
return;
@@ -313,11 +323,6 @@
parent.RenderElement::insertChildInternal(WTFMove(child), beforeChild);
}
-void RenderTreeBuilder::insertChildToRenderBlock(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
- blockBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
void RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
{
blockBuilder().insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
@@ -513,11 +518,6 @@
inlineBuilder().insertChildIgnoringContinuation(parent, WTFMove(child), beforeChild);
}
-void RenderTreeBuilder::insertChildToRenderBlockFlow(RenderBlockFlow& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
- blockFlowBuilder().insertChild(parent, WTFMove(child), beforeChild);
-}
-
void RenderTreeBuilder::updateAfterDescendants(RenderElement& renderer)
{
if (is<RenderBlock>(renderer))
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.h 2018-02-16 15:13:31 UTC (rev 228559)
@@ -64,9 +64,7 @@
// These functions are temporary until after all block/inline/continuation code is moved over.
void insertChildToRenderElement(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr);
- void insertChildToRenderBlock(RenderBlock& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
void insertChildToRenderBlockIgnoringContinuation(RenderBlock& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
- void insertChildToRenderBlockFlow(RenderBlockFlow& 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;
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlockFlow.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlockFlow.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlockFlow.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -42,7 +42,7 @@
auto* beforeChildOrPlaceholder = beforeChild;
if (auto* containingFragmentedFlow = parent.enclosingFragmentedFlow())
beforeChildOrPlaceholder = m_builder.multiColumnBuilder().resolveMovedChild(*containingFragmentedFlow, beforeChild);
- m_builder.insertChildToRenderBlock(parent, WTFMove(child), beforeChildOrPlaceholder);
+ m_builder.blockBuilder().insertChild(parent, WTFMove(child), beforeChildOrPlaceholder);
}
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFormControls.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFormControls.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFormControls.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -56,7 +56,7 @@
auto wrapper = parent.createAnonymousBlock(parent.style().display());
innerRenderer = wrapper.get();
- parent.RenderBlock::addChild(m_builder, WTFMove(wrapper));
+ m_builder.blockBuilder().insertChild(parent, WTFMove(wrapper), nullptr);
parent.setInnerRenderer(*innerRenderer);
return *innerRenderer;
}
@@ -69,7 +69,7 @@
auto wrapper = parent.createAnonymousBlock();
innerRenderer = wrapper.get();
- parent.RenderBlock::addChild(m_builder, WTFMove(wrapper));
+ m_builder.blockBuilder().insertChild(parent, WTFMove(wrapper), nullptr);
parent.setInnerRenderer(*innerRenderer);
return *innerRenderer;
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -47,11 +47,11 @@
void RenderTreeBuilder::MathML::makeFences(RenderMathMLFenced& parent)
{
auto openFence = createMathMLOperator(parent, parent.openingBrace(), MathMLOperatorDictionary::Prefix, MathMLOperatorDictionary::Fence);
- parent.RenderBlock::addChild(m_builder, WTFMove(openFence), parent.firstChild());
+ m_builder.blockBuilder().insertChild(parent, WTFMove(openFence), parent.firstChild());
auto closeFence = createMathMLOperator(parent, parent.closingBrace(), MathMLOperatorDictionary::Postfix, MathMLOperatorDictionary::Fence);
parent.setCloseFenceRenderer(*closeFence);
- parent.RenderBlock::addChild(m_builder, WTFMove(closeFence));
+ m_builder.blockBuilder().insertChild(parent, WTFMove(closeFence), nullptr);
}
void RenderTreeBuilder::MathML::insertChild(RenderMathMLFenced& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
@@ -95,14 +95,14 @@
if (beforeChild) {
// Adding |x| before an existing |y| e.g. in element (y) - first insert our new child |x|, then its separator, to get (x, y).
- parent.RenderBlock::addChild(m_builder, WTFMove(child), beforeChild);
+ m_builder.blockBuilder().insertChild(parent, WTFMove(child), beforeChild);
if (separatorRenderer)
- parent.RenderMathMLRow::addChild(m_builder, WTFMove(separatorRenderer), beforeChild);
+ m_builder.blockBuilder().insertChild(parent, WTFMove(separatorRenderer), beforeChild);
} else {
// Adding |y| at the end of an existing element e.g. (x) - insert the separator first before the closing fence, then |y|, to get (x, y).
if (separatorRenderer)
- parent.RenderBlock::addChild(m_builder, WTFMove(separatorRenderer), parent.closeFenceRenderer());
- parent.RenderBlock::addChild(m_builder, WTFMove(child), parent.closeFenceRenderer());
+ m_builder.blockBuilder().insertChild(parent, WTFMove(separatorRenderer), parent.closeFenceRenderer());
+ m_builder.blockBuilder().insertChild(parent, WTFMove(child), parent.closeFenceRenderer());
}
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMultiColumn.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMultiColumn.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderMultiColumn.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -31,6 +31,7 @@
#include "RenderMultiColumnSet.h"
#include "RenderMultiColumnSpannerPlaceholder.h"
#include "RenderTreeBuilder.h"
+#include "RenderTreeBuilderBlock.h"
namespace WebCore {
@@ -168,7 +169,7 @@
auto newFragmentedFlow = !flow.style().hasLinesClamp() ? WebCore::createRenderer<RenderMultiColumnFlow>(flow.document(), RenderStyle::createAnonymousStyleWithDisplay(flow.style(), BLOCK)) : WebCore::createRenderer<RenderLinesClampFlow>(flow.document(), RenderStyle::createAnonymousStyleWithDisplay(flow.style(), BLOCK));
newFragmentedFlow->initializeStyle();
auto& fragmentedFlow = *newFragmentedFlow;
- m_builder.insertChildToRenderBlock(flow, WTFMove(newFragmentedFlow));
+ m_builder.blockBuilder().insertChild(flow, WTFMove(newFragmentedFlow), nullptr);
// Reparent children preceding the fragmented flow into the fragmented flow.
flow.moveChildrenTo(m_builder, &fragmentedFlow, flow.firstChild(), &fragmentedFlow, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
@@ -317,7 +318,7 @@
// This is a guard to stop an ancestor flow thread from processing the spanner.
gShiftingSpanner = true;
- m_builder.insertChildToRenderBlock(*multicolContainer, WTFMove(takenDescendant), insertBeforeMulticolChild);
+ m_builder.blockBuilder().insertChild(*multicolContainer, WTFMove(takenDescendant), insertBeforeMulticolChild);
gShiftingSpanner = false;
// The spanner has now been moved out from the flow thread, but we don't want to
@@ -354,7 +355,7 @@
auto newSet = flow.createMultiColumnSet(RenderStyle::createAnonymousStyleWithDisplay(multicolContainer->style(), BLOCK));
newSet->initializeStyle();
auto& set = *newSet;
- m_builder.insertChildToRenderBlock(*multicolContainer, WTFMove(newSet), insertBeforeMulticolChild);
+ m_builder.blockBuilder().insertChild(*multicolContainer, WTFMove(newSet), insertBeforeMulticolChild);
flow.invalidateFragments();
// We cannot handle immediate column set siblings at the moment (and there's no need for
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -31,6 +31,7 @@
#include "RenderRubyRun.h"
#include "RenderTreeBuilder.h"
#include "RenderTreeBuilderBlock.h"
+#include "RenderTreeBuilderBlockFlow.h"
#include "RenderTreeBuilderInline.h"
namespace WebCore {
@@ -199,7 +200,7 @@
// RenderRuby has already ascertained that we can add the child here.
ASSERT(!parent.hasRubyText());
// prepend ruby texts as first child
- parent.addChild(m_builder, WTFMove(child), parent.firstChild());
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), parent.firstChild());
return;
}
if (beforeChild->isRubyText()) {
@@ -215,7 +216,7 @@
// Note: Doing it in this order and not using RenderRubyRun's methods,
// in order to avoid automatic removal of the ruby run in case there is no
// other child besides the old ruby text.
- parent.addChild(m_builder, WTFMove(child), beforeChild);
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), beforeChild);
auto takenBeforeChild = m_builder.blockBuilder().takeChild(parent, *beforeChild);
m_builder.insertChild(*newRun, WTFMove(takenBeforeChild));
@@ -252,7 +253,7 @@
if (!beforeBlock) {
auto newBlock = createAnonymousRubyInlineBlock(parent);
beforeBlock = newBlock.get();
- m_builder.insertChildToRenderBlockFlow(parent, WTFMove(newBlock), parent.firstChild());
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newBlock), parent.firstChild());
}
beforeChild = nullptr;
return *beforeBlock;
@@ -267,7 +268,7 @@
if (!afterBlock) {
auto newBlock = createAnonymousRubyInlineBlock(parent);
afterBlock = newBlock.get();
- m_builder.insertChildToRenderBlockFlow(parent, WTFMove(newBlock));
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newBlock), nullptr);
}
beforeChild = nullptr;
return *afterBlock;
@@ -296,7 +297,7 @@
if (!lastRun || lastRun->hasRubyText()) {
auto newRun = RenderRubyRun::staticCreateRubyRun(&parent);
lastRun = newRun.get();
- m_builder.insertChildToRenderBlockFlow(parent, WTFMove(newRun), beforeChild);
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(newRun), beforeChild);
}
beforeChild = nullptr;
return *lastRun;
@@ -370,7 +371,7 @@
if (!base) {
auto newBase = rubyRun.createRubyBase();
base = newBase.get();
- m_builder.insertChildToRenderBlockFlow(rubyRun, WTFMove(newBase));
+ m_builder.blockFlowBuilder().insertChild(rubyRun, WTFMove(newBase), nullptr);
}
return *base;
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp (228558 => 228559)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp 2018-02-16 15:03:59 UTC (rev 228558)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp 2018-02-16 15:13:31 UTC (rev 228559)
@@ -67,7 +67,7 @@
void RenderTreeBuilder::SVG::insertChild(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
{
auto& childToAdd = *child;
- m_builder.insertChildToRenderBlockFlow(parent, WTFMove(child), beforeChild);
+ m_builder.blockFlowBuilder().insertChild(parent, WTFMove(child), beforeChild);
SVGResourcesCache::clientWasAddedToTree(childToAdd);
parent.subtreeChildWasAdded(&childToAdd);