Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableRow.cpp

Issue 2281343002: [css-tables] Mark sibling cells dirty when a cell is added (Closed)
Patch Set: respond to comments; fix test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/border-collapsing/cached-cell-append-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
index 39bdbe41f383311d058cea2b39f8bacc7c4cd6db..e51a52a501388e39453a156c45bffff9e99fd5d9 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -153,8 +153,17 @@ void LayoutTableRow::addChild(LayoutObject* child, LayoutObject* beforeChild)
LayoutTableBoxComponent::addChild(cell, beforeChild);
// Generated content can result in us having a null section so make sure to null check our parent.
- if (parent())
+ if (parent()) {
section()->addCell(cell, this);
+ // When borders collapse, adding a cell can affect the the width of neighboring cells.
+ LayoutTable* enclosingTable = table();
+ if (enclosingTable && enclosingTable->collapseBorders()) {
+ if (LayoutTableCell* previousCell = cell->previousCell())
+ previousCell->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::TableChanged);
+ if (LayoutTableCell* nextCell = cell->nextCell())
+ nextCell->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::TableChanged);
+ }
+ }
if (beforeChild || nextRow())
section()->setNeedsCellRecalc();
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/border-collapsing/cached-cell-append-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698