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

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

Issue 2173163003: [css-tables] Mark sibling cells dirty when a cell is removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark fast/repaint/table-collapsed-border.html NeedsRebaseline Created 4 years, 5 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/platform/linux/fast/repaint/table-collapsed-border-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/LayoutTableCell.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
index 3469d4abc189a54d4964cd1e3a3e42f8a862488f..eb1a8260179b81039b035d7b71c08e89f7762374 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -66,6 +66,26 @@ void LayoutTableCell::willBeRemovedFromTree()
LayoutBlockFlow::willBeRemovedFromTree();
section()->setNeedsCellRecalc();
+
+ // When borders collapse, removing a cell can affect the the width of neighboring cells.
+ if (!parent())
+ return;
+ LayoutTable* enclosingTable = table();
+ DCHECK(enclosingTable);
+ if (!enclosingTable->collapseBorders())
+ return;
+ if (previousCell()) {
+ // TODO(dgrogan): Should this be setChildNeedsLayout or setNeedsLayout?
+ // remove-cell-with-border-box.html only passes with setNeedsLayout but other places
+ // use setChildNeedsLayout.
+ previousCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged);
+ previousCell()->setPreferredLogicalWidthsDirty();
+ }
+ if (nextCell()) {
+ // TODO(dgrogan): Same as above re: setChildNeedsLayout vs setNeedsLayout.
+ nextCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged);
+ nextCell()->setPreferredLogicalWidthsDirty();
+ }
}
unsigned LayoutTableCell::parseColSpanFromDOM() const
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/fast/repaint/table-collapsed-border-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698