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

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: 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
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..73453296b50f97a87f52c1eaa4e88b2087e4ca75 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -153,8 +153,21 @@ 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 (cell->previousCell()) {
mstensho (USE GERRIT) 2016/08/29 09:07:17 Might as well write "if (LayoutTableCell* previous
dgrogan 2016/08/31 21:42:19 Done.
+ cell->previousCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged);
mstensho (USE GERRIT) 2016/08/29 09:07:17 Can use setNeedsLayoutAndPrefWidthsRecalc() instea
dgrogan 2016/08/31 21:42:19 Done.
+ cell->previousCell()->setPreferredLogicalWidthsDirty();
+ }
+ if (cell->nextCell()) {
mstensho (USE GERRIT) 2016/08/29 09:07:17 Ditto 1.
dgrogan 2016/08/31 21:42:19 Done.
+ cell->nextCell()->setNeedsLayout(LayoutInvalidationReason::TableChanged);
mstensho (USE GERRIT) 2016/08/29 09:07:17 Ditto 2.
dgrogan 2016/08/31 21:42:18 Done.
+ cell->nextCell()->setPreferredLogicalWidthsDirty();
+ }
+ }
+ }
if (beforeChild || nextRow())
section()->setNeedsCellRecalc();

Powered by Google App Engine
This is Rietveld 408576698