Changeset 282266 in webkit


Ignore:
Timestamp:
Sep 10, 2021 6:41:43 AM (10 months ago)
Author:
Alan Bujtas
Message:

changing border size on rows with border-collapse not redrawing
https://bugs.webkit.org/show_bug.cgi?id=116868
<rdar://problem/82844412>

Reviewed by Simon Fraser.

Source/WebCore:

Cells in adjacent rows share the same collapsed border.
When this collapsed border width changes on a row, the cells at the adjacent rows need to know about it too so that
they can update their size accordingly.

Test: fast/table/collapsed-border-width-change-on-row.html

  • rendering/RenderTableRow.cpp:

(WebCore::RenderTableRow::styleDidChange):

LayoutTests:

  • fast/table/collapsed-border-width-change-on-row-expected.html: Added.
  • fast/table/collapsed-border-width-change-on-row.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282264 r282266  
     12021-09-10  Alan Bujtas  <zalan@apple.com>
     2
     3        changing border size on rows with border-collapse not redrawing
     4        https://bugs.webkit.org/show_bug.cgi?id=116868
     5        <rdar://problem/82844412>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/table/collapsed-border-width-change-on-row-expected.html: Added.
     10        * fast/table/collapsed-border-width-change-on-row.html: Added.
     11
    1122021-09-10  Rob Buis  <rbuis@igalia.com>
    213
  • trunk/LayoutTests/platform/ios/fast/table/border-collapsing/cached-change-row-border-width-expected.txt

    r201234 r282266  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderTable {TABLE} at (0,0) size 58x103 [border: (2px solid #0000FF)]
    7         RenderTableSection {TBODY} at (2,2) size 54x100
    8           RenderTableRow {TR} at (0,0) size 54x50 [border: (4px solid #FFFF00)]
    9             RenderTableCell {TD} at (0,22) size 54x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
    10           RenderTableRow {TR} at (0,50) size 54x50
    11             RenderTableCell {TD} at (0,73) size 54x4 [border: (2px none #000000)] [r=1 c=0 rs=1 cs=1]
     6      RenderTable {TABLE} at (0,0) size 60x103 [border: (2px solid #0000FF)]
     7        RenderTableSection {TBODY} at (2,2) size 56x100
     8          RenderTableRow {TR} at (0,0) size 56x50 [border: (4px solid #FFFF00)]
     9            RenderTableCell {TD} at (0,22) size 56x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
     10          RenderTableRow {TR} at (0,50) size 56x50
     11            RenderTableCell {TD} at (0,73) size 56x4 [border: (2px none #000000)] [r=1 c=0 rs=1 cs=1]
  • trunk/LayoutTests/platform/mac/fast/table/border-collapsing/cached-change-row-border-width-expected.txt

    r201234 r282266  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderTable {TABLE} at (0,0) size 58x103 [border: (2px solid #0000FF)]
    7         RenderTableSection {TBODY} at (2,2) size 54x100
    8           RenderTableRow {TR} at (0,0) size 54x50 [border: (4px solid #FFFF00)]
    9             RenderTableCell {TD} at (0,22) size 54x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
    10           RenderTableRow {TR} at (0,50) size 54x50
    11             RenderTableCell {TD} at (0,73) size 54x4 [border: (2px none #000000)] [r=1 c=0 rs=1 cs=1]
     6      RenderTable {TABLE} at (0,0) size 60x103 [border: (2px solid #0000FF)]
     7        RenderTableSection {TBODY} at (2,2) size 56x100
     8          RenderTableRow {TR} at (0,0) size 56x50 [border: (4px solid #FFFF00)]
     9            RenderTableCell {TD} at (0,22) size 56x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
     10          RenderTableRow {TR} at (0,50) size 56x50
     11            RenderTableCell {TD} at (0,73) size 56x4 [border: (2px none #000000)] [r=1 c=0 rs=1 cs=1]
  • trunk/Source/WebCore/ChangeLog

    r282265 r282266  
     12021-09-10  Alan Bujtas  <zalan@apple.com>
     2
     3        changing border size on rows with border-collapse not redrawing
     4        https://bugs.webkit.org/show_bug.cgi?id=116868
     5        <rdar://problem/82844412>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Cells in adjacent rows share the same collapsed border.
     10        When this collapsed border width changes on a row, the cells at the adjacent rows need to know about it too so that
     11        they can update their size accordingly.
     12
     13        Test: fast/table/collapsed-border-width-change-on-row.html
     14
     15        * rendering/RenderTableRow.cpp:
     16        (WebCore::RenderTableRow::styleDidChange):
     17
    1182021-09-10  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r277802 r282266  
    9494            // This only happens when borders are collapsed, since they end up affecting the border sides of the cell
    9595            // itself.
    96             for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell())
    97                 cell->setChildNeedsLayout(MarkOnlyThis);
     96            auto propagageNeedsLayoutOnBorderSizeChange = [&] (auto& row) {
     97                for (auto* cell = row.firstCell(); cell; cell = cell->nextCell())
     98                    cell->setNeedsLayoutAndPrefWidthsRecalc();
     99            };
     100            propagageNeedsLayoutOnBorderSizeChange(*this);
     101            if (auto* previousRow = this->previousRow())
     102                propagageNeedsLayoutOnBorderSizeChange(*previousRow);
     103            if (auto* nextRow = this->nextRow())
     104                propagageNeedsLayoutOnBorderSizeChange(*nextRow);
    98105        }
    99106    }
Note: See TracChangeset for help on using the changeset viewer.