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

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: handle case where row is null 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
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 0ae4fb46923ad596b573577cd6a435dc06ebf617..ff50a66cd30b031d284e70c3aeafdd6adfa44a03 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -126,6 +126,10 @@ 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() && oldStyle->border() != style()->border()) {
+ markAllCellsWidthsDirtyAndOrNeedsLayout(MarkDirtyAndNeedsLayout);
+ }
}
void LayoutTableSection::willBeRemovedFromTree()
@@ -1221,6 +1225,20 @@ bool LayoutTableSection::recalcChildOverflowAfterStyleChange()
return childrenOverflowChanged;
}
+void LayoutTableSection::markAllCellsWidthsDirtyAndOrNeedsLayout(WhatToMarkAllCells whatToMark)
+{
+ 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();
+ if (whatToMark == MarkDirtyAndNeedsLayout)
+ cell->setChildNeedsLayout();
+ }
+ }
+}
+
int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) const
{
unsigned totalCols = table()->numEffectiveColumns();

Powered by Google App Engine
This is Rietveld 408576698