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

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

Issue 2013693002: [css-tables] Set table and cell widths dirty when section border changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: now with layout test Created 4 years, 7 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/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index fc6328921f0d096245b5cf5b09d47034ea2e6f98..a1792bda352ceb5116c12be7d7110b7181a3e832 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -125,6 +125,11 @@ void LayoutTableSection::styleDidChange(StyleDifference diff, const ComputedStyl
LayoutTable* table = this->table();
if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
table->invalidateCollapsedBorders();
+
+ if (table && oldStyle && diff.needsFullLayout() && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, style())) {
+ // TODO(dgrogan): Do we need to call cell->setChildNeedsLayout() like LayoutTableRow::styleDidChange does?
dgrogan 2016/05/27 00:23:53 I'll dig into this tomorrow if you don't know off
mstensho (USE GERRIT) 2016/05/27 08:36:33 My guess: yes, you need to do that. I'm not aware
+ markAllCellWidthsDirty();
+ }
}
void LayoutTableSection::willBeRemovedFromTree()
@@ -1205,6 +1210,17 @@ bool LayoutTableSection::recalcChildOverflowAfterStyleChange()
return childrenOverflowChanged;
}
+void LayoutTableSection::markAllCellWidthsDirty()
+{
+ for (unsigned i = 0; i < numRows(); i++) {
+ LayoutTableRow* row = rowLayoutObjectAt(i);
+ if (!row)
+ continue;
+ for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCell())
+ cell->setPreferredLogicalWidthsDirty();
+ }
+}
+
int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) const
{
unsigned totalCols = table()->numEffectiveColumns();

Powered by Google App Engine
This is Rietveld 408576698