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

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

Issue 1537133002: Renaming: distinguish ancestor, container and paintInvalidationContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SelectionInvalidation
Patch Set: Created 4 years, 12 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
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 346 }
347 if (bottom) { 347 if (bottom) {
348 if (LayoutTableCell* below = table()->cellBelow(this)) { 348 if (LayoutTableCell* below = table()->cellBelow(this)) {
349 left = std::max(left, below->borderHalfLeft(true)); 349 left = std::max(left, below->borderHalfLeft(true));
350 right = std::max(right, below->borderHalfRight(true)); 350 right = std::max(right, below->borderHalfRight(true));
351 } 351 }
352 } 352 }
353 LayoutPoint location(std::max<LayoutUnit>(left, -visualOverflowRect().x()), std::max<LayoutUnit>(top, -visualOverflowRect().y())); 353 LayoutPoint location(std::max<LayoutUnit>(left, -visualOverflowRect().x()), std::max<LayoutUnit>(top, -visualOverflowRect().y()));
354 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())); 354 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 355
356 mapToVisibleRectInContainerSpace(paintInvalidationContainer, r, paintInvalid ationState); 356 mapToVisibleRectInAncestorSpace(paintInvalidationContainer, r, paintInvalida tionState);
357 return r; 357 return r;
358 } 358 }
359 359
360 void LayoutTableCell::mapToVisibleRectInContainerSpace(const LayoutBoxModelObjec t* paintInvalidationContainer, LayoutRect& r, const PaintInvalidationState* pain tInvalidationState) const 360 void LayoutTableCell::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject * ancestor, LayoutRect& r, const PaintInvalidationState* paintInvalidationState) const
361 { 361 {
362 if (paintInvalidationContainer == this) 362 if (ancestor == this)
363 return; 363 return;
364 r.setY(r.y()); 364 r.setY(r.y());
365 if ((!paintInvalidationState || !paintInvalidationState->canMapToContainer(p aintInvalidationContainer)) && parent()) 365 if ((!paintInvalidationState || !paintInvalidationState->canMapToContainer(a ncestor)) && parent())
366 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s pace, so don't add their offset in. 366 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s pace, so don't add their offset in.
367 LayoutBlockFlow::mapToVisibleRectInContainerSpace(paintInvalidationContainer , r, paintInvalidationState); 367 LayoutBlockFlow::mapToVisibleRectInAncestorSpace(ancestor, r, paintInvalidat ionState);
368 } 368 }
369 369
370 LayoutUnit LayoutTableCell::cellBaselinePosition() const 370 LayoutUnit LayoutTableCell::cellBaselinePosition() const
371 { 371 {
372 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>: The baseline of a cell is the baseline of 372 // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>: The baseline of a cell is the baseline of
373 // the first in-flow line box in the cell, or the first in-flow table-row in the cell, whichever comes first. If there 373 // 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 // is no such line box or table-row, the baseline is the bottom of content e dge of the cell box. 374 // is no such line box or table-row, the baseline is the bottom of content e dge of the cell box.
375 LayoutUnit firstLineBaseline = firstLineBoxBaseline(); 375 LayoutUnit firstLineBaseline = firstLineBoxBaseline();
376 if (firstLineBaseline != -1) 376 if (firstLineBaseline != -1)
377 return firstLineBaseline; 377 return firstLineBaseline;
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 1005
1006 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject* parent) 1006 LayoutTableCell* LayoutTableCell::createAnonymousWithParent(const LayoutObject* parent)
1007 { 1007 {
1008 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t()); 1008 LayoutTableCell* newCell = LayoutTableCell::createAnonymous(&parent->documen t());
1009 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_CELL); 1009 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_CELL);
1010 newCell->setStyle(newStyle.release()); 1010 newCell->setStyle(newStyle.release());
1011 return newCell; 1011 return newCell;
1012 } 1012 }
1013 1013
1014 } // namespace blink 1014 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698