Chromium Code Reviews| 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..2719f10bd51c8541ccc1afc3ee00c8c46b0d1e47 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(true /*markNeedsLayout*/); |
|
Xianzhu
2016/07/07 23:13:30
This is a good example that we prefer enum to bool
|
| + } |
| } |
| void LayoutTableSection::willBeRemovedFromTree() |
| @@ -1221,6 +1225,21 @@ bool LayoutTableSection::recalcChildOverflowAfterStyleChange() |
| return childrenOverflowChanged; |
| } |
| +void LayoutTableSection::markAllCellsWidthsDirtyAndOrNeedsLayout(bool markNeedsLayout) |
|
Xianzhu
2016/07/07 23:13:30
Please change the parameter to an enum (or you can
|
| +{ |
| + for (unsigned i = 0; i < numRows(); i++) { |
| + LayoutTableRow* row = rowLayoutObjectAt(i); |
| + // CHECK instead of DCHECK to see if this can be triggered in the wild. |
| + // TODO(dgrogan): Change to DCHECK after m54 hits stable. |
| + CHECK(row); |
| + for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->nextCell()) { |
| + cell->setPreferredLogicalWidthsDirty(); |
| + if (markNeedsLayout) |
| + cell->setChildNeedsLayout(); |
| + } |
| + } |
| +} |
| + |
| int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) const |
| { |
| unsigned totalCols = table()->numEffectiveColumns(); |