Ignore:
Timestamp:
Sep 10, 2021, 6:41:43 AM (4 years 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.