| 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 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 if (beforeChild && beforeChild->parent() != this) | 147 if (beforeChild && beforeChild->parent() != this) |
| 148 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); | 148 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); |
| 149 | 149 |
| 150 LayoutTableCell* cell = toLayoutTableCell(child); | 150 LayoutTableCell* cell = toLayoutTableCell(child); |
| 151 | 151 |
| 152 ASSERT(!beforeChild || beforeChild->isTableCell()); | 152 ASSERT(!beforeChild || beforeChild->isTableCell()); |
| 153 LayoutTableBoxComponent::addChild(cell, beforeChild); | 153 LayoutTableBoxComponent::addChild(cell, beforeChild); |
| 154 | 154 |
| 155 // Generated content can result in us having a null section so make sure to
null check our parent. | 155 // Generated content can result in us having a null section so make sure to
null check our parent. |
| 156 if (parent()) | 156 if (parent()) { |
| 157 section()->addCell(cell, this); | 157 section()->addCell(cell, this); |
| 158 // When borders collapse, adding a cell can affect the the width of neig
hboring cells. |
| 159 LayoutTable* enclosingTable = table(); |
| 160 if (enclosingTable && enclosingTable->collapseBorders()) { |
| 161 if (LayoutTableCell* previousCell = cell->previousCell()) |
| 162 previousCell->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidati
onReason::TableChanged); |
| 163 if (LayoutTableCell* nextCell = cell->nextCell()) |
| 164 nextCell->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationRe
ason::TableChanged); |
| 165 } |
| 166 } |
| 158 | 167 |
| 159 if (beforeChild || nextRow()) | 168 if (beforeChild || nextRow()) |
| 160 section()->setNeedsCellRecalc(); | 169 section()->setNeedsCellRecalc(); |
| 161 } | 170 } |
| 162 | 171 |
| 163 void LayoutTableRow::layout() | 172 void LayoutTableRow::layout() |
| 164 { | 173 { |
| 165 ASSERT(needsLayout()); | 174 ASSERT(needsLayout()); |
| 166 LayoutAnalyzer::Scope analyzer(*this); | 175 LayoutAnalyzer::Scope analyzer(*this); |
| 167 | 176 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // The cell and the row share the section's coordinate system. However | 274 // The cell and the row share the section's coordinate system. However |
| 266 // the visual overflow should be determined in the coordinate system of | 275 // the visual overflow should be determined in the coordinate system of |
| 267 // the row, that's why we shift it below. | 276 // the row, that's why we shift it below. |
| 268 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location(
).y(); | 277 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location(
).y(); |
| 269 cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference); | 278 cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference); |
| 270 | 279 |
| 271 addContentsVisualOverflow(cellVisualOverflowRect); | 280 addContentsVisualOverflow(cellVisualOverflowRect); |
| 272 } | 281 } |
| 273 | 282 |
| 274 } // namespace blink | 283 } // namespace blink |
| OLD | NEW |