Commit 1a3ed711 authored by robhogan@gmail.com's avatar robhogan@gmail.com

Remove dead code from RenderBox:sizesLogicalWidthToFitContent()

Review URL: https://codereview.chromium.org/219333009

git-svn-id: svn://svn.chromium.org/blink/trunk@170695 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3915e035
......@@ -2310,7 +2310,7 @@ LayoutUnit RenderBox::computeLogicalWidthUsing(SizeType widthType, Length logica
if (shrinkToAvoidFloats() && cb->containsFloats())
logicalWidthResult = min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toRenderBlockFlow(cb)));
if (widthType == MainOrPreferredSize && sizesLogicalWidthToFitContent(widthType))
if (widthType == MainOrPreferredSize && sizesLogicalWidthToFitContent(logicalWidth))
return max(minPreferredLogicalWidth(), min(maxPreferredLogicalWidth(), logicalWidthResult));
return logicalWidthResult;
}
......@@ -2338,16 +2338,13 @@ static bool isStretchingColumnFlexItem(const RenderObject* flexitem)
return false;
}
bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const
bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
{
// Marquees in WinIE are like a mixture of blocks and inline-blocks. They size as though they're blocks,
// but they allow text to sit on the same line as the marquee.
if (isFloating() || (isInlineBlockOrInlineTable() && !isMarquee()))
return true;
// This code may look a bit strange. Basically width:intrinsic should clamp the size when testing both
// min-width and width. max-width is only clamped if it is also intrinsic.
Length logicalWidth = (widthType == MaxSize) ? style()->logicalMaxWidth() : style()->logicalWidth();
if (logicalWidth.type() == Intrinsic)
return true;
......@@ -2384,7 +2381,7 @@ bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const
// stretching column flexbox.
// FIXME: Think about block-flow here.
// https://bugs.webkit.org/show_bug.cgi?id=46473
if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && autoWidthShouldFitContent())
if (logicalWidth.isAuto() && !isStretchingColumnFlexItem(this) && autoWidthShouldFitContent())
return true;
if (isHorizontalWritingMode() != containingBlock()->isHorizontalWritingMode())
......
......@@ -438,7 +438,7 @@ public:
// Whether or not the element shrinks to its intrinsic width (rather than filling the width
// of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
bool sizesLogicalWidthToFitContent(SizeType) const;
bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const;
LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlockFlow* cb) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment