Changeset 271003 in webkit


Ignore:
Timestamp:
Dec 19, 2020 2:10:14 PM (19 months ago)
Author:
Alan Bujtas
Message:

width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow)
https://bugs.webkit.org/show_bug.cgi?id=219687
<rdar://problem/72137685>

Reviewed by Antti Koivisto.

Source/WebCore:

Non-quantitative values such as auto and min-content are not influenced by the box-sizing property.
See http::www.w3.org/TR/css-sizing-3/#box-sizing
(adjustContentBoxLogicalWidthFor* now needs the property type too)

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computePreferredLogicalWidths):

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):

  • rendering/RenderBox.h:

(WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths):

  • rendering/RenderFileUploadControl.cpp:

(WebCore::RenderFileUploadControl::computePreferredLogicalWidths):

  • rendering/RenderFragmentContainer.cpp:

(WebCore::RenderFragmentContainer::computePreferredLogicalWidths):

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::computePreferredLogicalWidths):

  • rendering/RenderMenuList.cpp:

(RenderMenuList::computePreferredLogicalWidths):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computePreferredLogicalWidths):

  • rendering/RenderSlider.cpp:

(WebCore::RenderSlider::computePreferredLogicalWidths):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::computePreferredLogicalWidths):

  • rendering/RenderTextControl.cpp:

(WebCore::RenderTextControl::computePreferredLogicalWidths):

LayoutTests:

  • platform/mac-wk2/TestExpectations:
  • platform/mac/TestExpectations:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271001 r271003  
     12020-12-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow)
     4        https://bugs.webkit.org/show_bug.cgi?id=219687
     5        <rdar://problem/72137685>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * platform/mac-wk2/TestExpectations:
     10        * platform/mac/TestExpectations:
     11
    1122020-12-18  Rini Patel  <rini_patel@apple.com>
    213
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r270973 r271003  
    13171317webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse.html [ ImageOnlyFailure ]
    13181318webkit.org/b/219322 fast/layoutformattingcontext/table-simple-border-collapse2.html [ ImageOnlyFailure ]
    1319 webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ Skip ]
    13201319
    13211320webkit.org/b/220018 webanimations/accelerated-transform-related-animation-property-order.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r270960 r271003  
    22582258webkit.org/b/219907 imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Pass Failure ]
    22592259
    2260 webkit.org/b/219687 fast/layoutformattingcontext/max-content-and-box-sizing-simple.html [ ImageOnlyFailure ]
    2261 
    22622260webkit.org/b/219965 [ BigSur ] imported/w3c/web-platform-tests/fetch/content-type/script.window.html [ Pass Failure ]
  • trunk/Source/WebCore/ChangeLog

    r271002 r271003  
     12020-12-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow)
     4        https://bugs.webkit.org/show_bug.cgi?id=219687
     5        <rdar://problem/72137685>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Non-quantitative values such as auto and min-content are not influenced by the box-sizing property.
     10        See http:://www.w3.org/TR/css-sizing-3/#box-sizing
     11        (adjustContentBoxLogicalWidthFor* now needs the property type too)
     12
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::computePreferredLogicalWidths):
     15        * rendering/RenderBlockFlow.cpp:
     16        (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):
     19        (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
     20        (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
     21        * rendering/RenderBox.h:
     22        (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):
     23        * rendering/RenderDeprecatedFlexibleBox.cpp:
     24        (WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths):
     25        * rendering/RenderFileUploadControl.cpp:
     26        (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
     27        * rendering/RenderFragmentContainer.cpp:
     28        (WebCore::RenderFragmentContainer::computePreferredLogicalWidths):
     29        * rendering/RenderGrid.cpp:
     30        (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
     31        * rendering/RenderListBox.cpp:
     32        (WebCore::RenderListBox::computePreferredLogicalWidths):
     33        * rendering/RenderMenuList.cpp:
     34        (RenderMenuList::computePreferredLogicalWidths):
     35        * rendering/RenderReplaced.cpp:
     36        (WebCore::RenderReplaced::computePreferredLogicalWidths):
     37        * rendering/RenderSlider.cpp:
     38        (WebCore::RenderSlider::computePreferredLogicalWidths):
     39        * rendering/RenderTable.cpp:
     40        (WebCore::RenderTable::computePreferredLogicalWidths):
     41        * rendering/RenderTextControl.cpp:
     42        (WebCore::RenderTextControl::computePreferredLogicalWidths):
     43
    1442020-12-19  Zalan Bujtas  <zalan@apple.com>
    245
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r265499 r271003  
    9696                        // ignore width=0
    9797                        if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercentOrCalculated()) {
    98                             float logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value());
     98                            float logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth);
    9999                            if (columnLayout.logicalWidth.isFixed()) {
    100100                                // Nav/IE weirdness
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r245543 r271003  
    143143        // RenderBox::computeLogicalWidthInFragmentUsing to compute the width.
    144144        if (logicalWidth.isFixed() && logicalWidth.isPositive()) {
    145             fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth.value());
     145            fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth);
    146146            logicalWidth.setValue(Fixed, fixedBorderBoxLogicalWidth);
    147147        }
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r270220 r271003  
    22812281    if (!isTableCell() && styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() >= 0
    22822282        && !(isDeprecatedFlexItem() && !styleToUse.logicalWidth().intValue()))
    2283         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
     2283        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth());
    22842284    else
    22852285        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    22862286
    22872287    if (styleToUse.logicalMaxWidth().isFixed()) {
    2288         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
    2289         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
     2288        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
     2289        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
    22902290    }
    22912291   
    22922292    if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
    2293         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
    2294         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
     2293        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
     2294        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
    22952295    }
    22962296   
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r270220 r271003  
    357357        Length tableCellWidth = downcast<RenderTableCell>(*this).styleOrColLogicalWidth();
    358358        if (tableCellWidth.isFixed() && tableCellWidth.value() > 0)
    359             maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth.value()));
     359            maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth));
    360360    }
    361361
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r270551 r271003  
    12321232}
    12331233
    1234 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const
    1235 {
     1234LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const
     1235{
     1236    auto width = LayoutUnit { logicalWidth.value() };
    12361237    LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
    1237     if (style().boxSizing() == BoxSizing::ContentBox)
     1238    if (style().boxSizing() == BoxSizing::ContentBox || logicalWidth.isIntrinsicOrAuto())
    12381239        return width + bordersPlusPadding;
    12391240    return std::max(width, bordersPlusPadding);
     1241}
     1242
     1243LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const
     1244{
     1245    if (originalType == Calculated)
     1246        return adjustBorderBoxLogicalWidthForBoxSizing({ computedLogicalWidth, Fixed, false });
     1247    return adjustBorderBoxLogicalWidthForBoxSizing({ computedLogicalWidth, originalType, false });
    12401248}
    12411249
     
    12481256}
    12491257
    1250 LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const
    1251 {
    1252     if (style().boxSizing() == BoxSizing::BorderBox)
    1253         width -= borderAndPaddingLogicalWidth();
    1254     return std::max<LayoutUnit>(0, width);
     1258LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const
     1259{
     1260    auto width = LayoutUnit { logicalWidth.value() };
     1261    if (style().boxSizing() == BoxSizing::ContentBox || logicalWidth.isIntrinsicOrAuto())
     1262        return std::max(0_lu, width);
     1263    return std::max(0_lu, width - borderAndPaddingLogicalWidth());
     1264}
     1265
     1266LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const
     1267{
     1268    if (originalType == Calculated)
     1269        return adjustContentBoxLogicalWidthForBoxSizing({ computedLogicalWidth, Fixed, false });
     1270    return adjustContentBoxLogicalWidthForBoxSizing({ computedLogicalWidth, originalType, false });
    12551271}
    12561272
     
    25742590    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
    25752591    if (widthType == MinSize && logicalWidth.isAuto())
    2576         return adjustBorderBoxLogicalWidthForBoxSizing(0);
     2592        return adjustBorderBoxLogicalWidthForBoxSizing(0, logicalWidth.type());
    25772593
    25782594    if (!logicalWidth.isIntrinsicOrAuto()) {
    25792595        // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
    2580         return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth));
     2596        return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth), logicalWidth.type());
    25812597    }
    25822598
     
    31143130    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
    31153131    if (widthType == MinSize && logicalWidth.isAuto())
    3116         return adjustContentBoxLogicalWidthForBoxSizing(0);
     3132        return adjustContentBoxLogicalWidthForBoxSizing(0, logicalWidth.type());
    31173133
    31183134    switch (logicalWidth.type()) {
    31193135        case Fixed:
    3120             return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value());
     3136            return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth);
    31213137        case MinContent:
    31223138        case MaxContent: {
     
    31393155                return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
    31403156            if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated())))
    3141                 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw));
     3157                return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw), logicalWidth.type());
    31423158            return 0_lu;
    31433159        }
     
    36973713{
    36983714    ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto());
     3715    auto originalLogicalWidthType = logicalWidth.type();
    36993716    if (widthType == MinSize && logicalWidth.isAuto())
    37003717        logicalWidth = Length(0, Fixed);
     
    37333750
    37343751        logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
    3735         computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth));
     3752        computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType);
    37363753
    37373754        const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth) + bordersPlusPadding);
     
    38433860        } else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) {
    38443861            // RULE 4: (solve for left)
    3845             computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth));
     3862            computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType);
    38463863            logicalLeftValue = availableSpace - (computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth));
    38473864        } else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) {
     
    38523869            // RULE 6: (no need solve for right)
    38533870            logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
    3854             computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth));
     3871            computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth), originalLogicalWidthType);
    38553872        }
    38563873    }
  • trunk/Source/WebCore/rendering/RenderBox.h

    r270551 r271003  
    336336    LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const override;
    337337   
    338     LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const;
    339     LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const;
    340 
    341     template<typename T> LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(T width) const { return adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit(width)); }
    342     template<typename T> LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(T width) const { return adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit(width)); }
     338    LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const;
     339    LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(const Length& logicalWidth) const;
     340
     341    LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const;
     342    LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit computedLogicalWidth, LengthType originalType) const;
     343
     344    template<typename T> LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(T computedLogicalWidth, LengthType originalType) const { return adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit(computedLogicalWidth), originalType); }
     345    template<typename T> LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(T computedLogicalWidth, LengthType originalType) const { return adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit(computedLogicalWidth), originalType); }
    343346
    344347    // Overridden by fieldsets to subtract out the intrinsic border.
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r269537 r271003  
    224224    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
    225225    if (style().width().isFixed() && style().width().value() > 0)
    226         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
     226        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width());
    227227    else
    228228        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    229229
    230230    if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
    231         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
    232         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
     231        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
     232        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
    233233    }
    234234
    235235    if (style().maxWidth().isFixed()) {
    236         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
    237         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
     236        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
     237        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
    238238    }
    239239
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r265338 r271003  
    225225
    226226    if (style().width().isFixed() && style().width().value() > 0)
    227         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
     227        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width());
    228228    else
    229229        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    230230
    231231    if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
    232         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
    233         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
     232        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
     233        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
    234234    }
    235235
    236236    if (style().maxWidth().isFixed()) {
    237         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
    238         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
     237        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
     238        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
    239239    }
    240240
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r270617 r271003  
    781781    } else {
    782782        ASSERT(crossSizeLength.isPercentOrCalculated());
    783         crossSize = mainAxisIsChildInlineAxis(child) ? child.computePercentageLogicalHeight(crossSizeLength) : adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth()));
     783        crossSize = mainAxisIsChildInlineAxis(child) ? child.computePercentageLogicalHeight(crossSizeLength) : adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth()), crossSizeLength.type());
    784784        if (!crossSize)
    785785            return 0_lu;
  • trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp

    r253290 r271003  
    375375    const RenderStyle& styleToUse = style();
    376376    if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() > 0)
    377         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
     377        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth());
    378378    else
    379379        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    380380
    381381    if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
    382         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
    383         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
     382        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
     383        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
    384384    }
    385385
    386386    if (styleToUse.logicalMaxWidth().isFixed()) {
    387         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
    388         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
     387        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
     388        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
    389389    }
    390390
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r268919 r271003  
    467467                containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
    468468            LayoutUnit maxSizeValue = valueForLength(maxSize, containingBlockAvailableSize.valueOr(LayoutUnit()));
    469             availableMaxSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(maxSizeValue) : adjustContentBoxLogicalHeightForBoxSizing(maxSizeValue);
     469            availableMaxSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(maxSizeValue, maxSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(maxSizeValue);
    470470        }
    471471
     
    479479                containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
    480480            LayoutUnit minSizeValue = valueForLength(minSize, containingBlockAvailableSize.valueOr(LayoutUnit()));
    481             availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue);
     481            availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue, minSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue);
    482482            if (!maxSize.isSpecified())
    483483                needsToFulfillMinimumSize = true;
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r270557 r271003  
    227227
    228228    if (style().width().isFixed() && style().width().value() > 0)
    229         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
     229        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width());
    230230    else
    231231        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    232232
    233233    if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
    234         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
    235         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
     234        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
     235        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
    236236    }
    237237
    238238    if (style().maxWidth().isFixed()) {
    239         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
    240         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
     239        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
     240        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
    241241    }
    242242
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r270713 r271003  
    327327   
    328328    if (style().width().isFixed() && style().width().value() > 0)
    329         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
     329        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width());
    330330    else
    331331        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    332332
    333333    if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
    334         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
    335         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
     334        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
     335        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
    336336    }
    337337
    338338    if (style().maxWidth().isFixed()) {
    339         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
    340         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
     339        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
     340        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
    341341    }
    342342
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r270618 r271003  
    664664
    665665    if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
    666         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
    667         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
     666        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
     667        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
    668668    }
    669669   
    670670    if (styleToUse.logicalMaxWidth().isFixed()) {
    671         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
    672         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
     671        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
     672        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
    673673    }
    674674
  • trunk/Source/WebCore/rendering/RenderSlider.cpp

    r270625 r271003  
    8181
    8282    if (style().width().isFixed() && style().width().value() > 0)
    83         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
     83        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width());
    8484    else
    8585        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    8686
    8787    if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
    88         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
    89         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
     88        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
     89        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth()));
    9090    }
    9191
    9292    if (style().maxWidth().isFixed()) {
    93         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
    94         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
     93        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
     94        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth()));
    9595    }
    9696
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r268919 r271003  
    825825    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width.
    826826    if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
    827         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
    828         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
     827        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
     828        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth()));
    829829    }
    830830
    831831    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth.
    832832    if (styleToUse.logicalMaxWidth().isFixed()) {
    833         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
     833        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth()));
    834834        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, m_minPreferredLogicalWidth);
    835835    }
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r269188 r271003  
    173173
    174174    if (style().logicalWidth().isFixed() && style().logicalWidth().value() >= 0)
    175         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().logicalWidth().value());
     175        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().logicalWidth());
    176176    else
    177177        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    178178
    179179    if (style().logicalMinWidth().isFixed() && style().logicalMinWidth().value() > 0) {
    180         m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth().value()));
    181         m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth().value()));
     180        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth()));
     181        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth()));
    182182    }
    183183
    184184    if (style().logicalMaxWidth().isFixed()) {
    185         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth().value()));
    186         m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth().value()));
     185        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth()));
     186        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth()));
    187187    }
    188188
Note: See TracChangeset for help on using the changeset viewer.