Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
index 7b57b188a566a6211eca57a5b517e129959dd3d8..817cf19ccebc027fc03d171d173802443b612237 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
@@ -57,6 +57,7 @@ LayoutTable::LayoutTable(Element* element) |
foot_(nullptr), |
first_body_(nullptr), |
collapsed_borders_valid_(false), |
+ needs_invalidate_collapsed_borders_for_all_cells_(false), |
has_col_elements_(false), |
needs_section_recalc_(false), |
column_logical_width_changed_(false), |
@@ -777,9 +778,32 @@ void LayoutTable::UpdateLayout() { |
void LayoutTable::InvalidateCollapsedBorders() { |
collapsed_borders_.clear(); |
collapsed_borders_valid_ = false; |
+ needs_invalidate_collapsed_borders_for_all_cells_ = true; |
SetMayNeedPaintInvalidation(); |
} |
+void LayoutTable::InvalidateCollapsedBordersForAllCellsIfNeeded() { |
+ DCHECK(CollapseBorders()); |
+ |
+ if (!needs_invalidate_collapsed_borders_for_all_cells_) |
+ return; |
+ needs_invalidate_collapsed_borders_for_all_cells_ = false; |
+ |
+ for (LayoutObject* section = FirstChild(); section; |
+ section = section->NextSibling()) { |
+ if (!section->IsTableSection()) |
+ continue; |
+ for (LayoutTableRow* row = ToLayoutTableSection(section)->FirstRow(); row; |
+ row = row->NextRow()) { |
+ for (LayoutTableCell* cell = row->FirstCell(); cell; |
+ cell = cell->NextCell()) { |
+ DCHECK_EQ(cell->Table(), this); |
+ cell->InvalidateCollapsedBorderValues(); |
+ } |
+ } |
+ } |
+} |
+ |
// Collect all the unique border values that we want to paint in a sorted list. |
// During the collection, each cell saves its recalculated borders into the |
// cache of its containing section, and invalidates itself if any border |