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 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 layouter.setNeedsLayout(this); | 225 layouter.setNeedsLayout(this); |
226 | 226 |
227 setLogicalWidth(tableLayoutLogicalWidth); | 227 setLogicalWidth(tableLayoutLogicalWidth); |
228 setCellWidthChanged(true); | 228 setCellWidthChanged(true); |
229 } | 229 } |
230 | 230 |
231 void RenderTableCell::layout() | 231 void RenderTableCell::layout() |
232 { | 232 { |
233 ASSERT(needsLayout()); | 233 ASSERT(needsLayout()); |
234 | 234 |
235 updateFirstLetter(); | |
236 | |
237 int oldCellBaseline = cellBaselinePosition(); | 235 int oldCellBaseline = cellBaselinePosition(); |
238 layoutBlock(cellWidthChanged()); | 236 layoutBlock(cellWidthChanged()); |
239 | 237 |
240 // If we have replaced content, the intrinsic height of our content may have
changed since the last time we laid out. If that's the case the intrinsic paddi
ng we used | 238 // If we have replaced content, the intrinsic height of our content may have
changed since the last time we laid out. If that's the case the intrinsic paddi
ng we used |
241 // for layout (the padding required to push the contents of the cell down to
the row's baseline) is included in our new height and baseline and makes both | 239 // for layout (the padding required to push the contents of the cell down to
the row's baseline) is included in our new height and baseline and makes both |
242 // of them wrong. So if our content's intrinsic height has changed push the
new content up into the intrinsic padding and relayout so that the rest of | 240 // of them wrong. So if our content's intrinsic height has changed push the
new content up into the intrinsic padding and relayout so that the rest of |
243 // table and row layout can use the correct baseline and height for this cel
l. | 241 // table and row layout can use the correct baseline and height for this cel
l. |
244 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin
ePosition() > section()->rowBaseline(rowIndex())) { | 242 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin
ePosition() > section()->rowBaseline(rowIndex())) { |
245 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding
Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); | 243 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding
Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); |
246 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); | 244 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1259 |
1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1260 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1263 { | 1261 { |
1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1262 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1263 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1266 newCell->setStyle(newStyle.release()); | 1264 newCell->setStyle(newStyle.release()); |
1267 return newCell; | 1265 return newCell; |
1268 } | 1266 } |
1269 | 1267 |
1270 } // namespace blink | 1268 } // namespace blink |
OLD | NEW |