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

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

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 if (bottom) { 351 if (bottom) {
352 if (LayoutTableCell* below = table()->cellBelow(this)) { 352 if (LayoutTableCell* below = table()->cellBelow(this)) {
353 left = std::max(left, below->borderHalfLeft(true)); 353 left = std::max(left, below->borderHalfLeft(true));
354 right = std::max(right, below->borderHalfRight(true)); 354 right = std::max(right, below->borderHalfRight(true));
355 } 355 }
356 } 356 }
357 LayoutPoint location(std::max(LayoutUnit(left), -visualOverflowRect().x()), std::max(LayoutUnit(top), -visualOverflowRect().y())); 357 LayoutPoint location(std::max(LayoutUnit(left), -visualOverflowRect().x()), std::max(LayoutUnit(top), -visualOverflowRect().y()));
358 return LayoutRect(-location.x(), -location.y(), location.x() + std::max(size ().width() + right, visualOverflowRect().maxX()), location.y() + std::max(size() .height() + bottom, visualOverflowRect().maxY())); 358 return LayoutRect(-location.x(), -location.y(), location.x() + std::max(size ().width() + right, visualOverflowRect().maxX()), location.y() + std::max(size() .height() + bottom, visualOverflowRect().maxY()));
359 } 359 }
360 360
361 bool LayoutTableCell::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject * ancestor, LayoutRect& r, const PaintInvalidationState* paintInvalidationState, VisibleRectFlags visibleRectFlags) const 361 bool LayoutTableCell::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject * ancestor, LayoutRect& r, VisibleRectFlags visibleRectFlags) const
362 { 362 {
363 if (ancestor == this) 363 if (ancestor == this)
364 return true; 364 return true;
365 if ((!paintInvalidationState || !paintInvalidationState->canMapToAncestor(an cestor)) && parent()) 365 if (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 return LayoutBlockFlow::mapToVisibleRectInAncestorSpace(ancestor, r, paintIn validationState, visibleRectFlags); 367 return LayoutBlockFlow::mapToVisibleRectInAncestorSpace(ancestor, r, visible RectFlags);
368 } 368 }
369 369
370 int LayoutTableCell::cellBaselinePosition() const 370 int 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 int firstLineBaseline = firstLineBoxBaseline(); 375 int firstLineBaseline = firstLineBoxBaseline();
376 if (firstLineBaseline != -1) 376 if (firstLineBaseline != -1)
377 return firstLineBaseline; 377 return firstLineBaseline;
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const 993 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const
994 { 994 {
995 // If this object has layer, the area of collapsed borders should be transpa rent 995 // If this object has layer, the area of collapsed borders should be transpa rent
996 // to expose the collapsed borders painted on the underlying layer. 996 // to expose the collapsed borders painted on the underlying layer.
997 if (hasLayer() && table()->collapseBorders()) 997 if (hasLayer() && table()->collapseBorders())
998 return false; 998 return false;
999 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); 999 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect);
1000 } 1000 }
1001 1001
1002 } // namespace blink 1002 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698