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

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

Issue 1929413002: Don't include contents visual overflow into paint invalidation rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 left = std::max(left, above->borderHalfLeft(true)); 347 left = std::max(left, above->borderHalfLeft(true));
348 right = std::max(right, above->borderHalfRight(true)); 348 right = std::max(right, above->borderHalfRight(true));
349 } 349 }
350 } 350 }
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
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 LayoutRect selfVisualOverflowRect = this->selfVisualOverflowRect();
359 LayoutPoint location(std::max(LayoutUnit(left), -selfVisualOverflowRect.x()) , std::max(LayoutUnit(top), -selfVisualOverflowRect.y()));
360 return LayoutRect(-location.x(), -location.y(), location.x() + std::max(size ().width() + right, selfVisualOverflowRect.maxX()), location.y() + std::max(size ().height() + bottom, selfVisualOverflowRect.maxY()));
359 } 361 }
360 362
361 bool LayoutTableCell::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& r, VisualRectFlags visualRectFlags) const 363 bool LayoutTableCell::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& r, VisualRectFlags visualRectFlags) const
362 { 364 {
363 if (ancestor == this) 365 if (ancestor == this)
364 return true; 366 return true;
365 if (parent()) 367 if (parent())
366 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s pace, so don't add their offset in. 368 r.moveBy(-parentBox()->location()); // Rows are in the same coordinate s pace, so don't add their offset in.
367 return LayoutBlockFlow::mapToVisualRectInAncestorSpace(ancestor, r, visualRe ctFlags); 369 return LayoutBlockFlow::mapToVisualRectInAncestorSpace(ancestor, r, visualRe ctFlags);
368 } 370 }
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const 1010 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const
1009 { 1011 {
1010 // If this object has layer, the area of collapsed borders should be transpa rent 1012 // If this object has layer, the area of collapsed borders should be transpa rent
1011 // to expose the collapsed borders painted on the underlying layer. 1013 // to expose the collapsed borders painted on the underlying layer.
1012 if (hasLayer() && table()->collapseBorders()) 1014 if (hasLayer() && table()->collapseBorders())
1013 return false; 1015 return false;
1014 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); 1016 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect);
1015 } 1017 }
1016 1018
1017 } // namespace blink 1019 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/OverflowModel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698