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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Nowrap is set, but we didn't actually use it because of the | 154 // Nowrap is set, but we didn't actually use it because of the |
155 // fixed width set on the cell. Even so, it is a WinIE/Moz trait | 155 // fixed width set on the cell. Even so, it is a WinIE/Moz trait |
156 // to make the minwidth of the cell into the fixed width. They do t
his | 156 // to make the minwidth of the cell into the fixed width. They do t
his |
157 // even in strict mode, so do not make this a quirk. Affected the t
op | 157 // even in strict mode, so do not make this a quirk. Affected the t
op |
158 // of hiptop.com. | 158 // of hiptop.com. |
159 m_minPreferredLogicalWidth = std::max<LayoutUnit>(w.value(), m_minPr
eferredLogicalWidth); | 159 m_minPreferredLogicalWidth = std::max<LayoutUnit>(w.value(), m_minPr
eferredLogicalWidth); |
160 } | 160 } |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 void LayoutTableCell::addLayerHitTestRects(LayerHitTestRects& layerRects, const
RenderLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& con
tainerRect) const | 164 void LayoutTableCell::addLayerHitTestRects(LayerHitTestRects& layerRects, const
Layer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& container
Rect) const |
165 { | 165 { |
166 LayoutPoint adjustedLayerOffset = layerOffset; | 166 LayoutPoint adjustedLayerOffset = layerOffset; |
167 // LayoutTableCell's location includes the offset of it's containing LayoutT
ableRow, so | 167 // LayoutTableCell's location includes the offset of it's containing LayoutT
ableRow, so |
168 // we need to subtract that again here (as for LayoutTableCell::offsetFromCo
ntainer. | 168 // we need to subtract that again here (as for LayoutTableCell::offsetFromCo
ntainer. |
169 if (parent()) | 169 if (parent()) |
170 adjustedLayerOffset -= parentBox()->locationOffset(); | 170 adjustedLayerOffset -= parentBox()->locationOffset(); |
171 RenderBox::addLayerHitTestRects(layerRects, currentLayer, adjustedLayerOffse
t, containerRect); | 171 RenderBox::addLayerHitTestRects(layerRects, currentLayer, adjustedLayerOffse
t, containerRect); |
172 } | 172 } |
173 | 173 |
174 void LayoutTableCell::computeIntrinsicPadding(int rowHeight, SubtreeLayoutScope&
layouter) | 174 void LayoutTableCell::computeIntrinsicPadding(int rowHeight, SubtreeLayoutScope&
layouter) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 { | 305 { |
306 ASSERT(o == container()); | 306 ASSERT(o == container()); |
307 | 307 |
308 LayoutSize offset = RenderBlockFlow::offsetFromContainer(o, point, offsetDep
endsOnPoint); | 308 LayoutSize offset = RenderBlockFlow::offsetFromContainer(o, point, offsetDep
endsOnPoint); |
309 if (parent()) | 309 if (parent()) |
310 offset -= parentBox()->locationOffset(); | 310 offset -= parentBox()->locationOffset(); |
311 | 311 |
312 return offset; | 312 return offset; |
313 } | 313 } |
314 | 314 |
315 LayoutRect LayoutTableCell::clippedOverflowRectForPaintInvalidation(const Render
LayerModelObject* paintInvalidationContainer, const PaintInvalidationState* pain
tInvalidationState) const | 315 LayoutRect LayoutTableCell::clippedOverflowRectForPaintInvalidation(const Layout
LayerModelObject* paintInvalidationContainer, const PaintInvalidationState* pain
tInvalidationState) const |
316 { | 316 { |
317 // If the table grid is dirty, we cannot get reliable information about adjo
ining cells, | 317 // If the table grid is dirty, we cannot get reliable information about adjo
ining cells, |
318 // so we ignore outside borders. This should not be a problem because it mea
ns that | 318 // so we ignore outside borders. This should not be a problem because it mea
ns that |
319 // the table is going to recalculate the grid, relayout and issue a paint in
validation of its current rect, which | 319 // the table is going to recalculate the grid, relayout and issue a paint in
validation of its current rect, which |
320 // includes any outside borders of this cell. | 320 // includes any outside borders of this cell. |
321 if (!table()->collapseBorders() || table()->needsSectionRecalc()) | 321 if (!table()->collapseBorders() || table()->needsSectionRecalc()) |
322 return RenderBlockFlow::clippedOverflowRectForPaintInvalidation(paintInv
alidationContainer, paintInvalidationState); | 322 return RenderBlockFlow::clippedOverflowRectForPaintInvalidation(paintInv
alidationContainer, paintInvalidationState); |
323 | 323 |
324 bool rtl = !styleForCellFlow()->isLeftToRightDirection(); | 324 bool rtl = !styleForCellFlow()->isLeftToRightDirection(); |
325 int outlineSize = style()->outlineSize(); | 325 int outlineSize = style()->outlineSize(); |
(...skipping 25 matching lines...) Expand all Loading... |
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 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); |
358 return r; | 358 return r; |
359 } | 359 } |
360 | 360 |
361 void LayoutTableCell::mapRectToPaintInvalidationBacking(const RenderLayerModelOb
ject* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* p
aintInvalidationState) const | 361 void LayoutTableCell::mapRectToPaintInvalidationBacking(const LayoutLayerModelOb
ject* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* p
aintInvalidationState) 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 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine
r, r, paintInvalidationState); | 368 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine
r, r, paintInvalidationState); |
369 } | 369 } |
370 | 370 |
371 LayoutUnit LayoutTableCell::cellBaselinePosition() const | 371 LayoutUnit LayoutTableCell::cellBaselinePosition() const |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1048 |
1049 LayoutTableCell* LayoutTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1049 LayoutTableCell* LayoutTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1050 { | 1050 { |
1051 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); | 1051 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen
t()); |
1052 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1052 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1053 newCell->setStyle(newStyle.release()); | 1053 newCell->setStyle(newStyle.release()); |
1054 return newCell; | 1054 return newCell; |
1055 } | 1055 } |
1056 | 1056 |
1057 } // namespace blink | 1057 } // namespace blink |
OLD | NEW |