| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 void RenderTableCell::colSpanOrRowSpanChanged() | 98 void RenderTableCell::colSpanOrRowSpanChanged() |
| 99 { | 99 { |
| 100 ASSERT(node()); | 100 ASSERT(node()); |
| 101 ASSERT(isHTMLTableCellElement(*node())); | 101 ASSERT(isHTMLTableCellElement(*node())); |
| 102 | 102 |
| 103 updateColAndRowSpanFlags(); | 103 updateColAndRowSpanFlags(); |
| 104 | 104 |
| 105 // FIXME: I suspect that we could return early here if !m_hasColSpan && !m_h
asRowSpan. | 105 // FIXME: I suspect that we could return early here if !m_hasColSpan && !m_h
asRowSpan. |
| 106 | 106 |
| 107 setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 107 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
| 108 if (parent() && section()) | 108 if (parent() && section()) |
| 109 section()->setNeedsCellRecalc(); | 109 section()->setNeedsCellRecalc(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 Length RenderTableCell::logicalWidthFromColumns(RenderTableCol* firstColForThisC
ell, Length widthFromStyle) const | 112 Length RenderTableCell::logicalWidthFromColumns(RenderTableCol* firstColForThisC
ell, Length widthFromStyle) const |
| 113 { | 113 { |
| 114 ASSERT(firstColForThisCell && firstColForThisCell == table()->colElement(col
())); | 114 ASSERT(firstColForThisCell && firstColForThisCell == table()->colElement(col
())); |
| 115 RenderTableCol* tableCol = firstColForThisCell; | 115 RenderTableCol* tableCol = firstColForThisCell; |
| 116 | 116 |
| 117 unsigned colSpanCount = colSpan(); | 117 unsigned colSpanCount = colSpan(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 { | 218 { |
| 219 } | 219 } |
| 220 | 220 |
| 221 void RenderTableCell::setCellLogicalWidth(int tableLayoutLogicalWidth, SubtreeLa
youtScope& layouter) | 221 void RenderTableCell::setCellLogicalWidth(int tableLayoutLogicalWidth, SubtreeLa
youtScope& layouter) |
| 222 { | 222 { |
| 223 if (tableLayoutLogicalWidth == logicalWidth()) | 223 if (tableLayoutLogicalWidth == logicalWidth()) |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 layouter.setNeedsLayout(this); | 226 layouter.setNeedsLayout(this); |
| 227 | 227 |
| 228 if (!table()->selfNeedsLayout() && checkForRepaintDuringLayout()) | 228 if (!table()->selfNeedsLayout() && checkForPaintInvalidationDuringLayout()) |
| 229 paintInvalidationForWholeRenderer(); | 229 paintInvalidationForWholeRenderer(); |
| 230 | 230 |
| 231 setLogicalWidth(tableLayoutLogicalWidth); | 231 setLogicalWidth(tableLayoutLogicalWidth); |
| 232 setCellWidthChanged(true); | 232 setCellWidthChanged(true); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void RenderTableCell::layout() | 235 void RenderTableCell::layout() |
| 236 { | 236 { |
| 237 ASSERT(needsLayout()); | 237 ASSERT(needsLayout()); |
| 238 | 238 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 { | 312 { |
| 313 ASSERT(o == container()); | 313 ASSERT(o == container()); |
| 314 | 314 |
| 315 LayoutSize offset = RenderBlockFlow::offsetFromContainer(o, point, offsetDep
endsOnPoint); | 315 LayoutSize offset = RenderBlockFlow::offsetFromContainer(o, point, offsetDep
endsOnPoint); |
| 316 if (parent()) | 316 if (parent()) |
| 317 offset -= parentBox()->locationOffset(); | 317 offset -= parentBox()->locationOffset(); |
| 318 | 318 |
| 319 return offset; | 319 return offset; |
| 320 } | 320 } |
| 321 | 321 |
| 322 LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel
Object* repaintContainer) const | 322 LayoutRect RenderTableCell::clippedOverflowRectForPaintInvalidation(const Render
LayerModelObject* paintInvalidationContainer) const |
| 323 { | 323 { |
| 324 // If the table grid is dirty, we cannot get reliable information about adjo
ining cells, | 324 // If the table grid is dirty, we cannot get reliable information about adjo
ining cells, |
| 325 // so we ignore outside borders. This should not be a problem because it mea
ns that | 325 // so we ignore outside borders. This should not be a problem because it mea
ns that |
| 326 // the table is going to recalculate the grid, relayout and repaint its curr
ent rect, which | 326 // the table is going to recalculate the grid, relayout and repaint its curr
ent rect, which |
| 327 // includes any outside borders of this cell. | 327 // includes any outside borders of this cell. |
| 328 if (!table()->collapseBorders() || table()->needsSectionRecalc()) | 328 if (!table()->collapseBorders() || table()->needsSectionRecalc()) |
| 329 return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer); | 329 return RenderBlockFlow::clippedOverflowRectForPaintInvalidation(paintInv
alidationContainer); |
| 330 | 330 |
| 331 bool rtl = !styleForCellFlow()->isLeftToRightDirection(); | 331 bool rtl = !styleForCellFlow()->isLeftToRightDirection(); |
| 332 int outlineSize = style()->outlineSize(); | 332 int outlineSize = style()->outlineSize(); |
| 333 int left = max(borderHalfLeft(true), outlineSize); | 333 int left = max(borderHalfLeft(true), outlineSize); |
| 334 int right = max(borderHalfRight(true), outlineSize); | 334 int right = max(borderHalfRight(true), outlineSize); |
| 335 int top = max(borderHalfTop(true), outlineSize); | 335 int top = max(borderHalfTop(true), outlineSize); |
| 336 int bottom = max(borderHalfBottom(true), outlineSize); | 336 int bottom = max(borderHalfBottom(true), outlineSize); |
| 337 if ((left && !rtl) || (right && rtl)) { | 337 if ((left && !rtl) || (right && rtl)) { |
| 338 if (RenderTableCell* before = table()->cellBefore(this)) { | 338 if (RenderTableCell* before = table()->cellBefore(this)) { |
| 339 top = max(top, before->borderHalfTop(true)); | 339 top = max(top, before->borderHalfTop(true)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 361 LayoutPoint location(max<LayoutUnit>(left, -visualOverflowRect().x()), max<L
ayoutUnit>(top, -visualOverflowRect().y())); | 361 LayoutPoint location(max<LayoutUnit>(left, -visualOverflowRect().x()), max<L
ayoutUnit>(top, -visualOverflowRect().y())); |
| 362 LayoutRect r(-location.x(), -location.y(), location.x() + max(width() + righ
t, visualOverflowRect().maxX()), location.y() + max(height() + bottom, visualOve
rflowRect().maxY())); | 362 LayoutRect r(-location.x(), -location.y(), location.x() + max(width() + righ
t, visualOverflowRect().maxX()), location.y() + max(height() + bottom, visualOve
rflowRect().maxY())); |
| 363 | 363 |
| 364 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { | 364 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| 365 if (RenderView* v = view()) { | 365 if (RenderView* v = view()) { |
| 366 // FIXME: layoutDelta needs to be applied in parts before/after tran
sforms and | 366 // FIXME: layoutDelta needs to be applied in parts before/after tran
sforms and |
| 367 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 | 367 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 |
| 368 r.move(v->layoutDelta()); | 368 r.move(v->layoutDelta()); |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 mapRectToRepaintBacking(repaintContainer, r); | 371 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r); |
| 372 return r; | 372 return r; |
| 373 } | 373 } |
| 374 | 374 |
| 375 void RenderTableCell::mapRectToRepaintBacking(const RenderLayerModelObject* repa
intContainer, LayoutRect& r, bool fixed) const | 375 void RenderTableCell::mapRectToPaintInvalidationBacking(const RenderLayerModelOb
ject* paintInvalidationContainer, LayoutRect& r, bool fixed) const |
| 376 { | 376 { |
| 377 if (repaintContainer == this) | 377 if (paintInvalidationContainer == this) |
| 378 return; | 378 return; |
| 379 r.setY(r.y()); | 379 r.setY(r.y()); |
| 380 RenderView* v = view(); | 380 RenderView* v = view(); |
| 381 if ((!v || !v->canUseLayoutStateForContainer(repaintContainer)) && parent()) | 381 if ((!v || !v->canUseLayoutStateForContainer(paintInvalidationContainer)) &&
parent()) |
| 382 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s
pace, so don't add their offset in. | 382 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s
pace, so don't add their offset in. |
| 383 RenderBlockFlow::mapRectToRepaintBacking(repaintContainer, r, fixed); | 383 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine
r, r, fixed); |
| 384 } | 384 } |
| 385 | 385 |
| 386 LayoutUnit RenderTableCell::cellBaselinePosition() const | 386 LayoutUnit RenderTableCell::cellBaselinePosition() const |
| 387 { | 387 { |
| 388 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of | 388 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>:
The baseline of a cell is the baseline of |
| 389 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there | 389 // the first in-flow line box in the cell, or the first in-flow table-row in
the cell, whichever comes first. If there |
| 390 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. | 390 // is no such line box or table-row, the baseline is the bottom of content e
dge of the cell box. |
| 391 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); | 391 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); |
| 392 if (firstLineBaseline != -1) | 392 if (firstLineBaseline != -1) |
| 393 return firstLineBaseline; | 393 return firstLineBaseline; |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 | 1273 |
| 1274 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1274 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
| 1275 { | 1275 { |
| 1276 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1276 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
| 1277 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1277 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
| 1278 newCell->setStyle(newStyle.release()); | 1278 newCell->setStyle(newStyle.release()); |
| 1279 return newCell; | 1279 return newCell; |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 } // namespace WebCore | 1282 } // namespace WebCore |
| OLD | NEW |