Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: Source/core/layout/LayoutTableCell.cpp

Issue 945803004: Merge back LayoutLayerModelObject into RenderBoxModelObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Layout LayerModelObject* paintInvalidationContainer, const PaintInvalidationState* pain tInvalidationState) const 315 LayoutRect LayoutTableCell::clippedOverflowRectForPaintInvalidation(const Render BoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintI nvalidationState) 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
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 LayoutLayerModelOb ject* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* p aintInvalidationState) const 361 void LayoutTableCell::mapRectToPaintInvalidationBacking(const RenderBoxModelObje ct* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* pai ntInvalidationState) 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
1048 1048
1049 LayoutTableCell* LayoutTableCell::createAnonymousWithParentRenderer(const Layout Object* parent) 1049 LayoutTableCell* LayoutTableCell::createAnonymousWithParentRenderer(const Layout Object* parent)
1050 { 1050 {
1051 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t()); 1051 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t());
1052 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWithDisplay( parent->styleRef(), TABLE_CELL); 1052 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWithDisplay( parent->styleRef(), 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698