Remove layoutBlock.

We've simplified RenderBlock::layout to the point where we
no longer need it or layoutBlock. The RenderBlock subclasses
can just override layout the way every other renderer does.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/876663003
This commit is contained in:
Ojan Vafai 2015-01-26 21:33:43 -08:00
parent 88f2015c22
commit bebd6e370d
6 changed files with 11 additions and 29 deletions

View File

@ -304,12 +304,6 @@ void RenderBlock::updateScrollInfoAfterLayout()
}
}
void RenderBlock::layout()
{
// FIXME(sky): Inline layoutBlock here and get rid of it.
layoutBlock(false);
}
bool RenderBlock::widthAvailableToChildrenHasChanged()
{
bool widthAvailableToChildrenHasChanged = m_hasBorderOrPaddingLogicalWidthChanged;
@ -329,12 +323,6 @@ bool RenderBlock::updateLogicalWidthAndColumnWidth()
return oldWidth != logicalWidth() || widthAvailableToChildrenHasChanged();
}
void RenderBlock::layoutBlock(bool)
{
ASSERT_NOT_REACHED();
clearNeedsLayout();
}
void RenderBlock::addOverflowFromChildren()
{
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {

View File

@ -94,8 +94,6 @@ public:
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) override;
virtual void removeChild(RenderObject*) override;
virtual void layoutBlock(bool relayoutChildren);
void insertPositionedObject(RenderBox*);
static void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContainingBlock);
@ -208,8 +206,6 @@ protected:
void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&);
virtual void layout() override;
enum PositionedLayoutBehavior {
DefaultLayout,
ForcedLayoutAfterContainingBlockMoved

View File

@ -65,17 +65,17 @@ bool RenderBlockFlow::updateLogicalWidthAndColumnWidth()
return RenderBlock::updateLogicalWidthAndColumnWidth();
}
void RenderBlockFlow::layoutBlock(bool relayoutChildren)
void RenderBlockFlow::layout()
{
ASSERT(needsLayout());
ASSERT(isInlineBlock() || !isInline());
if (!relayoutChildren && simplifiedLayout())
if (simplifiedLayout())
return;
SubtreeLayoutScope layoutScope(*this);
layoutBlockFlow(relayoutChildren, layoutScope);
layoutBlockFlow(layoutScope);
updateLayerTransformAfterLayout();
@ -86,11 +86,11 @@ void RenderBlockFlow::layoutBlock(bool relayoutChildren)
clearNeedsLayout();
}
inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope& layoutScope)
inline void RenderBlockFlow::layoutBlockFlow(SubtreeLayoutScope& layoutScope)
{
LayoutUnit oldLeft = logicalLeft();
bool logicalWidthChanged = updateLogicalWidthAndColumnWidth();
relayoutChildren |= logicalWidthChanged;
bool relayoutChildren = logicalWidthChanged;
LayoutState state(*this, locationOffset(), logicalWidthChanged);

View File

@ -55,7 +55,7 @@ public:
virtual bool isRenderBlockFlow() const override final { return true; }
virtual void layoutBlock(bool relayoutChildren) override;
void layout() override;
virtual void deleteLineBoxTree() override final;
@ -122,7 +122,7 @@ protected:
void determineLogicalLeftPositionForChild(RenderBox* child);
private:
void layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope&);
void layoutBlockFlow(SubtreeLayoutScope&);
void layoutBlockChild(RenderBox* child);
void adjustPositionedBlock(RenderBox* child);

View File

@ -213,16 +213,14 @@ void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle*
}
}
void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
void RenderFlexibleBox::layout()
{
ASSERT(needsLayout());
if (!relayoutChildren && simplifiedLayout())
if (simplifiedLayout())
return;
if (updateLogicalWidthAndColumnWidth())
relayoutChildren = true;
bool relayoutChildren = updateLogicalWidthAndColumnWidth();
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight());

View File

@ -46,7 +46,7 @@ public:
virtual const char* renderName() const override;
virtual bool isFlexibleBox() const override final { return true; }
virtual void layoutBlock(bool relayoutChildren) override final;
void layout() final;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
virtual int firstLineBoxBaseline() const override;