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, 2009, 2013 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 Length styleOrColLogicalWidth() const | 93 Length styleOrColLogicalWidth() const |
94 { | 94 { |
95 Length styleWidth = style()->logicalWidth(); | 95 Length styleWidth = style()->logicalWidth(); |
96 if (!styleWidth.isAuto()) | 96 if (!styleWidth.isAuto()) |
97 return styleWidth; | 97 return styleWidth; |
98 if (LayoutTableCol* firstColumn = table()->colElement(col())) | 98 if (LayoutTableCol* firstColumn = table()->colElement(col())) |
99 return logicalWidthFromColumns(firstColumn, styleWidth); | 99 return logicalWidthFromColumns(firstColumn, styleWidth); |
100 return styleWidth; | 100 return styleWidth; |
101 } | 101 } |
102 | 102 |
103 int computeLogicalHeightFromCellStyle(const Length& height) const | |
mstensho (USE GERRIT)
2015/07/09 08:22:16
I don't like the name. It essentially means the sa
| |
104 { | |
105 int maximumHeight = 0; | |
mstensho (USE GERRIT)
2015/07/09 08:22:16
This one is always 0, so I don't see any need for
| |
106 if (height.isIntrinsic()) | |
107 return maximumHeight; | |
108 return valueForLength(height, maximumHeight); | |
109 } | |
110 | |
103 int logicalHeightFromStyle() const | 111 int logicalHeightFromStyle() const |
104 { | 112 { |
105 int styleLogicalHeight = valueForLength(style()->logicalHeight(), 0); | 113 int styleLogicalHeight = computeLogicalHeightFromCellStyle(style()->logi calHeight()); |
mstensho (USE GERRIT)
2015/07/09 08:22:16
Note that "LayoutUnit()" is cheaper than "0", when
| |
106 // In strict mode, box-sizing: content-box do the right thing and actual ly add in the border and padding. | 114 // In strict mode, box-sizing: content-box do the right thing and actual ly add in the border and padding. |
107 // Call computedCSSPadding* directly to avoid including implicitPadding. | 115 // Call computedCSSPadding* directly to avoid including implicitPadding. |
108 if (!document().inQuirksMode() && style()->boxSizing() != BORDER_BOX) | 116 if (!document().inQuirksMode() && style()->boxSizing() != BORDER_BOX) |
109 styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddi ngAfter()).floor() + borderBefore() + borderAfter(); | 117 styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddi ngAfter()).floor() + borderBefore() + borderAfter(); |
110 return styleLogicalHeight; | 118 return styleLogicalHeight; |
111 } | 119 } |
112 | 120 |
113 int logicalHeightForRowSizing() const | 121 int logicalHeightForRowSizing() const |
114 { | 122 { |
115 // FIXME: This function does too much work, and is very hot during table layout! | 123 // FIXME: This function does too much work, and is very hot during table layout! |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 | 317 |
310 inline LayoutTableCell* LayoutTableRow::lastCell() const | 318 inline LayoutTableCell* LayoutTableRow::lastCell() const |
311 { | 319 { |
312 ASSERT(children() == virtualChildren()); | 320 ASSERT(children() == virtualChildren()); |
313 return toLayoutTableCell(children()->lastChild()); | 321 return toLayoutTableCell(children()->lastChild()); |
314 } | 322 } |
315 | 323 |
316 } // namespace blink | 324 } // namespace blink |
317 | 325 |
318 #endif // LayoutTableCell_h | 326 #endif // LayoutTableCell_h |
OLD | NEW |