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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there | 385 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there |
386 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. | 386 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. |
387 int firstLineBaseline = firstLineBoxBaseline(); | 387 int firstLineBaseline = firstLineBoxBaseline(); |
388 if (firstLineBaseline != -1) | 388 if (firstLineBaseline != -1) |
389 return firstLineBaseline; | 389 return firstLineBaseline; |
390 return (borderBefore() + paddingBefore() + contentLogicalHeight()).toInt(); | 390 return (borderBefore() + paddingBefore() + contentLogicalHeight()).toInt(); |
391 } | 391 } |
392 | 392 |
393 void LayoutTableCell::styleDidChange(StyleDifference diff, const ComputedStyle*
oldStyle) | 393 void LayoutTableCell::styleDidChange(StyleDifference diff, const ComputedStyle*
oldStyle) |
394 { | 394 { |
395 ASSERT(style()->display() == TABLE_CELL); | 395 DCHECK_EQ(style()->display(), EDisplay::TableCell); |
396 | 396 |
397 LayoutBlockFlow::styleDidChange(diff, oldStyle); | 397 LayoutBlockFlow::styleDidChange(diff, oldStyle); |
398 setHasBoxDecorationBackground(true); | 398 setHasBoxDecorationBackground(true); |
399 | 399 |
400 if (parent() && section() && oldStyle && style()->height() != oldStyle->heig
ht()) | 400 if (parent() && section() && oldStyle && style()->height() != oldStyle->heig
ht()) |
401 section()->rowLogicalHeightChanged(row()); | 401 section()->rowLogicalHeightChanged(row()); |
402 | 402 |
403 // Our intrinsic padding pushes us down to align with the baseline of other
cells on the row. If our vertical-align | 403 // Our intrinsic padding pushes us down to align with the baseline of other
cells on the row. If our vertical-align |
404 // has changed then so will the padding needed to align with other cells - c
lear it so we can recalculate it from scratch. | 404 // has changed then so will the padding needed to align with other cells - c
lear it so we can recalculate it from scratch. |
405 if (oldStyle && style()->verticalAlign() != oldStyle->verticalAlign()) | 405 if (oldStyle && style()->verticalAlign() != oldStyle->verticalAlign()) |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 LayoutTableCell* LayoutTableCell::createAnonymous(Document* document) | 1020 LayoutTableCell* LayoutTableCell::createAnonymous(Document* document) |
1021 { | 1021 { |
1022 LayoutTableCell* layoutObject = new LayoutTableCell(nullptr); | 1022 LayoutTableCell* layoutObject = new LayoutTableCell(nullptr); |
1023 layoutObject->setDocumentForAnonymous(document); | 1023 layoutObject->setDocumentForAnonymous(document); |
1024 return layoutObject; | 1024 return layoutObject; |
1025 } | 1025 } |
1026 | 1026 |
1027 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject*
parent) | 1027 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject*
parent) |
1028 { | 1028 { |
1029 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); | 1029 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); |
1030 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), TABLE_CELL); | 1030 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), EDisplay::TableCell); |
1031 newCell->setStyle(newStyle.release()); | 1031 newCell->setStyle(newStyle.release()); |
1032 return newCell; | 1032 return newCell; |
1033 } | 1033 } |
1034 | 1034 |
1035 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const | 1035 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const |
1036 { | 1036 { |
1037 // If this object has layer, the area of collapsed borders should be transpa
rent | 1037 // If this object has layer, the area of collapsed borders should be transpa
rent |
1038 // to expose the collapsed borders painted on the underlying layer. | 1038 // to expose the collapsed borders painted on the underlying layer. |
1039 if (hasLayer() && table()->collapseBorders()) | 1039 if (hasLayer() && table()->collapseBorders()) |
1040 return false; | 1040 return false; |
(...skipping 18 matching lines...) Expand all Loading... |
1059 | 1059 |
1060 return rect; | 1060 return rect; |
1061 } | 1061 } |
1062 | 1062 |
1063 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const | 1063 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const |
1064 { | 1064 { |
1065 r.move(0, -intrinsicPaddingBefore()); | 1065 r.move(0, -intrinsicPaddingBefore()); |
1066 } | 1066 } |
1067 | 1067 |
1068 } // namespace blink | 1068 } // namespace blink |
OLD | NEW |