| 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. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 Apple Inc. |
| 8 * All rights reserved. | 8 * All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 int logicalHeightFromStyle() const { | 150 int logicalHeightFromStyle() const { |
| 151 Length height = style()->logicalHeight(); | 151 Length height = style()->logicalHeight(); |
| 152 int styleLogicalHeight = height.isIntrinsicOrAuto() | 152 int styleLogicalHeight = height.isIntrinsicOrAuto() |
| 153 ? 0 | 153 ? 0 |
| 154 : valueForLength(height, LayoutUnit()).toInt(); | 154 : valueForLength(height, LayoutUnit()).toInt(); |
| 155 | 155 |
| 156 // In strict mode, box-sizing: content-box do the right thing and actually | 156 // In strict mode, box-sizing: content-box do the right thing and actually |
| 157 // add in the border and padding. | 157 // add in the border and padding. |
| 158 // Call computedCSSPadding* directly to avoid including implicitPadding. | 158 // Call computedCSSPadding* directly to avoid including implicitPadding. |
| 159 if (!document().inQuirksMode() && | 159 if (!document().inQuirksMode() && |
| 160 style()->boxSizing() != EBoxSizing::kBorderBox) | 160 style()->boxSizing() != EBoxSizing::kBorderBox) { |
| 161 styleLogicalHeight += | 161 styleLogicalHeight += |
| 162 (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + | 162 (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + |
| 163 borderBefore() + borderAfter(); | 163 (borderBefore() + borderAfter()).floor(); |
| 164 } |
| 164 return styleLogicalHeight; | 165 return styleLogicalHeight; |
| 165 } | 166 } |
| 166 | 167 |
| 167 int logicalHeightForRowSizing() const { | 168 int logicalHeightForRowSizing() const { |
| 168 // FIXME: This function does too much work, and is very hot during table | 169 // FIXME: This function does too much work, and is very hot during table |
| 169 // layout! | 170 // layout! |
| 170 int adjustedLogicalHeight = | 171 int adjustedLogicalHeight = |
| 171 pixelSnappedLogicalHeight() - | 172 pixelSnappedLogicalHeight() - |
| 172 (intrinsicPaddingBefore() + intrinsicPaddingAfter()); | 173 (intrinsicPaddingBefore() + intrinsicPaddingAfter()); |
| 173 int styleLogicalHeight = logicalHeightFromStyle(); | 174 int styleLogicalHeight = logicalHeightFromStyle(); |
| 174 return max(styleLogicalHeight, adjustedLogicalHeight); | 175 return max(styleLogicalHeight, adjustedLogicalHeight); |
| 175 } | 176 } |
| 176 | 177 |
| 177 void setCellLogicalWidth(int constrainedLogicalWidth, SubtreeLayoutScope&); | 178 void setCellLogicalWidth(int constrainedLogicalWidth, SubtreeLayoutScope&); |
| 178 | 179 |
| 179 int borderLeft() const override; | 180 LayoutUnit borderLeft() const override; |
| 180 int borderRight() const override; | 181 LayoutUnit borderRight() const override; |
| 181 int borderTop() const override; | 182 LayoutUnit borderTop() const override; |
| 182 int borderBottom() const override; | 183 LayoutUnit borderBottom() const override; |
| 183 int borderStart() const override; | 184 LayoutUnit borderStart() const override; |
| 184 int borderEnd() const override; | 185 LayoutUnit borderEnd() const override; |
| 185 int borderBefore() const override; | 186 LayoutUnit borderBefore() const override; |
| 186 int borderAfter() const override; | 187 LayoutUnit borderAfter() const override; |
| 187 | 188 |
| 188 void collectBorderValues(LayoutTable::CollapsedBorderValues&); | 189 void collectBorderValues(LayoutTable::CollapsedBorderValues&); |
| 189 static void sortBorderValues(LayoutTable::CollapsedBorderValues&); | 190 static void sortBorderValues(LayoutTable::CollapsedBorderValues&); |
| 190 | 191 |
| 191 void layout() override; | 192 void layout() override; |
| 192 | 193 |
| 193 void paint(const PaintInfo&, const LayoutPoint&) const override; | 194 void paint(const PaintInfo&, const LayoutPoint&) const override; |
| 194 | 195 |
| 195 int cellBaselinePosition() const; | 196 int cellBaselinePosition() const; |
| 196 bool isBaselineAligned() const { | 197 bool isBaselineAligned() const { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 372 |
| 372 void updateLogicalWidth() override; | 373 void updateLogicalWidth() override; |
| 373 | 374 |
| 374 void paintBoxDecorationBackground(const PaintInfo&, | 375 void paintBoxDecorationBackground(const PaintInfo&, |
| 375 const LayoutPoint&) const override; | 376 const LayoutPoint&) const override; |
| 376 void paintMask(const PaintInfo&, const LayoutPoint&) const override; | 377 void paintMask(const PaintInfo&, const LayoutPoint&) const override; |
| 377 | 378 |
| 378 LayoutSize offsetFromContainer(const LayoutObject*) const override; | 379 LayoutSize offsetFromContainer(const LayoutObject*) const override; |
| 379 LayoutRect localVisualRect() const override; | 380 LayoutRect localVisualRect() const override; |
| 380 | 381 |
| 381 int borderHalfLeft(bool outer) const; | 382 LayoutUnit borderHalfLeft(bool outer) const; |
| 382 int borderHalfRight(bool outer) const; | 383 LayoutUnit borderHalfRight(bool outer) const; |
| 383 int borderHalfTop(bool outer) const; | 384 LayoutUnit borderHalfTop(bool outer) const; |
| 384 int borderHalfBottom(bool outer) const; | 385 LayoutUnit borderHalfBottom(bool outer) const; |
| 385 | 386 |
| 386 int borderHalfStart(bool outer) const; | 387 LayoutUnit borderHalfStart(bool outer) const; |
| 387 int borderHalfEnd(bool outer) const; | 388 LayoutUnit borderHalfEnd(bool outer) const; |
| 388 int borderHalfBefore(bool outer) const; | 389 LayoutUnit borderHalfBefore(bool outer) const; |
| 389 int borderHalfAfter(bool outer) const; | 390 LayoutUnit borderHalfAfter(bool outer) const; |
| 390 | 391 |
| 391 void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; } | 392 void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; } |
| 392 void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; } | 393 void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; } |
| 393 void setIntrinsicPadding(int before, int after) { | 394 void setIntrinsicPadding(int before, int after) { |
| 394 setIntrinsicPaddingBefore(before); | 395 setIntrinsicPaddingBefore(before); |
| 395 setIntrinsicPaddingAfter(after); | 396 setIntrinsicPaddingAfter(after); |
| 396 } | 397 } |
| 397 | 398 |
| 398 bool hasStartBorderAdjoiningTable() const; | 399 bool hasStartBorderAdjoiningTable() const; |
| 399 bool hasEndBorderAdjoiningTable() const; | 400 bool hasEndBorderAdjoiningTable() const; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 return toLayoutTableCell(firstChild()); | 471 return toLayoutTableCell(firstChild()); |
| 471 } | 472 } |
| 472 | 473 |
| 473 inline LayoutTableCell* LayoutTableRow::lastCell() const { | 474 inline LayoutTableCell* LayoutTableRow::lastCell() const { |
| 474 return toLayoutTableCell(lastChild()); | 475 return toLayoutTableCell(lastChild()); |
| 475 } | 476 } |
| 476 | 477 |
| 477 } // namespace blink | 478 } // namespace blink |
| 478 | 479 |
| 479 #endif // LayoutTableCell_h | 480 #endif // LayoutTableCell_h |
| OLD | NEW |