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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. | 378 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. |
379 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); | 379 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); |
380 if (firstLineBaseline != -1) | 380 if (firstLineBaseline != -1) |
381 return firstLineBaseline; | 381 return firstLineBaseline; |
382 return paddingBefore() + borderBefore() + contentLogicalHeight(); | 382 return paddingBefore() + borderBefore() + contentLogicalHeight(); |
383 } | 383 } |
384 | 384 |
385 void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* ol
dStyle) | 385 void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* ol
dStyle) |
386 { | 386 { |
387 ASSERT(style()->display() == TABLE_CELL); | 387 ASSERT(style()->display() == TABLE_CELL); |
388 ASSERT(!row() || row()->rowIndexWasSet()); | |
389 | 388 |
390 RenderBlockFlow::styleDidChange(diff, oldStyle); | 389 RenderBlockFlow::styleDidChange(diff, oldStyle); |
391 setHasBoxDecorationBackground(true); | 390 setHasBoxDecorationBackground(true); |
392 | 391 |
393 if (parent() && section() && oldStyle && style()->height() != oldStyle->heig
ht()) | 392 if (parent() && section() && oldStyle && style()->height() != oldStyle->heig
ht()) |
394 section()->rowLogicalHeightChanged(rowIndex()); | 393 section()->rowLogicalHeightChanged(row()); |
395 | 394 |
396 // Our intrinsic padding pushes us down to align with the baseline of other
cells on the row. If our vertical-align | 395 // Our intrinsic padding pushes us down to align with the baseline of other
cells on the row. If our vertical-align |
397 // has changed then so will the padding needed to align with other cells - c
lear it so we can recalculate it from scratch. | 396 // has changed then so will the padding needed to align with other cells - c
lear it so we can recalculate it from scratch. |
398 if (oldStyle && style()->verticalAlign() != oldStyle->verticalAlign()) | 397 if (oldStyle && style()->verticalAlign() != oldStyle->verticalAlign()) |
399 clearIntrinsicPadding(); | 398 clearIntrinsicPadding(); |
400 | 399 |
401 // If border was changed, notify table. | 400 // If border was changed, notify table. |
402 if (parent()) { | 401 if (parent()) { |
403 RenderTable* table = this->table(); | 402 RenderTable* table = this->table(); |
404 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
()&& oldStyle && oldStyle->border() != style()->border()) | 403 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
()&& oldStyle && oldStyle->border() != style()->border()) |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1260 |
1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1261 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1263 { | 1262 { |
1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1263 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1264 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1266 newCell->setStyle(newStyle.release()); | 1265 newCell->setStyle(newStyle.release()); |
1267 return newCell; | 1266 return newCell; |
1268 } | 1267 } |
1269 | 1268 |
1270 } // namespace blink | 1269 } // namespace blink |
OLD | NEW |