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 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 void RenderTableRow::layout() | 159 void RenderTableRow::layout() |
160 { | 160 { |
161 ASSERT(needsLayout()); | 161 ASSERT(needsLayout()); |
162 | 162 |
163 LayoutRectRecorder recorder(*this); | 163 LayoutRectRecorder recorder(*this); |
164 | 164 |
165 // Table rows do not add translation. | 165 // Table rows do not add translation. |
166 LayoutStateMaintainer statePusher(*this, LayoutSize()); | 166 LayoutStateMaintainer statePusher(*this, LayoutSize()); |
167 | 167 |
168 bool paginated = view()->layoutState()->isPaginated(); | |
169 | |
170 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) { | 168 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) { |
171 if (child->isTableCell()) { | 169 if (child->isTableCell()) { |
172 SubtreeLayoutScope layouter(child); | 170 SubtreeLayoutScope layouter(child); |
173 RenderTableCell* cell = toRenderTableCell(child); | 171 RenderTableCell* cell = toRenderTableCell(child); |
174 if (!cell->needsLayout() && paginated && view()->layoutState()->page
LogicalHeight() && view()->layoutState()->pageLogicalOffset(*cell, cell->logical
Top()) != cell->pageLogicalOffset()) | 172 if (!cell->needsLayout()) |
175 layouter.setChildNeedsLayout(cell); | 173 cell->markForPaginationRelayoutIfNeeded(layouter); |
176 | 174 if (cell->needsLayout()) { |
177 if (child->needsLayout()) { | |
178 cell->computeAndSetBlockDirectionMargins(table()); | 175 cell->computeAndSetBlockDirectionMargins(table()); |
179 cell->layout(); | 176 cell->layout(); |
180 } | 177 } |
181 } | 178 } |
182 } | 179 } |
183 | 180 |
184 // We only ever need to repaint if our cells didn't, which means that they d
idn't need | 181 // We only ever need to repaint if our cells didn't, which means that they d
idn't need |
185 // layout, so we know that our bounds didn't change. This code is just makin
g up for | 182 // layout, so we know that our bounds didn't change. This code is just makin
g up for |
186 // the fact that we did not repaint in setStyle() because we had a layout hi
nt. | 183 // the fact that we did not repaint in setStyle() because we had a layout hi
nt. |
187 // We cannot call repaint() because our clippedOverflowRectForRepaint() is t
aken from the | 184 // We cannot call repaint() because our clippedOverflowRectForRepaint() is t
aken from the |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 282 |
286 RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderOb
ject* parent) | 283 RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderOb
ject* parent) |
287 { | 284 { |
288 RenderTableRow* newRow = RenderTableRow::createAnonymous(&parent->document()
); | 285 RenderTableRow* newRow = RenderTableRow::createAnonymous(&parent->document()
); |
289 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_ROW); | 286 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_ROW); |
290 newRow->setStyle(newStyle.release()); | 287 newRow->setStyle(newStyle.release()); |
291 return newRow; | 288 return newRow; |
292 } | 289 } |
293 | 290 |
294 } // namespace WebCore | 291 } // namespace WebCore |
OLD | NEW |