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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 { | 303 { |
304 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of | 304 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of |
305 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there | 305 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there |
306 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. | 306 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. |
307 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); | 307 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); |
308 if (firstLineBaseline != -1) | 308 if (firstLineBaseline != -1) |
309 return firstLineBaseline; | 309 return firstLineBaseline; |
310 return paddingBefore() + borderBefore() + contentLogicalHeight(); | 310 return paddingBefore() + borderBefore() + contentLogicalHeight(); |
311 } | 311 } |
312 | 312 |
| 313 void RenderTableCell::styleWillChange(StyleDifference diff, const RenderStyle* n
ewStyle) |
| 314 { |
| 315 if (parent() && section() && style() && style()->height() != newStyle->heigh
t()) |
| 316 section()->setNeedsCellRecalc(); |
| 317 |
| 318 ASSERT(newStyle->display() == TABLE_CELL); |
| 319 |
| 320 RenderBlock::styleWillChange(diff, newStyle); |
| 321 } |
| 322 |
313 void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* ol
dStyle) | 323 void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* ol
dStyle) |
314 { | 324 { |
315 ASSERT(style()->display() == TABLE_CELL); | |
316 | |
317 RenderBlock::styleDidChange(diff, oldStyle); | 325 RenderBlock::styleDidChange(diff, oldStyle); |
318 setHasBoxDecorations(true); | 326 setHasBoxDecorations(true); |
319 | 327 |
320 if (parent() && section() && oldStyle && style()->height() != oldStyle->heig
ht() && rowWasSet()) | |
321 section()->rowLogicalHeightChanged(row()); | |
322 | |
323 // If border was changed, notify table. | 328 // If border was changed, notify table. |
324 if (parent()) { | 329 if (parent()) { |
325 RenderTable* table = this->table(); | 330 RenderTable* table = this->table(); |
326 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
()&& oldStyle && oldStyle->border() != style()->border()) | 331 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout
()&& oldStyle && oldStyle->border() != style()->border()) |
327 table->invalidateCollapsedBorders(); | 332 table->invalidateCollapsedBorders(); |
328 } | 333 } |
329 } | 334 } |
330 | 335 |
331 // The following rules apply for resolving conflicts and figuring out which bord
er | 336 // The following rules apply for resolving conflicts and figuring out which bord
er |
332 // to use. | 337 // to use. |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 totalHeight -= scrollbarHeight; | 1057 totalHeight -= scrollbarHeight; |
1053 LayoutUnit newBeforePadding = (totalHeight - heightWithoutIntrinsicPaddi
ng) / 2; | 1058 LayoutUnit newBeforePadding = (totalHeight - heightWithoutIntrinsicPaddi
ng) / 2; |
1054 LayoutUnit newAfterPadding = totalHeight - heightWithoutIntrinsicPadding
- newBeforePadding; | 1059 LayoutUnit newAfterPadding = totalHeight - heightWithoutIntrinsicPadding
- newBeforePadding; |
1055 setIntrinsicPaddingBefore(newBeforePadding); | 1060 setIntrinsicPaddingBefore(newBeforePadding); |
1056 setIntrinsicPaddingAfter(newAfterPadding); | 1061 setIntrinsicPaddingAfter(newAfterPadding); |
1057 } else | 1062 } else |
1058 setIntrinsicPaddingAfter(intrinsicPaddingAfter() - scrollbarHeight); | 1063 setIntrinsicPaddingAfter(intrinsicPaddingAfter() - scrollbarHeight); |
1059 } | 1064 } |
1060 | 1065 |
1061 } // namespace WebCore | 1066 } // namespace WebCore |
OLD | NEW |