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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 layouter.setNeedsLayout(this); | 224 layouter.setNeedsLayout(this); |
225 | 225 |
226 setLogicalWidth(tableLayoutLogicalWidth); | 226 setLogicalWidth(tableLayoutLogicalWidth); |
227 setCellWidthChanged(true); | 227 setCellWidthChanged(true); |
228 } | 228 } |
229 | 229 |
230 void RenderTableCell::layout() | 230 void RenderTableCell::layout() |
231 { | 231 { |
232 ASSERT(needsLayout()); | 232 ASSERT(needsLayout()); |
233 | 233 |
234 updateFirstLetter(); | |
235 | |
236 int oldCellBaseline = cellBaselinePosition(); | 234 int oldCellBaseline = cellBaselinePosition(); |
237 layoutBlock(cellWidthChanged()); | 235 layoutBlock(cellWidthChanged()); |
238 | 236 |
239 // 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 | 237 // 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 |
240 // 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 | 238 // 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 |
241 // 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 | 239 // 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 |
242 // table and row layout can use the correct baseline and height for this cel
l. | 240 // table and row layout can use the correct baseline and height for this cel
l. |
243 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin
ePosition() > section()->rowBaseline(rowIndex())) { | 241 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin
ePosition() > section()->rowBaseline(rowIndex())) { |
244 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding
Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); | 242 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding
Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); |
245 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); | 243 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 | 1045 |
1048 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1046 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1049 { | 1047 { |
1050 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1048 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
1051 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1049 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1052 newCell->setStyle(newStyle.release()); | 1050 newCell->setStyle(newStyle.release()); |
1053 return newCell; | 1051 return newCell; |
1054 } | 1052 } |
1055 | 1053 |
1056 } // namespace blink | 1054 } // namespace blink |
OLD | NEW |