mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Get rid of isWritingModeRoot.
This function always returns false now that we don't have writing modes. TBR=esprehn@chromium.org Remove flipForWritingMode. It's a noop now that we don't have writing modes. Review URL: https://codereview.chromium.org/688223002
This commit is contained in:
parent
13ffe46a43
commit
86ed666dc2
@ -1083,8 +1083,7 @@ void RenderBlock::addOverflowFromPositionedObjects()
|
||||
|
||||
bool RenderBlock::createsBlockFormattingContext() const
|
||||
{
|
||||
return isInlineBlock() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
|
||||
|| isWritingModeRoot() || isDocumentElement();
|
||||
return isInlineBlock() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated() || isDocumentElement();
|
||||
}
|
||||
|
||||
void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* child)
|
||||
@ -1542,7 +1541,7 @@ bool RenderBlock::isSelectionRoot() const
|
||||
if (isDocumentElement() || hasOverflowClip()
|
||||
|| isPositioned() || isFloating()
|
||||
|| isInlineBlock()
|
||||
|| hasTransform() || hasMask() || isWritingModeRoot()
|
||||
|| hasTransform() || hasMask()
|
||||
|| isFlexItemIncludingDeprecated())
|
||||
return true;
|
||||
|
||||
@ -2571,7 +2570,7 @@ int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin
|
||||
// We also give up on finding a baseline if we have a vertical scrollbar, or if we are scrolled
|
||||
// vertically (e.g., an overflow:hidden block that has had scrollTop moved).
|
||||
bool ignoreBaseline = (layer() && layer()->scrollableArea() && ((direction == HorizontalLine ? (layer()->scrollableArea()->verticalScrollbar() || layer()->scrollableArea()->scrollYOffset())
|
||||
: (layer()->scrollableArea()->horizontalScrollbar() || layer()->scrollableArea()->scrollXOffset())))) || isWritingModeRoot();
|
||||
: (layer()->scrollableArea()->horizontalScrollbar() || layer()->scrollableArea()->scrollXOffset()))));
|
||||
|
||||
int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction);
|
||||
|
||||
@ -2599,9 +2598,6 @@ LayoutUnit RenderBlock::minLineHeightForReplacedRenderer(bool isFirstLine, Layou
|
||||
|
||||
int RenderBlock::firstLineBoxBaseline() const
|
||||
{
|
||||
if (isWritingModeRoot())
|
||||
return -1;
|
||||
|
||||
if (childrenInline()) {
|
||||
if (firstLineBox())
|
||||
return firstLineBox()->logicalTop() + style(true)->fontMetrics().ascent(firstRootBox()->baselineType());
|
||||
@ -2633,9 +2629,6 @@ int RenderBlock::inlineBlockBaseline(LineDirectionMode direction) const
|
||||
|
||||
int RenderBlock::lastLineBoxBaseline(LineDirectionMode lineDirection) const
|
||||
{
|
||||
if (isWritingModeRoot())
|
||||
return -1;
|
||||
|
||||
if (childrenInline()) {
|
||||
if (!firstLineBox() && hasLineIfEmpty()) {
|
||||
const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics();
|
||||
@ -2934,40 +2927,24 @@ RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* par
|
||||
|
||||
LayoutUnit RenderBlock::collapsedMarginBeforeForChild(const RenderBox* child) const
|
||||
{
|
||||
// If the child has the same directionality as we do, then we can just return its
|
||||
// collapsed margin.
|
||||
if (!child->isWritingModeRoot())
|
||||
return child->collapsedMarginBefore();
|
||||
return child->collapsedMarginAfter();
|
||||
// FIXME(sky): Remove
|
||||
return child->collapsedMarginBefore();
|
||||
}
|
||||
|
||||
LayoutUnit RenderBlock::collapsedMarginAfterForChild(const RenderBox* child) const
|
||||
{
|
||||
// If the child has the same directionality as we do, then we can just return its
|
||||
// collapsed margin.
|
||||
if (!child->isWritingModeRoot())
|
||||
return child->collapsedMarginAfter();
|
||||
return child->collapsedMarginBefore();
|
||||
// FIXME(sky): Remove
|
||||
return child->collapsedMarginAfter();
|
||||
}
|
||||
|
||||
bool RenderBlock::hasMarginBeforeQuirk(const RenderBox* child) const
|
||||
{
|
||||
// If the child has the same directionality as we do, then we can just return its
|
||||
// margin quirk.
|
||||
if (!child->isWritingModeRoot())
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginBeforeQuirk() : child->style()->hasMarginBeforeQuirk();
|
||||
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() : child->style()->hasMarginAfterQuirk();
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginBeforeQuirk() : child->style()->hasMarginBeforeQuirk();
|
||||
}
|
||||
|
||||
bool RenderBlock::hasMarginAfterQuirk(const RenderBox* child) const
|
||||
{
|
||||
// If the child has the same directionality as we do, then we can just return its
|
||||
// margin quirk.
|
||||
if (!child->isWritingModeRoot())
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() : child->style()->hasMarginAfterQuirk();
|
||||
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginBeforeQuirk() : child->style()->hasMarginBeforeQuirk();
|
||||
return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() : child->style()->hasMarginAfterQuirk();
|
||||
}
|
||||
|
||||
const char* RenderBlock::renderName() const
|
||||
|
||||
@ -394,8 +394,7 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo,
|
||||
if (childRenderBlockFlow) {
|
||||
if (markDescendantsWithFloats)
|
||||
childRenderBlockFlow->markAllDescendantsWithFloatsForLayout();
|
||||
if (!child->isWritingModeRoot())
|
||||
previousFloatLogicalBottom = std::max(previousFloatLogicalBottom, oldLogicalTop + childRenderBlockFlow->lowestFloatLogicalBottom());
|
||||
previousFloatLogicalBottom = std::max(previousFloatLogicalBottom, oldLogicalTop + childRenderBlockFlow->lowestFloatLogicalBottom());
|
||||
}
|
||||
|
||||
SubtreeLayoutScope layoutScope(*child);
|
||||
@ -864,7 +863,7 @@ void RenderBlockFlow::marginBeforeEstimateForChild(RenderBox* child, LayoutUnit&
|
||||
return;
|
||||
|
||||
RenderBlockFlow* childBlockFlow = toRenderBlockFlow(child);
|
||||
if (childBlockFlow->childrenInline() || childBlockFlow->isWritingModeRoot())
|
||||
if (childBlockFlow->childrenInline())
|
||||
return;
|
||||
|
||||
MarginInfo childMarginInfo(childBlockFlow, childBlockFlow->borderBefore() + childBlockFlow->paddingBefore(), childBlockFlow->borderAfter() + childBlockFlow->paddingAfter());
|
||||
@ -1063,18 +1062,14 @@ bool RenderBlockFlow::mustSeparateMarginBeforeForChild(const RenderBox* child) c
|
||||
{
|
||||
ASSERT(!child->selfNeedsLayout());
|
||||
const RenderStyle* childStyle = child->style();
|
||||
if (!child->isWritingModeRoot())
|
||||
return childStyle->marginBeforeCollapse() == MSEPARATE;
|
||||
return childStyle->marginAfterCollapse() == MSEPARATE;
|
||||
return childStyle->marginBeforeCollapse() == MSEPARATE;
|
||||
}
|
||||
|
||||
bool RenderBlockFlow::mustSeparateMarginAfterForChild(const RenderBox* child) const
|
||||
{
|
||||
ASSERT(!child->selfNeedsLayout());
|
||||
const RenderStyle* childStyle = child->style();
|
||||
if (!child->isWritingModeRoot())
|
||||
return childStyle->marginAfterCollapse() == MSEPARATE;
|
||||
return childStyle->marginBeforeCollapse() == MSEPARATE;
|
||||
return childStyle->marginAfterCollapse() == MSEPARATE;
|
||||
}
|
||||
|
||||
void RenderBlockFlow::addOverflowFromFloats()
|
||||
|
||||
@ -3462,7 +3462,7 @@ static bool isReplacedElement(Node* node)
|
||||
|
||||
bool RenderBox::avoidsFloats() const
|
||||
{
|
||||
return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isWritingModeRoot() || isFlexItemIncludingDeprecated();
|
||||
return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isFlexItemIncludingDeprecated();
|
||||
}
|
||||
|
||||
InvalidationReason RenderBox::getPaintInvalidationReason(const RenderLayerModelObject& paintInvalidationContainer,
|
||||
|
||||
@ -509,8 +509,6 @@ public:
|
||||
bool shrinkToAvoidFloats() const;
|
||||
virtual bool avoidsFloats() const;
|
||||
|
||||
bool isWritingModeRoot() const { return false; }
|
||||
|
||||
bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloatingOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBox(); }
|
||||
|
||||
virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
|
||||
|
||||
@ -142,7 +142,7 @@ int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode di
|
||||
|
||||
int RenderFlexibleBox::firstLineBoxBaseline() const
|
||||
{
|
||||
if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0)
|
||||
if (m_numberOfInFlowChildrenOnFirstLine <= 0)
|
||||
return -1;
|
||||
RenderBox* baselineChild = 0;
|
||||
int childNumber = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user