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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableRow.cpp

Issue 2840723005: Don't always invalidate collapsed borders during table layout (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013
8 * Apple Inc. 8 * Apple Inc.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 LayoutTableBoxComponent::AddChild(cell, before_child); 165 LayoutTableBoxComponent::AddChild(cell, before_child);
166 166
167 // Generated content can result in us having a null section so make sure to 167 // Generated content can result in us having a null section so make sure to
168 // null check our parent. 168 // null check our parent.
169 if (Parent()) { 169 if (Parent()) {
170 Section()->AddCell(cell, this); 170 Section()->AddCell(cell, this);
171 // When borders collapse, adding a cell can affect the the width of 171 // When borders collapse, adding a cell can affect the the width of
172 // neighboring cells. 172 // neighboring cells.
173 LayoutTable* enclosing_table = Table(); 173 LayoutTable* enclosing_table = Table();
174 if (enclosing_table && enclosing_table->CollapseBorders()) { 174 if (enclosing_table && enclosing_table->CollapseBorders()) {
175 enclosing_table->InvalidateCollapsedBorders();
wkorman 2017/04/26 23:57:35 Would we consider further optimizing this case? We
Xianzhu 2017/04/27 15:43:40 This marks the table's collapsed borders data stru
175 if (LayoutTableCell* previous_cell = cell->PreviousCell()) 176 if (LayoutTableCell* previous_cell = cell->PreviousCell())
176 previous_cell->SetNeedsLayoutAndPrefWidthsRecalc( 177 previous_cell->SetNeedsLayoutAndPrefWidthsRecalc(
177 LayoutInvalidationReason::kTableChanged); 178 LayoutInvalidationReason::kTableChanged);
178 if (LayoutTableCell* next_cell = cell->NextCell()) 179 if (LayoutTableCell* next_cell = cell->NextCell())
179 next_cell->SetNeedsLayoutAndPrefWidthsRecalc( 180 next_cell->SetNeedsLayoutAndPrefWidthsRecalc(
180 LayoutInvalidationReason::kTableChanged); 181 LayoutInvalidationReason::kTableChanged);
181 } 182 }
182 } 183 }
183 184
184 if (before_child || NextRow()) 185 if (before_child || NextRow())
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // won't fit but we avoid the complexity of that reading until it 327 // won't fit but we avoid the complexity of that reading until it
327 // is clarified. Tracked by crbug.com/675904 328 // is clarified. Tracked by crbug.com/675904
328 if (RowIndex()) 329 if (RowIndex())
329 return false; 330 return false;
330 LayoutTableSection* header = Table()->Header(); 331 LayoutTableSection* header = Table()->Header();
331 return header && Table()->SectionAbove(Section()) == header && 332 return header && Table()->SectionAbove(Section()) == header &&
332 header->GetPaginationBreakability() != kAllowAnyBreaks; 333 header->GetPaginationBreakability() != kAllowAnyBreaks;
333 } 334 }
334 335
335 } // namespace blink 336 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698