Changeset 140479 in webkit


Ignore:
Timestamp:
Jan 22, 2013 3:28:02 PM (11 years ago)
Author:
ojan@chromium.org
Message:

REGRESION(r130774): preferred width of tables does not take max-width into account
https://bugs.webkit.org/show_bug.cgi?id=107576

Reviewed by Tony Chang.

Source/WebCore:

Constrain preferred widths by min/max the way we do in other
RenderBlock subclasses. Eventually, we'll shared the code with
RenderBlock, but this is an incremental step in that direction
that we can safely merge into release branches.

Test: fast/table/min-max-width-preferred-size.html

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::computePreferredLogicalWidths):

LayoutTests:

  • fast/table/min-max-width-preferred-size-expected.txt: Added.
  • fast/table/min-max-width-preferred-size.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140474 r140479  
     12013-01-22  Ojan Vafai  <ojan@chromium.org>
     2
     3        REGRESION(r130774): preferred width of tables does not take max-width into account
     4        https://bugs.webkit.org/show_bug.cgi?id=107576
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/table/min-max-width-preferred-size-expected.txt: Added.
     9        * fast/table/min-max-width-preferred-size.html: Added.
     10
    1112013-01-22  Michael Saboff  <msaboff@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r140478 r140479  
     12013-01-22  Ojan Vafai  <ojan@chromium.org>
     2
     3        REGRESION(r130774): preferred width of tables does not take max-width into account
     4        https://bugs.webkit.org/show_bug.cgi?id=107576
     5
     6        Reviewed by Tony Chang.
     7
     8        Constrain preferred widths by min/max the way we do in other
     9        RenderBlock subclasses. Eventually, we'll shared the code with
     10        RenderBlock, but this is an incremental step in that direction
     11        that we can safely merge into release branches.
     12
     13        Test: fast/table/min-max-width-preferred-size.html
     14
     15        * rendering/RenderTable.cpp:
     16        (WebCore::RenderTable::computePreferredLogicalWidths):
     17
    1182013-01-22  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r140244 r140479  
    727727        m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth());
    728728
     729    RenderStyle* styleToUse = style();
     730    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width.
     731    if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
     732        m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
     733        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
     734    }
     735
     736    // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
     737    if (styleToUse->logicalMaxWidth().isFixed()) {
     738        m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
     739        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
     740    }
     741
     742    // FIXME: We should be adding borderAndPaddingLogicalWidth here, but m_tableLayout->computePreferredLogicalWidths already does,
     743    // so a bunch of tests break doing this naively.
    729744    setPreferredLogicalWidthsDirty(false);
    730745}
Note: See TracChangeset for help on using the changeset viewer.