Changeset 143377 in webkit


Ignore:
Timestamp:
Feb 19, 2013 1:18:00 PM (11 years ago)
Author:
tony@chromium.org
Message:

Border changes on tables with collapsed borders doesn't relayout table cells
https://bugs.webkit.org/show_bug.cgi?id=109774

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/table/border-collapsing/dynamic-border-width-change.html

Changes to border top and border bottom on table rows also changes the size
of the table cell causing a relayout to be needed.

  • rendering/RenderTableRow.cpp:

(WebCore::borderWidthChanged): Also include border top and bottom.
(WebCore::RenderTableRow::styleDidChange): Remove logical from the helper function name.

LayoutTests:

  • fast/table/border-collapsing/dynamic-border-width-change-expected.txt: Added.
  • fast/table/border-collapsing/dynamic-border-width-change.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143376 r143377  
     12013-02-19  Tony Chang  <tony@chromium.org>
     2
     3        Border changes on tables with collapsed borders doesn't relayout table cells
     4        https://bugs.webkit.org/show_bug.cgi?id=109774
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/table/border-collapsing/dynamic-border-width-change-expected.txt: Added.
     9        * fast/table/border-collapsing/dynamic-border-width-change.html: Added.
     10
    1112013-02-19  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r143374 r143377  
     12013-02-19  Tony Chang  <tony@chromium.org>
     2
     3        Border changes on tables with collapsed borders doesn't relayout table cells
     4        https://bugs.webkit.org/show_bug.cgi?id=109774
     5
     6        Reviewed by David Hyatt.
     7
     8        Test: fast/table/border-collapsing/dynamic-border-width-change.html
     9
     10        Changes to border top and border bottom on table rows also changes the size
     11        of the table cell causing a relayout to be needed.
     12
     13        * rendering/RenderTableRow.cpp:
     14        (WebCore::borderWidthChanged): Also include border top and bottom.
     15        (WebCore::RenderTableRow::styleDidChange): Remove logical from the helper function name.
     16
    1172013-02-19  Kentaro Hara  <haraken@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r143284 r143377  
    5555}
    5656
    57 static bool borderLogicalWidthChanged(const RenderStyle* oldStyle, const RenderStyle* newStyle)
    58 {
    59     if (newStyle->isHorizontalWritingMode())
    60         return oldStyle->borderLeftWidth() != newStyle->borderLeftWidth()
    61             || oldStyle->borderRightWidth() != newStyle->borderRightWidth();
    62 
    63     return oldStyle->borderTopWidth() != newStyle->borderTopWidth()
     57static bool borderWidthChanged(const RenderStyle* oldStyle, const RenderStyle* newStyle)
     58{
     59    return oldStyle->borderLeftWidth() != newStyle->borderLeftWidth()
     60        || oldStyle->borderTopWidth() != newStyle->borderTopWidth()
     61        || oldStyle->borderRightWidth() != newStyle->borderRightWidth()
    6462        || oldStyle->borderBottomWidth() != newStyle->borderBottomWidth();
    6563}
     
    8179            table->invalidateCollapsedBorders();
    8280       
    83         if (table && oldStyle && diff == StyleDifferenceLayout && needsLayout() && table->collapseBorders() && borderLogicalWidthChanged(oldStyle, style())) {
     81        if (table && oldStyle && diff == StyleDifferenceLayout && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, style())) {
    8482            // If the border width changes on a row, we need to make sure the cells in the row know to lay out again.
    8583            // This only happens when borders are collapsed, since they end up affecting the border sides of the cell
Note: See TracChangeset for help on using the changeset viewer.