Changeset 130774 in webkit


Ignore:
Timestamp:
Oct 9, 2012 9:55:46 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r130773 r130774  
     12012-10-09  Pravin D  <pravind.2k4@gmail.com>
     2
     3        max-width property is does not overriding the width properties for css tables(display:table)
     4        https://bugs.webkit.org/show_bug.cgi?id=98455
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/table/css-table-max-width-expected.txt: Added.
     9        * fast/table/css-table-max-width.html: Added.
     10
    1112012-10-09  Zan Dobersek  <zandobersek@gmail.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r130768 r130774  
     12012-10-09  Pravin D  <pravind.2k4@gmail.com>
     2
     3        max-width property is does not overriding the width properties for css tables(display:table)
     4        https://bugs.webkit.org/show_bug.cgi?id=98455
     5
     6        Reviewed by Tony Chang.
     7
     8        The max-width property determines the maximum computed width an element can have. In case of css tables(display:table),
     9        the computed was not being limited by the max-width property. The current patch fixes this issue.
     10
     11        Test: fast/table/css-table-max-width.html
     12
     13        * rendering/RenderTable.cpp:
     14        (WebCore::RenderTable::updateLogicalWidth):
     15         Logic to compute the logical width of an element such that it does not exceed the max-width value.
     16         Also when both min-width and max-width are present, the following contraint is used to compute the logical width:
     17           1) min-width < Computed LogicalWidth < max-width, when min-width < max-width.
     18           2) Computed LogicalWidth = min-width, when min-width > max-width.
     19
    1202012-10-09  Harald Alvestrand  <hta@google.com>
    221
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r130698 r130774  
    256256    setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth()));
    257257
     258   
     259    // Ensure we aren't bigger than our max-width style.
     260    Length styleMaxLogicalWidth = style()->logicalMaxWidth();
     261    if (styleMaxLogicalWidth.isSpecified() && !styleMaxLogicalWidth.isNegative()) {
     262        LayoutUnit computedMaxLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMaxLogicalWidth, availableLogicalWidth);
     263        setLogicalWidth(min<int>(logicalWidth(), computedMaxLogicalWidth));
     264    }
     265
    258266    // Ensure we aren't smaller than our min-width style.
    259267    Length styleMinLogicalWidth = style()->logicalMinWidth();
    260     if (styleMinLogicalWidth.isSpecified() && styleMinLogicalWidth.isPositive())
    261         setLogicalWidth(max<int>(logicalWidth(), convertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth)));
     268    if (styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative()) {
     269        LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth);
     270        setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth));
     271    }
    262272
    263273    // Finally, with our true width determined, compute our margins for real.
Note: See TracChangeset for help on using the changeset viewer.