Changeset 122264 in webkit


Ignore:
Timestamp:
Jul 10, 2012 2:45:27 PM (12 years ago)
Author:
ojan@chromium.org
Message:

Add support for min-height:auto and min-width:auto
https://bugs.webkit.org/show_bug.cgi?id=88437

Reviewed by Tony Chang.

Source/WebCore:

Right now auto does the same thing as min-height/min-width:0.
For flex-items it should be the same as min-content (followup patch).
http://dev.w3.org/csswg/css3-flexbox/#min-size-auto

Tests: fast/css/auto-min-size.html

fast/css/deprecated-flexbox-auto-min-size.html

  • WebCore.order:
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
Return 0px for the computed value of auto.

  • css/CSSParser.cpp:

(WebCore::CSSParser::validWidth):
(WebCore):
(WebCore::CSSParser::validHeight):
(WebCore::CSSParser::parseValue):

  • css/CSSParser.h:

(CSSParser):
Restructure width/height parsing to reduce code duplication and make it easier
to add auto as a valid min value.

  • platform/efl/RenderThemeEfl.cpp:

(WebCore::RenderThemeEfl::adjustSizeConstraints):
This code was unnecessarily checking intrinsicOrAuto since auto was previously
not an allowed value for minWidth/minHeight.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
(WebCore::RenderBox::sizesLogicalWidthToFitContent):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalWidthUsing):
(WebCore::RenderBox::computePositionedLogicalHeight):
(WebCore::RenderBox::computePositionedLogicalHeightUsing):
Need to pass a SizeType to all these methods so that we know if the Length
we're working with is a min length since auto has a different meaning now
for min lengths.

  • rendering/RenderBox.h:

(RenderBox):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
(WebCore::RenderFlexibleBox::computeAvailableFreeSpace):
(WebCore::RenderFlexibleBox::lineBreakLength):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):

  • rendering/RenderReplaced.cpp:

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

  • rendering/RenderScrollbarPart.cpp:

(WebCore::calcScrollbarThicknessUsing):
(WebCore::RenderScrollbarPart::computeScrollbarWidth):
(WebCore::RenderScrollbarPart::computeScrollbarHeight):

  • rendering/style/RenderStyle.h:

Default minHeight/minWidth to auto instead of 0px.

LayoutTests:

  • fast/css/auto-min-size-expected.txt: Added.
  • fast/css/auto-min-size.html: Added.
  • fast/css/deprecated-flexbox-auto-min-size.html: Added.
  • platform/chromium-linux/fast/css/deprecated-flexbox-auto-min-size-expected.txt: Added.
Location:
trunk
Files:
4 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122262 r122264  
     12012-07-10  Ojan Vafai  <ojan@chromium.org>
     2
     3        Add support for min-height:auto and min-width:auto
     4        https://bugs.webkit.org/show_bug.cgi?id=88437
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/css/auto-min-size-expected.txt: Added.
     9        * fast/css/auto-min-size.html: Added.
     10        * fast/css/deprecated-flexbox-auto-min-size.html: Added.
     11        * platform/chromium-linux/fast/css/deprecated-flexbox-auto-min-size-expected.txt: Added.
     12
    1132012-07-10  Joshua Bell  <jsbell@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r122255 r122264  
     12012-07-10  Ojan Vafai  <ojan@chromium.org>
     2
     3        Add support for min-height:auto and min-width:auto
     4        https://bugs.webkit.org/show_bug.cgi?id=88437
     5
     6        Reviewed by Tony Chang.
     7
     8        Right now auto does the same thing as min-height/min-width:0.
     9        For flex-items it should be the same as min-content (followup patch).
     10        http://dev.w3.org/csswg/css3-flexbox/#min-size-auto
     11
     12        Tests: fast/css/auto-min-size.html
     13               fast/css/deprecated-flexbox-auto-min-size.html
     14
     15        * WebCore.order:
     16        * css/CSSComputedStyleDeclaration.cpp:
     17        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     18        Return 0px for the computed value of auto.
     19
     20        * css/CSSParser.cpp:
     21        (WebCore::CSSParser::validWidth):
     22        (WebCore):
     23        (WebCore::CSSParser::validHeight):
     24        (WebCore::CSSParser::parseValue):
     25        * css/CSSParser.h:
     26        (CSSParser):
     27        Restructure width/height parsing to reduce code duplication and make it easier
     28        to add auto as a valid min value.
     29
     30        * platform/efl/RenderThemeEfl.cpp:
     31        (WebCore::RenderThemeEfl::adjustSizeConstraints):
     32        This code was unnecessarily checking intrinsicOrAuto since auto was previously
     33        not an allowed value for minWidth/minHeight.
     34
     35        * rendering/RenderBox.cpp:
     36        (WebCore::RenderBox::computeLogicalWidthInRegion):
     37        (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
     38        (WebCore::RenderBox::sizesLogicalWidthToFitContent):
     39        (WebCore::RenderBox::computeLogicalHeight):
     40        (WebCore::RenderBox::computeLogicalHeightUsing):
     41        (WebCore::RenderBox::computeContentLogicalHeightUsing):
     42        (WebCore::RenderBox::computeReplacedLogicalWidth):
     43        (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
     44        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     45        (WebCore::RenderBox::computeReplacedLogicalHeight):
     46        (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
     47        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     48        (WebCore::RenderBox::computePositionedLogicalWidth):
     49        (WebCore::RenderBox::computePositionedLogicalWidthUsing):
     50        (WebCore::RenderBox::computePositionedLogicalHeight):
     51        (WebCore::RenderBox::computePositionedLogicalHeightUsing):
     52        Need to pass a SizeType to all these methods so that we know if the Length
     53        we're working with is a min length since auto has a different meaning now
     54        for min lengths.
     55
     56        * rendering/RenderBox.h:
     57        (RenderBox):
     58        * rendering/RenderDeprecatedFlexibleBox.cpp:
     59        (WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):
     60        * rendering/RenderFlexibleBox.cpp:
     61        (WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
     62        (WebCore::RenderFlexibleBox::computeAvailableFreeSpace):
     63        (WebCore::RenderFlexibleBox::lineBreakLength):
     64        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
     65        * rendering/RenderReplaced.cpp:
     66        (WebCore::RenderReplaced::computeReplacedLogicalWidth):
     67        (WebCore::RenderReplaced::computeReplacedLogicalHeight):
     68        * rendering/RenderScrollbarPart.cpp:
     69        (WebCore::calcScrollbarThicknessUsing):
     70        (WebCore::RenderScrollbarPart::computeScrollbarWidth):
     71        (WebCore::RenderScrollbarPart::computeScrollbarHeight):
     72        * rendering/style/RenderStyle.h:
     73        Default minHeight/minWidth to auto instead of 0px.
     74
    1752012-07-10  Xianzhu Wang  <wangxianzhu@chromium.org>
    276
  • trunk/Source/WebCore/WebCore.order

    r121330 r122264  
    16771677__ZNK7WebCore9RenderBox27shouldComputeSizeAsReplacedEv
    16781678__ZNK7WebCore11RenderStyle12logicalWidthEv
    1679 __ZN7WebCore9RenderBox24computeLogicalWidthUsingENS_16LogicalWidthTypeEi
     1679__ZN7WebCore9RenderBox24computeLogicalWidthUsingENS_16SizeTypeEi
    16801680__ZNK7WebCore11RenderStyle11marginStartEv
    16811681__ZNK7WebCore11RenderStyle9marginEndEv
    1682 __ZNK7WebCore9RenderBox28sizesToIntrinsicLogicalWidthENS_16LogicalWidthTypeE
     1682__ZNK7WebCore9RenderBox28sizesToIntrinsicLogicalWidthENS_16SizeTypeE
    16831683__ZNK7WebCore11RenderBlock26isInlineBlockOrInlineTableEv
    16841684__ZNK7WebCore11RenderStyle15logicalMaxWidthEv
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r121513 r122264  
    18571857        }
    18581858        case CSSPropertyMinHeight:
     1859            // FIXME: For flex-items, min-height:auto should compute to min-content.
     1860            if (style->minHeight().isAuto())
     1861                return zoomAdjustedPixelValue(0, style.get());
    18591862            return zoomAdjustedPixelValueForLength(style->minHeight(), style.get());
    18601863        case CSSPropertyMinWidth:
     1864            // FIXME: For flex-items, min-width:auto should compute to min-content.
     1865            if (style->minWidth().isAuto())
     1866                return zoomAdjustedPixelValue(0, style.get());
    18611867            return zoomAdjustedPixelValueForLength(style->minWidth(), style.get());
    18621868        case CSSPropertyOpacity:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r121874 r122264  
    15701570}
    15711571
     1572bool CSSParser::validWidth(CSSParserValue* value)
     1573{
     1574    int id = value->id;
     1575    if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent)
     1576        return true;
     1577    return !id && validUnit(value, FLength | FPercent | FNonNeg);
     1578}
     1579
     1580// FIXME: Combine this with validWidth when we support fit-content, et al, for heights.
     1581bool CSSParser::validHeight(CSSParserValue* value)
     1582{
     1583    int id = value->id;
     1584    if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
     1585        return true;
     1586    return !id && validUnit(value, FLength | FPercent | FNonNeg);
     1587}
    15721588
    15731589void CSSParser::checkForOrphanedUnits()
     
    19821998        break;
    19831999
    1984     case CSSPropertyMaxWidth: // <length> | <percentage> | none | inherit
     2000    case CSSPropertyMaxWidth:
    19852001    case CSSPropertyWebkitMaxLogicalWidth:
    1986         if (id == CSSValueNone) {
    1987             validPrimitive = true;
    1988             break;
    1989         }
    1990         /* nobreak */
    1991     case CSSPropertyMinWidth: // <length> | <percentage> | inherit
     2002        validPrimitive = (id == CSSValueNone || validWidth(value));
     2003        break;
     2004
     2005    case CSSPropertyMinWidth:
    19922006    case CSSPropertyWebkitMinLogicalWidth:
    1993         if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent)
    1994             validPrimitive = true;
    1995         else
    1996             validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg));
    1997         break;
    1998 
    1999     case CSSPropertyMaxHeight: // <length> | <percentage> | none | inherit
     2007    case CSSPropertyWidth:
     2008    case CSSPropertyWebkitLogicalWidth:
     2009        validPrimitive = (id == CSSValueAuto || validWidth(value));
     2010        break;
     2011
     2012    case CSSPropertyMaxHeight:
    20002013    case CSSPropertyWebkitMaxLogicalHeight:
    2001         if (id == CSSValueNone) {
    2002             validPrimitive = true;
    2003             break;
    2004         }
    2005         /* nobreak */
    2006     case CSSPropertyMinHeight: // <length> | <percentage> | inherit
     2014        validPrimitive = (id == CSSValueNone || validHeight(value));
     2015        break;
     2016
     2017    case CSSPropertyMinHeight:
    20072018    case CSSPropertyWebkitMinLogicalHeight:
    2008         if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
    2009             validPrimitive = true;
    2010         else
    2011             validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg));
     2019    case CSSPropertyHeight:
     2020    case CSSPropertyWebkitLogicalHeight:
     2021        validPrimitive = (id == CSSValueAuto || validHeight(value));
    20122022        break;
    20132023
     
    20262036        else
    20272037            validPrimitive = (!id && validUnit(value, FLength | FPercent));
    2028         break;
    2029 
    2030     case CSSPropertyWidth: // <length> | <percentage> | auto | inherit
    2031     case CSSPropertyWebkitLogicalWidth:
    2032         if (id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent) {
    2033             validPrimitive = true;
    2034             break;
    2035         }
    2036         /* nobreak */
    2037     case CSSPropertyHeight: // <length> | <percentage> | auto | inherit
    2038     case CSSPropertyWebkitLogicalHeight:
    2039         if (id == CSSValueAuto || id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
    2040             validPrimitive = true;
    2041         else if (!id && validUnit(value, FLength | FPercent | FNonNeg))
    2042             // ### handle multilength case where we allow relative units
    2043             validPrimitive = true;
    20442038        break;
    20452039
  • trunk/Source/WebCore/css/CSSParser.h

    r121551 r122264  
    380380    bool inShorthand() const { return m_inParseShorthand; }
    381381
     382    bool validWidth(CSSParserValue*);
     383    bool validHeight(CSSParserValue*);
     384
    382385    void checkForOrphanedUnits();
    383386
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp

    r119547 r122264  
    8383    const struct ThemePartDesc* desc = m_partDescs + (size_t)type;
    8484
    85     if (style->minWidth().isIntrinsicOrAuto())
     85    if (style->minWidth().isIntrinsic())
    8686        style->setMinWidth(desc->min.width());
    87     if (style->minHeight().isIntrinsicOrAuto())
     87    if (style->minHeight().isIntrinsic())
    8888        style->setMinHeight(desc->min.height());
    8989
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r122244 r122264  
    16921692    else {
    16931693        // Calculate LogicalWidth
    1694         setLogicalWidth(computeLogicalWidthInRegionUsing(LogicalWidth, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage));
     1694        setLogicalWidth(computeLogicalWidthInRegionUsing(MainOrPreferredSize, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage));
    16951695
    16961696        // Calculate MaxLogicalWidth
    16971697        if (!styleToUse->logicalMaxWidth().isUndefined()) {
    1698             LayoutUnit maxLogicalWidth = computeLogicalWidthInRegionUsing(MaxLogicalWidth, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage);
     1698            LayoutUnit maxLogicalWidth = computeLogicalWidthInRegionUsing(MaxSize, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage);
    16991699            if (logicalWidth() > maxLogicalWidth)
    17001700                setLogicalWidth(maxLogicalWidth);
     
    17021702
    17031703        // Calculate MinLogicalWidth
    1704         LayoutUnit minLogicalWidth = computeLogicalWidthInRegionUsing(MinLogicalWidth, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage);
     1704        LayoutUnit minLogicalWidth = computeLogicalWidthInRegionUsing(MinSize, containerWidthInInlineDirection, cb, region, offsetFromLogicalTopOfFirstPage);
    17051705        if (logicalWidth() < minLogicalWidth)
    17061706            setLogicalWidth(minLogicalWidth);
     
    17281728}
    17291729
    1730 LayoutUnit RenderBox::computeLogicalWidthInRegionUsing(LogicalWidthType widthType, LayoutUnit availableLogicalWidth,
     1730LayoutUnit RenderBox::computeLogicalWidthInRegionUsing(SizeType widthType, LayoutUnit availableLogicalWidth,
    17311731    const RenderBlock* cb, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage)
    17321732{
    1733     LayoutUnit logicalWidthResult = logicalWidth();
    17341733    RenderStyle* styleToUse = style();
    17351734    Length logicalWidth;
    1736     if (widthType == LogicalWidth)
     1735    if (widthType == MainOrPreferredSize)
    17371736        logicalWidth = styleToUse->logicalWidth();
    1738     else if (widthType == MinLogicalWidth)
     1737    else if (widthType == MinSize)
    17391738        logicalWidth = styleToUse->logicalMinWidth();
    17401739    else
     
    17431742    ASSERT(!logicalWidth.isUndefined());
    17441743
    1745     if (logicalWidth.isIntrinsicOrAuto()) {
    1746         RenderView* renderView = view();
    1747         LayoutUnit marginStart = minimumValueForLength(styleToUse->marginStart(), availableLogicalWidth, renderView);
    1748         LayoutUnit marginEnd = minimumValueForLength(styleToUse->marginEnd(), availableLogicalWidth, renderView);
    1749         logicalWidthResult = availableLogicalWidth - marginStart - marginEnd;
    1750 
    1751         // shrinkToAvoidFloats() is only true for width: auto so the below code works correctly for
    1752         // width: fill-available since no case matches and it returns the logicalWidthResult from above.
    1753         if (shrinkToAvoidFloats() && cb->containsFloats())
    1754             logicalWidthResult = min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, cb, region, offsetFromLogicalTopOfFirstPage));
    1755 
    1756         if (logicalWidth.type() == MinContent)
    1757             logicalWidthResult = minPreferredLogicalWidth();
    1758         else if (logicalWidth.type() == MaxContent)
    1759             logicalWidthResult = maxPreferredLogicalWidth();
    1760         else if (logicalWidth.type() == FitContent || (logicalWidth.type() != FillAvailable && sizesLogicalWidthToFitContent(widthType)))
    1761             logicalWidthResult = max(minPreferredLogicalWidth(), min(maxPreferredLogicalWidth(), logicalWidthResult));
    1762 
    1763     } else // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
    1764         logicalWidthResult = computeBorderBoxLogicalWidth(valueForLength(logicalWidth, availableLogicalWidth, view()));
    1765 
     1744    // FIXME: minWidth:auto on a flex-item needs to go down the intrinsicOrAuto path below.
     1745    if (widthType == MinSize && logicalWidth.isAuto())
     1746        return computeBorderBoxLogicalWidth(0);
     1747   
     1748    if (!logicalWidth.isIntrinsicOrAuto()) {
     1749        // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
     1750        return computeBorderBoxLogicalWidth(valueForLength(logicalWidth, availableLogicalWidth, view()));
     1751    }
     1752
     1753    if (logicalWidth.type() == MinContent)
     1754        return minPreferredLogicalWidth();
     1755    if (logicalWidth.type() == MaxContent)
     1756        return maxPreferredLogicalWidth();
     1757
     1758    RenderView* renderView = view();
     1759    LayoutUnit marginStart = minimumValueForLength(styleToUse->marginStart(), availableLogicalWidth, renderView);
     1760    LayoutUnit marginEnd = minimumValueForLength(styleToUse->marginEnd(), availableLogicalWidth, renderView);
     1761    LayoutUnit logicalWidthResult = availableLogicalWidth - marginStart - marginEnd;
     1762
     1763    // shrinkToAvoidFloats() is only true for width: auto so the below code works correctly for
     1764    // width: fill-available since no case matches and it returns the logicalWidthResult from above.
     1765    if (shrinkToAvoidFloats() && cb->containsFloats())
     1766        logicalWidthResult = min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, cb, region, offsetFromLogicalTopOfFirstPage));
     1767
     1768    if (logicalWidth.type() == FitContent || (logicalWidth.type() != FillAvailable && sizesLogicalWidthToFitContent(widthType)))
     1769        return max(minPreferredLogicalWidth(), min(maxPreferredLogicalWidth(), logicalWidthResult));
    17661770    return logicalWidthResult;
    17671771}
    17681772
    1769 bool RenderBox::sizesLogicalWidthToFitContent(LogicalWidthType widthType) const
     1773bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const
    17701774{
    17711775    // Marquees in WinIE are like a mixture of blocks and inline-blocks.  They size as though they're blocks,
     
    17761780    // This code may look a bit strange.  Basically width:intrinsic should clamp the size when testing both
    17771781    // min-width and width.  max-width is only clamped if it is also intrinsic.
    1778     Length logicalWidth = (widthType == MaxLogicalWidth) ? style()->logicalMaxWidth() : style()->logicalWidth();
     1782    Length logicalWidth = (widthType == MaxSize) ? style()->logicalMaxWidth() : style()->logicalWidth();
    17791783    if (logicalWidth.type() == Intrinsic)
    17801784        return true;
     
    20132017        LayoutUnit heightResult;
    20142018        if (checkMinMaxHeight) {
    2015             heightResult = computeLogicalHeightUsing(styleToUse->logicalHeight());
     2019            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, styleToUse->logicalHeight());
    20162020            if (heightResult == -1)
    20172021                heightResult = logicalHeight();
    2018             LayoutUnit minH = computeLogicalHeightUsing(styleToUse->logicalMinHeight()); // Leave as -1 if unset.
    2019             LayoutUnit maxH = styleToUse->logicalMaxHeight().isUndefined() ? heightResult : computeLogicalHeightUsing(styleToUse->logicalMaxHeight());
     2022            LayoutUnit minH = computeLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight()); // Leave as -1 if unset.
     2023            LayoutUnit maxH = styleToUse->logicalMaxHeight().isUndefined() ? heightResult : computeLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight());
    20202024            if (maxH == -1)
    20212025                maxH = heightResult;
     
    20642068}
    20652069
    2066 LayoutUnit RenderBox::computeLogicalHeightUsing(const Length& height)
    2067 {
    2068     LayoutUnit logicalHeight = computeContentLogicalHeightUsing(height);
     2070LayoutUnit RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height)
     2071{
     2072    LayoutUnit logicalHeight = computeContentLogicalHeightUsing(heightType, height);
    20692073    if (logicalHeight != -1)
    20702074        logicalHeight = computeBorderBoxLogicalHeight(logicalHeight);
     
    20722076}
    20732077
    2074 LayoutUnit RenderBox::computeContentLogicalHeightUsing(const Length& height)
    2075 {
     2078LayoutUnit RenderBox::computeContentLogicalHeightUsing(SizeType heightType, const Length& height)
     2079{
     2080    // FIXME: For flexboxes, minHeight:auto should be min-content.
     2081    if (height.isAuto())
     2082        return heightType == MinSize ? 0 : -1;
     2083 
    20762084    LayoutUnit logicalHeight = -1;
    2077     if (!height.isAuto()) {
    2078         if (height.isFixed())
    2079             logicalHeight = height.value();
    2080         else if (height.isPercent())
    2081             logicalHeight = computePercentageLogicalHeight(height);
    2082         else if (height.isViewportPercentage())
    2083             logicalHeight = valueForLength(height, 0, view());
    2084     }
    2085     return logicalHeight;
     2085    if (height.isFixed())
     2086        return height.value();
     2087    if (height.isPercent())
     2088        return computePercentageLogicalHeight(height);
     2089    if (height.isViewportPercentage())
     2090        return valueForLength(height, 0, view());
     2091    return -1;
    20862092}
    20872093
     
    21732179LayoutUnit RenderBox::computeReplacedLogicalWidth(bool includeMaxWidth) const
    21742180{
    2175     return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), includeMaxWidth);
     2181    return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth()), includeMaxWidth);
    21762182}
    21772183
    21782184LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, bool includeMaxWidth) const
    21792185{
    2180     LayoutUnit minLogicalWidth = computeReplacedLogicalWidthUsing(style()->logicalMinWidth());
    2181     LayoutUnit maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth());
     2186    LayoutUnit minLogicalWidth = computeReplacedLogicalWidthUsing(MinSize, style()->logicalMinWidth());
     2187    LayoutUnit maxLogicalWidth = !includeMaxWidth || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MaxSize, style()->logicalMaxWidth());
    21822188    return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth));
    21832189}
    21842190
    2185 LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const
    2186 {
     2191LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType sizeType, Length logicalWidth) const
     2192{
     2193    // FIXME: For flexboxes, minWidth:auto should be min-content.
     2194    if (sizeType == MinSize && logicalWidth.isAuto())
     2195        return computeContentBoxLogicalWidth(0);
     2196
    21872197    switch (logicalWidth.type()) {
    21882198        case Fixed:
     
    22092219LayoutUnit RenderBox::computeReplacedLogicalHeight() const
    22102220{
    2211     return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
     2221    return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight()));
    22122222}
    22132223
    22142224LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
    22152225{
    2216     LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight());
    2217     LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
     2226    LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(MinSize, style()->logicalMinHeight());
     2227    LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(MaxSize, style()->logicalMaxHeight());
    22182228    return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight));
    22192229}
    22202230
    2221 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const
    2222 {
     2231LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Length logicalHeight) const
     2232{
     2233    // FIXME: For flexboxes, minWidth:auto should be min-content.
     2234    if (sizeType == MinSize && logicalHeight.isAuto())
     2235        return computeContentBoxLogicalHeight(0);
     2236
    22232237    switch (logicalHeight.type()) {
    22242238        case Fixed:
     
    25652579    LayoutUnit logicalWidthResult;
    25662580    LayoutUnit logicalLeftResult;
    2567     computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection,
     2581    computePositionedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth(), containerBlock, containerDirection,
    25682582                                       containerLogicalWidth, bordersPlusPadding,
    25692583                                       logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    25792593        LayoutUnit maxLogicalLeftPos;
    25802594
    2581         computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), containerBlock, containerDirection,
     2595        computePositionedLogicalWidthUsing(MaxSize, style()->logicalMaxWidth(), containerBlock, containerDirection,
    25822596                                           containerLogicalWidth, bordersPlusPadding,
    25832597                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    25992613        LayoutUnit minLogicalLeftPos;
    26002614
    2601         computePositionedLogicalWidthUsing(style()->logicalMinWidth(), containerBlock, containerDirection,
     2615        computePositionedLogicalWidthUsing(MinSize, style()->logicalMinWidth(), containerBlock, containerDirection,
    26022616                                           containerLogicalWidth, bordersPlusPadding,
    26032617                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    26132627
    26142628    if (stretchesToMinIntrinsicLogicalWidth() && logicalWidth() < minPreferredLogicalWidth() - bordersPlusPadding) {
    2615         computePositionedLogicalWidthUsing(Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
     2629        computePositionedLogicalWidthUsing(MainOrPreferredSize, Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
    26162630                                           containerLogicalWidth, bordersPlusPadding,
    26172631                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    26502664}
    26512665
    2652 void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     2666void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    26532667                                                   LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    26542668                                                   Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    26552669                                                   LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos)
    26562670{
     2671    // FIXME: What should flex items do here since min-width:auto == min-width:min-content instead of min-width:auto == min-width:0.
     2672    if (widthSizeType == MinSize && logicalWidth.isAuto())
     2673        logicalWidth = Length(0, Fixed);
     2674
    26572675    // 'left' and 'right' cannot both be 'auto' because one would of been
    26582676    // converted to the static position already
     
    28942912
    28952913    // Calculate constraint equation values for 'height' case.
    2896     computePositionedLogicalHeightUsing(styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
     2914    computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
    28972915                                        logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    28982916                                        logicalHeightResult, marginBeforeAlias, marginAfterAlias, logicalTopPos);
     
    29092927        LayoutUnit maxLogicalTopPos;
    29102928
    2911         computePositionedLogicalHeightUsing(styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
     2929        computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
    29122930                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    29132931                                            maxLogicalHeight, maxMarginBefore, maxMarginAfter, maxLogicalTopPos);
     
    29282946        LayoutUnit minLogicalTopPos;
    29292947
    2930         computePositionedLogicalHeightUsing(styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
     2948        computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
    29312949                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    29322950                                            minLogicalHeight, minMarginBefore, minMarginAfter, minLogicalTopPos);
     
    29802998}
    29812999
    2982 void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
     3000void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    29833001                                                    LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
    29843002                                                    Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
    29853003                                                    LayoutUnit& logicalHeightValue, LayoutUnit& marginBeforeValue, LayoutUnit& marginAfterValue, LayoutUnit& logicalTopPos)
    29863004{
     3005    // FIXME: What should flex items do here since min-height:auto == min-height:min-content instead of min-height:auto == min-height:0.
     3006    if (heightSizeType == MinSize && logicalHeightLength.isAuto())
     3007        logicalHeightLength = Length(0, Fixed);
     3008
    29873009    // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
    29883010    // converted to the static position in computePositionedLogicalHeight()
     
    29933015    LayoutUnit logicalTopValue = 0;
    29943016
     3017    // FIXME: For non-flexboxes + min-height, this needs to treat non-flexboxes as 0.
    29953018    bool logicalHeightIsAuto = logicalHeightLength.isAuto();
    29963019    bool logicalTopIsAuto = logicalTop.isAuto();
  • trunk/Source/WebCore/rendering/RenderBox.h

    r121123 r122264  
    3434struct PaintInfo;
    3535
    36 enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth };
     36enum SizeType { MainOrPreferredSize, MinSize, MaxSize };
    3737
    3838enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayScrollbarSize };
     
    336336    // Whether or not the element shrinks to its intrinsic width (rather than filling the width
    337337    // of a containing block).  HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
    338     bool sizesLogicalWidthToFitContent(LogicalWidthType) const;
     338    bool sizesLogicalWidthToFitContent(SizeType) const;
    339339    virtual bool stretchesToMinIntrinsicLogicalWidth() const { return false; }
    340340
    341341    LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage);
    342342
    343     LayoutUnit computeLogicalWidthInRegionUsing(LogicalWidthType, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage);
    344     LayoutUnit computeLogicalHeightUsing(const Length& height);
    345     LayoutUnit computeContentLogicalHeightUsing(const Length& height);
    346     LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
     343    LayoutUnit computeLogicalWidthInRegionUsing(SizeType, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage);
     344    LayoutUnit computeLogicalHeightUsing(SizeType, const Length& height);
     345    LayoutUnit computeContentLogicalHeightUsing(SizeType, const Length& height);
     346    LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
    347347    LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, bool includeMaxWidth = true) const;
    348     LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;
     348    LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const;
    349349    LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const;
    350350
     
    541541
    542542    void computePositionedLogicalHeight();
    543     void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     543    void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    544544                                            LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    545545                                            Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    546546                                            LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos);
    547     void computePositionedLogicalHeightUsing(Length logicalHeight, const RenderBoxModelObject* containerBlock,
     547    void computePositionedLogicalHeightUsing(SizeType, Length logicalHeight, const RenderBoxModelObject* containerBlock,
    548548                                             LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
    549549                                             Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r121123 r122264  
    10641064        else if (child->style()->minWidth().type() == MinIntrinsic)
    10651065            minWidth = child->minPreferredLogicalWidth();
     1066        else if (child->style()->minWidth().type() == Auto)
     1067            minWidth = 0;
    10661068
    10671069        LayoutUnit allowedShrinkage = min<LayoutUnit>(0, minWidth - width);
    10681070        return allowedShrinkage;
    10691071    } else {
    1070         if (child->style()->minHeight().isFixed()) {
     1072        Length minHeight = child->style()->minHeight();
     1073        if (minHeight.isFixed() || minHeight.isAuto()) {
    10711074            LayoutUnit minHeight = child->style()->minHeight().value();
    10721075            LayoutUnit height = child->overrideLogicalContentHeight();
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r121611 r122264  
    156156
    157157    RenderStyle* styleToUse = style();
     158    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for width.
    158159    if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0)
    159160        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());
     
    205206    m_minPreferredLogicalWidth += scrollbarWidth;
    206207
     208    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width.
    207209    if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
    208210        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value()));
     
    210212    }
    211213
     214    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
    212215    if (styleToUse->logicalMaxWidth().isFixed()) {
    213216        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value()));
     
    596599        contentExtent = overrideLogicalContentHeight();
    597600    else {
    598         LayoutUnit heightResult = computeContentLogicalHeightUsing(style()->logicalHeight());
     601        LayoutUnit heightResult = computeContentLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
    599602        if (heightResult == -1)
    600603            heightResult = preferredMainAxisExtent;
    601         LayoutUnit minHeight = computeContentLogicalHeightUsing(style()->logicalMinHeight()); // Leave as -1 if unset.
    602         LayoutUnit maxHeight = style()->logicalMaxHeight().isUndefined() ? heightResult : computeContentLogicalHeightUsing(style()->logicalMaxHeight());
     604        LayoutUnit minHeight = computeContentLogicalHeightUsing(MinSize, style()->logicalMinHeight()); // Leave as -1 if unset.
     605        LayoutUnit maxHeight = style()->logicalMaxHeight().isUndefined() ? heightResult : computeContentLogicalHeightUsing(MaxSize, style()->logicalMaxHeight());
    603606        if (maxHeight == -1)
    604607            maxHeight = heightResult;
     
    772775        return mainAxisContentExtent();
    773776
    774     LayoutUnit height = computeContentLogicalHeightUsing(style()->logicalHeight());
     777    LayoutUnit height = computeContentLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
    775778    if (height == -1)
    776779        height = MAX_LAYOUT_UNIT;
    777     LayoutUnit maxHeight = computeContentLogicalHeightUsing(style()->logicalMaxHeight());
     780    LayoutUnit maxHeight = computeContentLogicalHeightUsing(MaxSize, style()->logicalMaxHeight());
    778781    if (maxHeight != -1)
    779782        height = std::min(height, maxHeight);
     
    790793    if (max.isSpecified() && childSize > valueForLength(max, flexboxAvailableContentExtent, renderView))
    791794        childSize = valueForLength(max, flexboxAvailableContentExtent, renderView);
     795    // FIXME: Treat auto min values as min-content.
    792796    if (min.isSpecified() && childSize < valueForLength(min, flexboxAvailableContentExtent, renderView))
    793797        childSize = valueForLength(min, flexboxAvailableContentExtent, renderView);
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r121123 r122264  
    316316{
    317317    if (style()->logicalWidth().isSpecified())
    318         return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), includeMaxWidth);
     318        return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth()), includeMaxWidth);
    319319
    320320    RenderBox* contentRenderer = embeddedContentBox();
     
    341341            // of 'width' is: (used height) * (intrinsic ratio)
    342342            if (intrinsicRatio && ((heightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || !heightIsAuto)) {
    343                 LayoutUnit logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight());
     343                LayoutUnit logicalHeight = computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
    344344                return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(logicalHeight * intrinsicRatio)));
    345345            }
     
    353353                LayoutUnit logicalWidth;
    354354                if (RenderBlock* blockWithWidth = firstContainingBlockWithLogicalWidth(this))
    355                     logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style()->logicalWidth()), false);
     355                    logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(MainOrPreferredSize, blockWithWidth->style()->logicalWidth()), false);
    356356                else
    357357                    logicalWidth = containingBlock()->availableLogicalWidth();
     
    385385    // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height
    386386    if (hasReplacedLogicalHeight())
    387         return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
     387        return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight()));
    388388
    389389    RenderBox* contentRenderer = embeddedContentBox();
  • trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp

    r118076 r122264  
    8080}
    8181
    82 static int calcScrollbarThicknessUsing(const Length& length, int containingLength, RenderView* renderView)
     82static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength, RenderView* renderView)
    8383{
    84     if (length.isIntrinsicOrAuto())
    85         return ScrollbarTheme::theme()->scrollbarThickness();
    86     return minimumValueForLength(length, containingLength, renderView);
     84    if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto()))
     85        return minimumValueForLength(length, containingLength, renderView);
     86    return ScrollbarTheme::theme()->scrollbarThickness();
    8787}
    8888
     
    9393    RenderView* renderView = view();
    9494    int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->borderLeft() - m_scrollbar->owningRenderer()->borderRight();
    95     int w = calcScrollbarThicknessUsing(style()->width(), visibleSize, renderView);
    96     int minWidth = calcScrollbarThicknessUsing(style()->minWidth(), visibleSize, renderView);
    97     int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(style()->maxWidth(), visibleSize, renderView);
     95    int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), visibleSize, renderView);
     96    int minWidth = calcScrollbarThicknessUsing(MinSize, style()->minWidth(), visibleSize, renderView);
     97    int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize, renderView);
    9898    setWidth(max(minWidth, min(maxWidth, w)));
    9999   
     
    109109    RenderView* renderView = view();
    110110    int visibleSize = m_scrollbar->owningRenderer()->height() -  m_scrollbar->owningRenderer()->borderTop() - m_scrollbar->owningRenderer()->borderBottom();
    111     int h = calcScrollbarThicknessUsing(style()->height(), visibleSize, renderView);
    112     int minHeight = calcScrollbarThicknessUsing(style()->minHeight(), visibleSize, renderView);
    113     int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(style()->maxHeight(), visibleSize, renderView);
     111    int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->height(), visibleSize, renderView);
     112    int minHeight = calcScrollbarThicknessUsing(MinSize, style()->minHeight(), visibleSize, renderView);
     113    int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize, renderView);
    114114    setHeight(max(minHeight, min(maxHeight, h)));
    115115
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r121352 r122264  
    15891589    static int initialLetterWordSpacing() { return 0; }
    15901590    static Length initialSize() { return Length(); }
    1591     static Length initialMinSize() { return Length(0, Fixed); }
     1591    static Length initialMinSize() { return Length(); }
    15921592    static Length initialMaxSize() { return Length(Undefined); }
    15931593    static Length initialOffset() { return Length(); }
Note: See TracChangeset for help on using the changeset viewer.