| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 347 } |
| 348 if (bottom) { | 348 if (bottom) { |
| 349 if (LayoutTableCell* below = table()->cellBelow(this)) { | 349 if (LayoutTableCell* below = table()->cellBelow(this)) { |
| 350 left = std::max(left, below->borderHalfLeft(true)); | 350 left = std::max(left, below->borderHalfLeft(true)); |
| 351 right = std::max(right, below->borderHalfRight(true)); | 351 right = std::max(right, below->borderHalfRight(true)); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 LayoutPoint location(std::max<LayoutUnit>(left, -visualOverflowRect().x()),
std::max<LayoutUnit>(top, -visualOverflowRect().y())); | 354 LayoutPoint location(std::max<LayoutUnit>(left, -visualOverflowRect().x()),
std::max<LayoutUnit>(top, -visualOverflowRect().y())); |
| 355 LayoutRect r(-location.x(), -location.y(), location.x() + std::max(size().wi
dth() + right, visualOverflowRect().maxX()), location.y() + std::max(size().heig
ht() + bottom, visualOverflowRect().maxY())); | 355 LayoutRect r(-location.x(), -location.y(), location.x() + std::max(size().wi
dth() + right, visualOverflowRect().maxX()), location.y() + std::max(size().heig
ht() + bottom, visualOverflowRect().maxY())); |
| 356 | 356 |
| 357 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); | 357 mapToVisibleRectInContainerSpace(paintInvalidationContainer, r, paintInvalid
ationState); |
| 358 return r; | 358 return r; |
| 359 } | 359 } |
| 360 | 360 |
| 361 void LayoutTableCell::mapRectToPaintInvalidationBacking(const LayoutBoxModelObje
ct* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* pai
ntInvalidationState) const | 361 void LayoutTableCell::mapToVisibleRectInContainerSpace(const LayoutBoxModelObjec
t* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* pain
tInvalidationState) const |
| 362 { | 362 { |
| 363 if (paintInvalidationContainer == this) | 363 if (paintInvalidationContainer == this) |
| 364 return; | 364 return; |
| 365 r.setY(r.y()); | 365 r.setY(r.y()); |
| 366 if ((!paintInvalidationState || !paintInvalidationState->canMapToContainer(p
aintInvalidationContainer)) && parent()) | 366 if ((!paintInvalidationState || !paintInvalidationState->canMapToContainer(p
aintInvalidationContainer)) && parent()) |
| 367 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s
pace, so don't add their offset in. | 367 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s
pace, so don't add their offset in. |
| 368 LayoutBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine
r, r, paintInvalidationState); | 368 LayoutBlockFlow::mapToVisibleRectInContainerSpace(paintInvalidationContainer
, r, paintInvalidationState); |
| 369 } | 369 } |
| 370 | 370 |
| 371 LayoutUnit LayoutTableCell::cellBaselinePosition() const | 371 LayoutUnit LayoutTableCell::cellBaselinePosition() const |
| 372 { | 372 { |
| 373 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of | 373 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of |
| 374 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there | 374 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there |
| 375 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. | 375 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. |
| 376 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); | 376 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); |
| 377 if (firstLineBaseline != -1) | 377 if (firstLineBaseline != -1) |
| 378 return firstLineBaseline; | 378 return firstLineBaseline; |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 | 1006 |
| 1007 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject*
parent) | 1007 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject*
parent) |
| 1008 { | 1008 { |
| 1009 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); | 1009 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); |
| 1010 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), TABLE_CELL); | 1010 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), TABLE_CELL); |
| 1011 newCell->setStyle(newStyle.release()); | 1011 newCell->setStyle(newStyle.release()); |
| 1012 return newCell; | 1012 return newCell; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 } // namespace blink | 1015 } // namespace blink |
| OLD | NEW |