| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |