Changeset 143534 in webkit


Ignore:
Timestamp:
Feb 20, 2013 4:32:33 PM (11 years ago)
Author:
jchaffraix@webkit.org
Message:

Revert 130774

max-width property is does not overriding the width properties for css tables(display:table)
https://bugs.webkit.org/show_bug.cgi?id=98455

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-10-09
Reviewed by Tony Chang.

Source/WebCore:

The max-width property determines the maximum computed width an element can have. In case of css tables(display:table),
the computed was not being limited by the max-width property. The current patch fixes this issue.

Test: fast/table/css-table-max-width.html

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::updateLogicalWidth):

Logic to compute the logical width of an element such that it does not exceed the max-width value.
Also when both min-width and max-width are present, the following contraint is used to compute the logical width:

1) min-width < Computed LogicalWidth < max-width, when min-width < max-width.
2) Computed LogicalWidth = min-width, when min-width > max-width.

LayoutTests:

  • fast/table/css-table-max-width-expected.txt: Added.
  • fast/table/css-table-max-width.html: Added.

TBR=tony@chromium.org
Review URL: https://codereview.chromium.org/12316027

Location:
branches/chromium/1410
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/1410/Source/WebCore/rendering/RenderTable.cpp

    r140479 r143534  
    274274    setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth()));
    275275
    276    
    277     // Ensure we aren't bigger than our max-width style.
    278     Length styleMaxLogicalWidth = style()->logicalMaxWidth();
    279     if (styleMaxLogicalWidth.isSpecified() && !styleMaxLogicalWidth.isNegative()) {
    280         LayoutUnit computedMaxLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMaxLogicalWidth, availableLogicalWidth);
    281         setLogicalWidth(min<int>(logicalWidth(), computedMaxLogicalWidth));
    282     }
    283 
    284276    // Ensure we aren't smaller than our min-width style.
    285277    Length styleMinLogicalWidth = style()->logicalMinWidth();
    286     if (styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative()) {
    287         LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth);
    288         setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth));
    289     }
     278    if (styleMinLogicalWidth.isSpecified() && styleMinLogicalWidth.isPositive())
     279        setLogicalWidth(max<int>(logicalWidth(), convertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth)));
    290280
    291281    // Finally, with our true width determined, compute our margins for real.
Note: See TracChangeset for help on using the changeset viewer.