Changeset 189567 in webkit


Ignore:
Timestamp:
Sep 10, 2015 4:58:24 AM (9 years ago)
Author:
svillar@igalia.com
Message:

min-width/height should default to auto for flexbox items
https://bugs.webkit.org/show_bug.cgi?id=146020

Reviewed by David Hyatt.

Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.

Source/WebCore:

As specified here
http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
value of min-{width|height} is auto for flex items.

In case this patch breaks any website (as it's changing the
default value of those properties) the fix is likely to add:

min-width: 0;
min-height: 0;

to any relevant flexitems.

Test: css3/flexbox/min-size-auto.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
(WebCore::ComputedStyleExtractor::propertyValue): Return auto
for flex items if min-width/height is auto.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • html/shadow/SliderThumbElement.cpp:
  • rendering/RenderBox.cpp:

(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeight):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalWidthUsing):
(WebCore::RenderBox::computePositionedLogicalHeight):
(WebCore::RenderBox::computePositionedLogicalHeightUsing):

  • rendering/RenderBox.h:
  • rendering/RenderButton.h:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
(WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
(WebCore::RenderFlexibleBox::mainAxisOverflowForChild):

  • rendering/RenderFlexibleBox.h:

(WebCore::RenderFlexibleBox::isFlexibleBoxImpl):

  • rendering/RenderFullScreen.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):

  • rendering/RenderMediaControlElements.h:
  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
the min-width explicitly.

  • rendering/RenderMenuList.h:
  • rendering/RenderMultiColumnSet.cpp:

(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):

  • rendering/RenderNamedFlowFragment.cpp:

(WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):

  • rendering/RenderSlider.h:
  • rendering/RenderTextControl.h:
  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
the min-width explicitly.

  • rendering/mathml/RenderMathMLBlock.h:
  • rendering/style/RenderStyle.h:

LayoutTests:

  • TestExpectations: Removed passing flexbox tests.
  • css3/flexbox/csswg/flex-flow-007.html: Added min-height: 0px.
  • css3/flexbox/flexbox-baseline.html: Ditto.
  • css3/flexbox/min-size-auto-expected.txt: Added.
  • css3/flexbox/min-size-auto.html: Added.
  • css3/flexbox/preferred-widths-orthogonal.html: Added min-height: 0px.
  • fast/css/auto-min-size-expected.txt: Check default computed

styles for min-width/height for flex items.

  • fast/css/auto-min-size.html: Ditto.
Location:
trunk
Files:
2 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r189566 r189567  
     12015-09-10  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        min-width/height should default to auto for flexbox items
     4        https://bugs.webkit.org/show_bug.cgi?id=146020
     5
     6        Reviewed by David Hyatt.
     7
     8        Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
     9
     10        * TestExpectations: Removed passing flexbox tests.
     11        * css3/flexbox/csswg/flex-flow-007.html: Added min-height: 0px.
     12        * css3/flexbox/flexbox-baseline.html: Ditto.
     13        * css3/flexbox/min-size-auto-expected.txt: Added.
     14        * css3/flexbox/min-size-auto.html: Added.
     15        * css3/flexbox/preferred-widths-orthogonal.html: Added min-height: 0px.
     16        * fast/css/auto-min-size-expected.txt: Check default computed
     17        styles for min-width/height for flex items.
     18        * fast/css/auto-min-size.html: Ditto.
     19
    1202015-09-10  ChangSeok Oh  <changseok.oh@collabora.com>
    221
  • trunk/LayoutTests/TestExpectations

    r189542 r189567  
    204204webkit.org/b/136754 css3/flexbox/csswg/flex-lines/multi-line-wrap-reverse-column-reverse.html [ ImageOnlyFailure ]
    205205webkit.org/b/136754 css3/flexbox/csswg/flex-lines/multi-line-wrap-with-column-reverse.html [ ImageOnlyFailure ]
    206 webkit.org/b/136754 css3/flexbox/csswg/flex-margin-no-collapse.html [ ImageOnlyFailure ]
    207206webkit.org/b/136754 css3/flexbox/csswg/flexbox-flex-wrap-flexing.html [ ImageOnlyFailure ]
    208 webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-0-0.html [ ImageOnlyFailure ]
    209 webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-1-0.html [ ImageOnlyFailure ]
    210 webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-0-N-0.html [ ImageOnlyFailure ]
    211207webkit.org/b/136754 css3/flexbox/csswg/flexbox_flex-natural-mixed-basis-auto.html [ ImageOnlyFailure ]
    212208webkit.org/b/136754 css3/flexbox/csswg/flexbox_generated-container.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/css3/flexbox/csswg/flex-flow-007.html

    r189541 r189567  
    2323    height: 50px;
    2424  }
     25  :not(#test) div {
     26    min-height: 0px;
     27  }
    2528</style>
    2629<body>
  • trunk/LayoutTests/css3/flexbox/flexbox-baseline.html

    r189541 r189567  
    7474should align with the middle
    7575<div class="inline-flexbox" style="width: 40px; height: 40px">
    76     <div style="-webkit-writing-mode: vertical-rl; height: 20px; width: 40px; border-bottom: 1px solid black"></div>
     76    <div style="-webkit-writing-mode: vertical-rl; height: 20px; width: 40px; border-bottom: 1px solid black; min-height: 0px;"></div>
    7777</div>
    7878of the grey flexbox
     
    112112should align with the middle
    113113<div class="inline-flexbox column" style="width: 40px; height: 40px;">
    114     <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; border-bottom: 1px solid black"></div>
    115     <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px"></div>
     114    <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; border-bottom: 1px solid black; min-height: 0px;"></div>
     115    <div style="-webkit-writing-mode: vertical-rl; width: 40px; height: 20px; min-height: 0px;"></div>
    116116</div>
    117117of the grey flexbox
  • trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html

    r189541 r189567  
    7373
    7474<div class="flexbox vertical-lr" data-expected-height=115  data-expect-width=80>
    75     <div class="horizontal-tb nested" data-expected-height=80  data-expect-width=50>
     75    <div class="horizontal-tb nested" data-expected-height=80  data-expect-width=50 style="min-height: 0px;">
    7676        <div class="vertical-lr nested" data-expected-height=80  data-expect-width=30>
    7777            <div></div>
     
    9494
    9595<div class="flexbox vertical-lr" data-expected-height=65  data-expect-width=70>
    96     <div class="nested horizontal-tb" data-expected-height=30  data-expect-width=40>
     96    <div class="nested horizontal-tb" data-expected-height=30  data-expect-width=40 style="min-height: 0px;">
    9797        <div></div>
    9898        <div></div>
  • trunk/LayoutTests/fast/css/auto-min-size-expected.txt

    r189541 r189567  
    11PASS div.style.minWidth is ""
    22PASS getComputedStyle(div)["min-width"] is "0px"
    3 PASS div.style.minWidth is ""
     3PASS div.style.minWidth is "auto"
    44PASS div.style.maxWidth is ""
    55PASS getComputedStyle(div).minWidth is "0px"
     
    88PASS div.style.minHeight is ""
    99PASS getComputedStyle(div)["min-height"] is "0px"
    10 PASS div.style.minHeight is ""
     10PASS div.style.minHeight is "auto"
    1111PASS div.style.maxHeight is ""
    1212PASS getComputedStyle(div).minHeight is "0px"
    1313PASS div.style.minHeight is "0px"
    1414PASS getComputedStyle(div)["min-height"] is "0px"
     15PASS flexitem.style.minWidth is ""
     16PASS getComputedStyle(flexitem)["min-width"] is "auto"
     17PASS flexitem.style.minWidth is "auto"
     18PASS flexitem.style.maxWidth is ""
     19PASS getComputedStyle(flexitem).minWidth is "auto"
     20PASS flexitem.style.minWidth is "0px"
     21PASS getComputedStyle(flexitem)["min-width"] is "0px"
     22PASS flexitem.style.minHeight is ""
     23PASS getComputedStyle(flexitem)["min-height"] is "auto"
     24PASS flexitem.style.minHeight is "auto"
     25PASS flexitem.style.maxHeight is ""
     26PASS getComputedStyle(flexitem).minHeight is "auto"
     27PASS flexitem.style.minHeight is "0px"
     28PASS getComputedStyle(flexitem)["min-height"] is "0px"
    1529PASS successfullyParsed is true
    1630
  • trunk/LayoutTests/fast/css/auto-min-size.html

    r189541 r189567  
    22<script src='../../resources/js-test-pre.js'></script>
    33<div id=foo></div>
     4<div id="flexbox" style="display: flex;"><div id="flexitem"></div></div>
    45<script>
    56div = document.getElementById('foo');
     
    910div.style.minWidth = 'auto';
    1011div.style.maxWidth = 'auto';
    11 shouldBe('div.style.minWidth', '""');
     12shouldBe('div.style.minWidth', '"auto"');
    1213shouldBe('div.style.maxWidth', '""');
    1314shouldBe('getComputedStyle(div).minWidth', '"0px"');
     
    2223div.style.minHeight = 'auto';
    2324div.style.maxHeight = 'auto';
    24 shouldBe('div.style.minHeight', '""');
     25shouldBe('div.style.minHeight', '"auto"');
    2526shouldBe('div.style.maxHeight', '""');
    2627shouldBe('getComputedStyle(div).minHeight', '"0px"');
     
    3031shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
    3132
     33var flexitem = document.getElementById("flexitem");
     34shouldBe('flexitem.style.minWidth', '""');
     35shouldBe('getComputedStyle(flexitem)["min-width"]', '"auto"');
     36
     37flexitem.style.minWidth = 'auto';
     38flexitem.style.maxWidth = 'auto';
     39shouldBe('flexitem.style.minWidth', '"auto"');
     40shouldBe('flexitem.style.maxWidth', '""');
     41shouldBe('getComputedStyle(flexitem).minWidth', '"auto"');
     42
     43flexitem.style.minWidth = 0;
     44shouldBe('flexitem.style.minWidth', '"0px"');
     45shouldBe('getComputedStyle(flexitem)["min-width"]', '"0px"');
     46
     47shouldBe('flexitem.style.minHeight', '""');
     48shouldBe('getComputedStyle(flexitem)["min-height"]', '"auto"');
     49
     50flexitem.style.minHeight = 'auto';
     51flexitem.style.maxHeight = 'auto';
     52shouldBe('flexitem.style.minHeight', '"auto"');
     53shouldBe('flexitem.style.maxHeight', '""');
     54shouldBe('getComputedStyle(flexitem).minHeight', '"auto"');
     55
     56flexitem.style.minHeight = 0;
     57shouldBe('flexitem.style.minHeight', '"0px"');
     58shouldBe('getComputedStyle(flexitem)["min-height"]', '"0px"');
    3259</script>
    3360<script src='../../resources/js-test-post.js'></script>
  • trunk/Source/WebCore/ChangeLog

    r189566 r189567  
     12015-09-10  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        min-width/height should default to auto for flexbox items
     4        https://bugs.webkit.org/show_bug.cgi?id=146020
     5
     6        Reviewed by David Hyatt.
     7
     8        Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
     9
     10        As specified here
     11        http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
     12        value of min-{width|height} is auto for flex items.
     13
     14        In case this patch breaks any website (as it's changing the
     15        default value of those properties) the fix is likely to add:
     16
     17        min-width: 0;
     18        min-height: 0;
     19
     20        to any relevant flexitems.
     21
     22        Test: css3/flexbox/min-size-auto.html
     23
     24        * css/CSSComputedStyleDeclaration.cpp:
     25        (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
     26        (WebCore::ComputedStyleExtractor::propertyValue): Return auto
     27        for flex items if min-width/height is auto.
     28        * css/CSSParser.cpp:
     29        (WebCore::CSSParser::parseValue):
     30        * html/shadow/SliderThumbElement.cpp:
     31        * rendering/RenderBox.cpp:
     32        (WebCore::RenderBox::constrainLogicalHeightByMinMax):
     33        (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
     34        (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
     35        (WebCore::RenderBox::computeLogicalHeight):
     36        (WebCore::RenderBox::computeLogicalHeightUsing):
     37        (WebCore::RenderBox::computeContentLogicalHeight):
     38        (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
     39        (WebCore::RenderBox::computeReplacedLogicalWidth):
     40        (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
     41        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     42        (WebCore::RenderBox::computeReplacedLogicalHeight):
     43        (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
     44        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     45        (WebCore::RenderBox::availableLogicalHeightUsing):
     46        (WebCore::RenderBox::computePositionedLogicalWidth):
     47        (WebCore::RenderBox::computePositionedLogicalWidthUsing):
     48        (WebCore::RenderBox::computePositionedLogicalHeight):
     49        (WebCore::RenderBox::computePositionedLogicalHeightUsing):
     50        * rendering/RenderBox.h:
     51        * rendering/RenderButton.h:
     52        * rendering/RenderFlexibleBox.cpp:
     53        (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
     54        (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
     55        (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
     56        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
     57        (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
     58        * rendering/RenderFlexibleBox.h:
     59        (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
     60        * rendering/RenderFullScreen.h:
     61        * rendering/RenderGrid.cpp:
     62        (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
     63        * rendering/RenderMediaControlElements.h:
     64        * rendering/RenderMenuList.cpp:
     65        (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
     66        the min-width explicitly.
     67        * rendering/RenderMenuList.h:
     68        * rendering/RenderMultiColumnSet.cpp:
     69        (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
     70        * rendering/RenderNamedFlowFragment.cpp:
     71        (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
     72        * rendering/RenderReplaced.cpp:
     73        (WebCore::RenderReplaced::computeReplacedLogicalWidth):
     74        (WebCore::RenderReplaced::computeReplacedLogicalHeight):
     75        * rendering/RenderSlider.h:
     76        * rendering/RenderTextControl.h:
     77        * rendering/RenderTextControlSingleLine.cpp:
     78        (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
     79        the min-width explicitly.
     80        * rendering/mathml/RenderMathMLBlock.h:
     81        * rendering/style/RenderStyle.h:
     82
    1832015-09-10  ChangSeok Oh  <changseok.oh@collabora.com>
    284
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r189541 r189567  
    19001900}
    19011901
     1902inline static bool isFlexOrGrid(ContainerNode* element)
     1903{
     1904    return element && element->computedStyle() && element->computedStyle()->isDisplayFlexibleOrGridBox();
     1905}
     1906
    19021907RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
    19031908{
     
    24932498        }
    24942499        case CSSPropertyMinHeight:
    2495             // FIXME: For flex-items, min-height:auto should compute to min-content.
    2496             if (style->minHeight().isAuto())
     2500            if (style->minHeight().isAuto()) {
     2501                if (isFlexOrGrid(styledNode->parentNode()))
     2502                    return cssValuePool.createIdentifierValue(CSSValueAuto);
    24972503                return zoomAdjustedPixelValue(0, *style);
     2504            }
    24982505            return zoomAdjustedPixelValueForLength(style->minHeight(), *style);
    24992506        case CSSPropertyMinWidth:
    2500             // FIXME: For flex-items, min-width:auto should compute to min-content.
    2501             if (style->minWidth().isAuto())
     2507            if (style->minWidth().isAuto()) {
     2508                if (isFlexOrGrid(styledNode->parentNode()))
     2509                    return cssValuePool.createIdentifierValue(CSSValueAuto);
    25022510                return zoomAdjustedPixelValue(0, *style);
     2511            }
    25032512            return zoomAdjustedPixelValueForLength(style->minWidth(), *style);
    25042513        case CSSPropertyObjectFit:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r189541 r189567  
    22552255    case CSSPropertyMinHeight:
    22562256    case CSSPropertyWebkitMinLogicalHeight:
    2257         validPrimitive = isValidSize(valueWithCalculation);
     2257        validPrimitive = id == CSSValueAuto || isValidSize(valueWithCalculation);
    22582258        break;
    22592259
  • trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r189541 r189567  
    122122private:
    123123    virtual void layout() override;
     124    bool isFlexibleBoxImpl() const override { return true; }
    124125};
    125126
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r189541 r189567  
    647647    const RenderStyle& styleToUse = style();
    648648    if (!styleToUse.logicalMaxHeight().isUndefined()) {
    649         if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(styleToUse.logicalMaxHeight(), intrinsicContentHeight))
     649        if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
    650650            logicalHeight = std::min(logicalHeight, maxH.value());
    651651    }
    652     if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(styleToUse.logicalMinHeight(), intrinsicContentHeight))
     652    if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
    653653        return std::max(logicalHeight, computedLogicalHeight.value());
    654654    return logicalHeight;
     
    659659    const RenderStyle& styleToUse = style();
    660660    if (!styleToUse.logicalMaxHeight().isUndefined()) {
    661         if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeight(), intrinsicContentHeight))
     661        if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
    662662            logicalHeight = std::min(logicalHeight, maxH.value());
    663663    }
    664     if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(styleToUse.logicalMinHeight(), intrinsicContentHeight))
     664    if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
    665665        return std::max(logicalHeight, computedContentLogicalHeight.value());
    666666    return logicalHeight;
     
    24402440    const RenderBlock* cb, RenderRegion* region) const
    24412441{
     2442    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
     2443    if (widthType == MinSize && logicalWidth.isAuto())
     2444        return adjustBorderBoxLogicalWidthForBoxSizing(0);
     2445
    24422446    if (!logicalWidth.isIntrinsicOrAuto()) {
    24432447        // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
     
    27562760        if (checkMinMaxHeight) {
    27572761            LayoutUnit intrinsicHeight = computedValues.m_extent - borderAndPaddingLogicalHeight();
    2758             heightResult = computeLogicalHeightUsing(style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
     2762            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
    27592763            heightResult = constrainLogicalHeightByMinMax(heightResult, intrinsicHeight);
    27602764        } else {
     
    27952799}
    27962800
    2797 Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
    2798 {
    2799     if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(height, intrinsicContentHeight))
     2801Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
     2802{
     2803    if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
    28002804        return adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight.value());
    28012805    return Nullopt;
    28022806}
    28032807
    2804 Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
    2805 {
    2806     if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(height, intrinsicContentHeight))
     2808Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
     2809{
     2810    if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
    28072811        return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
    28082812    return Nullopt;
     
    28212825}
    28222826
    2823 Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
    2824 {
     2827Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
     2828{
     2829    if (height.isAuto())
     2830        return heightType == MinSize ? Optional<LayoutUnit>(0) : Nullopt;
    28252831    // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
    28262832    // If that happens, this code will have to change.
     
    29412947LayoutUnit RenderBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
    29422948{
    2943     return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
     2949    return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth()), shouldComputePreferred);
    29442950}
    29452951
    29462952LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
    29472953{
    2948     LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
    2949     LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
     2954    LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MinSize, style().logicalMinWidth());
     2955    LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MaxSize, style().logicalMaxWidth());
    29502956    return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth));
    29512957}
    29522958
    2953 LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const
    2954 {
     2959LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType widthType, Length logicalWidth) const
     2960{
     2961    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
     2962    if (widthType == MinSize && logicalWidth.isAuto())
     2963        return adjustContentBoxLogicalWidthForBoxSizing(0);
     2964
    29552965    switch (logicalWidth.type()) {
    29562966        case Fixed:
     
    29933003LayoutUnit RenderBox::computeReplacedLogicalHeight() const
    29943004{
    2995     return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
     3005    return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight()));
    29963006}
    29973007
    29983008LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
    29993009{
    3000     LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style().logicalMinHeight());
    3001     LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
     3010    LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(MinSize, style().logicalMinHeight());
     3011    LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(MaxSize, style().logicalMaxHeight());
    30023012    return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight));
    30033013}
    30043014
    3005 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const
    3006 {
     3015LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Length logicalHeight) const
     3016{
     3017    ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeight.isAuto());
     3018    if (heightType == MinSize && logicalHeight.isAuto())
     3019        return adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit>(0));
     3020
    30073021    switch (logicalHeight.type()) {
    30083022        case Fixed:
     
    30873101    }
    30883102
    3089     if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(h, Nullopt))
     3103    if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, Nullopt))
    30903104        return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
    30913105
     
    33633377   
    33643378    // Calculate constraint equation values for 'width' case.
    3365     computePositionedLogicalWidthUsing(style().logicalWidth(), containerBlock, containerDirection,
     3379    computePositionedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth(), containerBlock, containerDirection,
    33663380                                       containerLogicalWidth, bordersPlusPadding,
    33673381                                       logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    33723386        LogicalExtentComputedValues maxValues;
    33733387
    3374         computePositionedLogicalWidthUsing(style().logicalMaxWidth(), containerBlock, containerDirection,
     3388        computePositionedLogicalWidthUsing(MaxSize, style().logicalMaxWidth(), containerBlock, containerDirection,
    33753389                                           containerLogicalWidth, bordersPlusPadding,
    33763390                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    33893403        LogicalExtentComputedValues minValues;
    33903404
    3391         computePositionedLogicalWidthUsing(style().logicalMinWidth(), containerBlock, containerDirection,
     3405        computePositionedLogicalWidthUsing(MinSize, style().logicalMinWidth(), containerBlock, containerDirection,
    33923406                                           containerLogicalWidth, bordersPlusPadding,
    33933407                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    34343448}
    34353449
    3436 void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     3450void RenderBox::computePositionedLogicalWidthUsing(SizeType widthType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    34373451                                                   LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    34383452                                                   Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    34393453                                                   LogicalExtentComputedValues& computedValues) const
    34403454{
    3441     if (logicalWidth.isIntrinsic())
     3455    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
     3456    if (widthType == MinSize && logicalWidth.isAuto())
     3457        logicalWidth = Length(0, Fixed);
     3458    else if (logicalWidth.isIntrinsic())
    34423459        logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, containerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed);
    34433460
     
    36793696    // Calculate constraint equation values for 'height' case.
    36803697    LayoutUnit logicalHeight = computedValues.m_extent;
    3681     computePositionedLogicalHeightUsing(styleToUse.logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3698    computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse.logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    36823699                                        logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    36833700                                        computedValues);
     
    36903707        LogicalExtentComputedValues maxValues;
    36913708
    3692         computePositionedLogicalHeightUsing(styleToUse.logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3709        computePositionedLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    36933710                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    36943711                                            maxValues);
     
    37063723        LogicalExtentComputedValues minValues;
    37073724
    3708         computePositionedLogicalHeightUsing(styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3725        computePositionedLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    37093726                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    37103727                                            minValues);
     
    37623779}
    37633780
    3764 void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
     3781void RenderBox::computePositionedLogicalHeightUsing(SizeType heightType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    37653782                                                    LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
    37663783                                                    Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
    37673784                                                    LogicalExtentComputedValues& computedValues) const
    37683785{
     3786    ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeightLength.isAuto());
     3787    if (heightType == MinSize && logicalHeightLength.isAuto())
     3788        logicalHeightLength = Length(0, Fixed);
     3789
    37693790    // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
    37703791    // converted to the static position in computePositionedLogicalHeight()
  • trunk/Source/WebCore/rendering/RenderBox.h

    r189541 r189567  
    422422
    423423    LayoutUnit computeLogicalWidthInRegionUsing(SizeType, Length logicalWidth, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*) const;
    424     Optional<LayoutUnit> computeLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
    425     Optional<LayoutUnit> computeContentLogicalHeight(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
    426     Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
    427     LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
     424    Optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
     425    Optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
     426    Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
     427    LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
    428428    LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred  = ComputeActual) const;
    429     LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;
     429    LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const;
    430430    LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const;
    431431
     
    688688
    689689    void computePositionedLogicalHeight(LogicalExtentComputedValues&) const;
    690     void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     690    void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    691691                                            LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    692692                                            Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    693693                                            LogicalExtentComputedValues&) const;
    694     void computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
     694    void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    695695                                             LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
    696696                                             Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
  • trunk/Source/WebCore/rendering/RenderButton.h

    r189541 r189567  
    7777    void timerFired();
    7878
     79    bool isFlexibleBoxImpl() const override { return true; }
     80
    7981    RenderTextFragment* m_buttonText;
    8082    RenderBlock* m_inner;
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r189541 r189567  
    456456        if (size.isIntrinsic())
    457457            child.layoutIfNeeded();
    458         return child.computeContentLogicalHeight(size, child.logicalHeight() - child.borderAndPaddingLogicalHeight());
     458        return child.computeContentLogicalHeight(sizeType, size, child.logicalHeight() - child.borderAndPaddingLogicalHeight());
    459459    }
    460460    // FIXME: Figure out how this should work for regions and pass in the appropriate values.
     
    645645{
    646646    return isHorizontalFlow() ? child.horizontalBorderAndPaddingExtent() : child.verticalBorderAndPaddingExtent();
     647}
     648
     649bool RenderFlexibleBox::mainAxisExtentIsDefinite() const
     650{
     651    return isColumnFlow() ? hasDefiniteLogicalHeight() : hasDefiniteLogicalWidth();
     652}
     653
     654bool RenderFlexibleBox::mainAxisLengthIsIndefinite(const Length& flexBasis) const
     655{
     656    return flexBasis.isAuto() || (flexBasis.isPercentOrCalculated() && !mainAxisExtentIsDefinite());
    647657}
    648658
     
    846856{
    847857    Length max = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight();
    848     if (max.isSpecifiedOrIntrinsic())
    849         childSize = std::min(childSize, computeMainAxisExtentForChild(child, MaxSize, max).valueOr(childSize));
     858    Optional<LayoutUnit> maxExtent = Nullopt;
     859    if (max.isSpecifiedOrIntrinsic()) {
     860        maxExtent = computeMainAxisExtentForChild(child, MaxSize, max);
     861        childSize = std::min(childSize, maxExtent.valueOr(childSize));
     862    }
    850863
    851864    Length min = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight();
    852865    if (min.isSpecifiedOrIntrinsic())
    853866        return std::max(childSize, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize));
     867
     868    if (!isFlexibleBoxImpl() && min.isAuto() && mainAxisOverflowForChild(child) == OVISIBLE) {
     869        // This is the implementation of CSS flexbox section 4.5 which defines the minimum size of "pure" flex
     870        // items. For any other item the value should be 0, this also includes RenderFlexibleBox's derived clases
     871        // (RenderButton, RenderFullScreen...) because that's just an implementation detail.
     872        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).valueOr(0);
     873        ASSERT(computeMainAxisExtentForChild(child, MinSize, Length(MinContent)));
     874        contentSize = std::min(contentSize, maxExtent.valueOr(contentSize));
     875
     876        Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
     877        if (!mainAxisLengthIsIndefinite(mainSize)) {
     878            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).valueOr(0);
     879            ASSERT(computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize));
     880            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.valueOr(resolvedMainSize));
     881
     882            return std::max(childSize, std::min(specifiedSize, contentSize));
     883        }
     884        return std::max(childSize, contentSize);
     885    }
    854886    return childSize;
    855887}
     
    10491081    if (hasAutoMarginsInCrossAxis(child))
    10501082        child.updateLogicalHeight();
     1083}
     1084
     1085EOverflow RenderFlexibleBox::mainAxisOverflowForChild(RenderBox& child) const
     1086{
     1087    if (isHorizontalFlow())
     1088        return child.style().overflowX();
     1089    return child.style().overflowY();
    10511090}
    10521091
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r189541 r189567  
    123123    LayoutUnit mainAxisScrollbarExtentForChild(RenderBox& child) const;
    124124    LayoutUnit preferredMainAxisContentExtentForChild(RenderBox& child, bool hasInfiniteLineLength);
     125    EOverflow mainAxisOverflowForChild(RenderBox&) const;
    125126
    126127    void layoutFlexItems(bool relayoutChildren, Vector<LineContext>&);
     
    158159    void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStartEdge);
    159160
     161    bool mainAxisExtentIsDefinite() const;
     162    bool mainAxisLengthIsIndefinite(const Length& flexBasis) const;
     163
     164    virtual bool isFlexibleBoxImpl() const { return false; };
     165
    160166    mutable OrderIterator m_orderIterator;
    161167    int m_numberOfInFlowChildrenOnFirstLine;
  • trunk/Source/WebCore/rendering/RenderFullScreen.h

    r189541 r189567  
    4949    virtual bool isRenderFullScreen() const override { return true; }
    5050    virtual void willBeDestroyed() override;
     51    bool isFlexibleBoxImpl() const override { return true; }
    5152
    5253protected:
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r189550 r189567  
    453453    if (direction == ForColumns)
    454454        return valueForLength(trackLength, logicalWidth() - borderAndPaddingLogicalWidth());
    455     return valueForLength(trackLength, computeContentLogicalHeight(style().logicalHeight(), Nullopt).valueOr(0));
     455    return valueForLength(trackLength, computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt).valueOr(0));
    456456}
    457457
  • trunk/Source/WebCore/rendering/RenderMediaControlElements.h

    r189541 r189567  
    5353private:
    5454    virtual void layout() override;
     55    bool isFlexibleBoxImpl() const override { return true; }
    5556};
    5657
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r189541 r189567  
    114114    innerStyle.setFlexShrink(1);
    115115    // min-width: 0; is needed for correct shrinking.
    116     // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=111790 is fixed.
    117116    innerStyle.setMinWidth(Length(0, Fixed));
    118117    // Use margin:auto instead of align-items:center to get safe centering, i.e.
  • trunk/Source/WebCore/rendering/RenderMenuList.h

    r189541 r189567  
    137137    void didUpdateActiveOption(int optionIndex);
    138138
     139    bool isFlexibleBoxImpl() const override { return true; }
     140
    139141    RenderText* m_buttonText;
    140142    RenderBlock* m_innerBlock;
  • trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp

    r189541 r189567  
    416416    LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFlowThread::maxLogicalHeight();
    417417    if (!multicolStyle.logicalMaxHeight().isUndefined())
    418         maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(multicolStyle.logicalMaxHeight(), Nullopt).valueOr(maxColumnHeight));
     418        maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), Nullopt).valueOr(maxColumnHeight));
    419419    return heightAdjustedForSetOffset(maxColumnHeight);
    420420}
  • trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp

    r189541 r189567  
    186186
    187187    const RenderStyle& styleToUse = parent()->style();
    188     return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast<RenderBlock>(*parent()).computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
     188    return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast<RenderBlock>(*parent()).computeReplacedLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight());
    189189}
    190190
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r189541 r189567  
    384384{
    385385    if (style().logicalWidth().isSpecified() || style().logicalWidth().isIntrinsic())
    386         return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
     386        return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style().logicalWidth()), shouldComputePreferred);
    387387
    388388    RenderBox* contentRenderer = embeddedContentBox();
     
    419419                LayoutUnit logicalWidth;
    420420                if (RenderBlock* blockWithWidth = firstContainingBlockWithLogicalWidth(this))
    421                     logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style().logicalWidth()), shouldComputePreferred);
     421                    logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(MainOrPreferredSize, blockWithWidth->style().logicalWidth()), shouldComputePreferred);
    422422                else
    423423                    logicalWidth = containingBlock()->availableLogicalWidth();
     
    449449    // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height
    450450    if (hasReplacedLogicalHeight())
    451         return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
     451        return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight()));
    452452
    453453    RenderBox* contentRenderer = embeddedContentBox();
  • trunk/Source/WebCore/rendering/RenderSlider.h

    r189541 r189567  
    5050    virtual bool requiresForcedStyleRecalcPropagation() const override { return true; }
    5151    virtual void layout() override;
     52
     53    bool isFlexibleBoxImpl() const override { return true; }
    5254};
    5355
  • trunk/Source/WebCore/rendering/RenderTextControl.h

    r189541 r189567  
    106106    virtual Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
    107107
     108private:
     109    bool isFlexibleBoxImpl() const override { return true; }
    108110};
    109111
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r189541 r189567  
    356356    innerBlockStyle.get().setFlexGrow(1);
    357357    // min-width: 0; is needed for correct shrinking.
    358     // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=111790 is fixed.
    359358    innerBlockStyle.get().setMinWidth(Length(0, Fixed));
    360359    innerBlockStyle.get().setDisplay(BLOCK);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h

    r189541 r189567  
    6868    virtual bool isRenderMathMLBlock() const override final { return true; }
    6969    virtual const char* renderName() const override;
     70    bool isFlexibleBoxImpl() const override { return true; }
    7071};
    7172
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r189541 r189567  
    19041904    static Length initialWordSpacing() { return Length(Fixed); }
    19051905    static Length initialSize() { return Length(); }
    1906     static Length initialMinSize() { return Length(Fixed); }
     1906    static Length initialMinSize() { return Length(); }
    19071907    static Length initialMaxSize() { return Length(Undefined); }
    19081908    static Length initialOffset() { return Length(); }
Note: See TracChangeset for help on using the changeset viewer.