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

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

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 years, 8 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
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 addChild(cell, beforeChild); 155 addChild(cell, beforeChild);
156 cell->addChild(child); 156 cell->addChild(child);
157 return; 157 return;
158 } 158 }
159 159
160 if (beforeChild && beforeChild->parent() != this) 160 if (beforeChild && beforeChild->parent() != this)
161 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); 161 beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
162 162
163 LayoutTableCell* cell = toLayoutTableCell(child); 163 LayoutTableCell* cell = toLayoutTableCell(child);
164 164
165 ASSERT(!beforeChild || beforeChild->isTableCell()); 165 DCHECK(!beforeChild || beforeChild->isTableCell());
166 LayoutTableBoxComponent::addChild(cell, beforeChild); 166 LayoutTableBoxComponent::addChild(cell, beforeChild);
167 167
168 // Generated content can result in us having a null section so make sure to 168 // Generated content can result in us having a null section so make sure to
169 // null check our parent. 169 // null check our parent.
170 if (parent()) { 170 if (parent()) {
171 section()->addCell(cell, this); 171 section()->addCell(cell, this);
172 // When borders collapse, adding a cell can affect the the width of 172 // When borders collapse, adding a cell can affect the the width of
173 // neighboring cells. 173 // neighboring cells.
174 LayoutTable* enclosingTable = table(); 174 LayoutTable* enclosingTable = table();
175 if (enclosingTable && enclosingTable->collapseBorders()) { 175 if (enclosingTable && enclosingTable->collapseBorders()) {
176 if (LayoutTableCell* previousCell = cell->previousCell()) 176 if (LayoutTableCell* previousCell = cell->previousCell())
177 previousCell->setNeedsLayoutAndPrefWidthsRecalc( 177 previousCell->setNeedsLayoutAndPrefWidthsRecalc(
178 LayoutInvalidationReason::TableChanged); 178 LayoutInvalidationReason::TableChanged);
179 if (LayoutTableCell* nextCell = cell->nextCell()) 179 if (LayoutTableCell* nextCell = cell->nextCell())
180 nextCell->setNeedsLayoutAndPrefWidthsRecalc( 180 nextCell->setNeedsLayoutAndPrefWidthsRecalc(
181 LayoutInvalidationReason::TableChanged); 181 LayoutInvalidationReason::TableChanged);
182 } 182 }
183 } 183 }
184 184
185 if (beforeChild || nextRow()) 185 if (beforeChild || nextRow())
186 section()->setNeedsCellRecalc(); 186 section()->setNeedsCellRecalc();
187 } 187 }
188 188
189 void LayoutTableRow::layout() { 189 void LayoutTableRow::layout() {
190 ASSERT(needsLayout()); 190 DCHECK(needsLayout());
191 LayoutAnalyzer::Scope analyzer(*this); 191 LayoutAnalyzer::Scope analyzer(*this);
192 bool paginated = view()->layoutState()->isPaginated(); 192 bool paginated = view()->layoutState()->isPaginated();
193 193
194 for (LayoutTableCell* cell = firstCell(); cell; cell = cell->nextCell()) { 194 for (LayoutTableCell* cell = firstCell(); cell; cell = cell->nextCell()) {
195 SubtreeLayoutScope layouter(*cell); 195 SubtreeLayoutScope layouter(*cell);
196 cell->setLogicalTop(logicalTop()); 196 cell->setLogicalTop(logicalTop());
197 if (!cell->needsLayout()) 197 if (!cell->needsLayout())
198 section()->markChildForPaginationRelayoutIfNeeded(*cell, layouter); 198 section()->markChildForPaginationRelayoutIfNeeded(*cell, layouter);
199 if (cell->needsLayout()) 199 if (cell->needsLayout())
200 cell->layout(); 200 cell->layout();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // won't fit but we avoid the complexity of that reading until it 320 // won't fit but we avoid the complexity of that reading until it
321 // is clarified. Tracked by crbug.com/675904 321 // is clarified. Tracked by crbug.com/675904
322 if (rowIndex()) 322 if (rowIndex())
323 return false; 323 return false;
324 LayoutTableSection* header = table()->header(); 324 LayoutTableSection* header = table()->header();
325 return header && table()->sectionAbove(section()) == header && 325 return header && table()->sectionAbove(section()) == header &&
326 header->getPaginationBreakability() != AllowAnyBreaks; 326 header->getPaginationBreakability() != AllowAnyBreaks;
327 } 327 }
328 328
329 } // namespace blink 329 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableRow.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698