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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2519163003: LayoutView's paint layer should clip to the full viewport size. (Closed)
Patch Set: Add test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index e1996a4c26dd98496167a80bbab5e6e8f2430eb8..0bfba569aa552da7c982250a57f3064ece152ec4 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2427,7 +2427,14 @@ bool PaintLayer::intersectsDamageRect(const LayoutRect& layerBounds,
}
LayoutRect PaintLayer::logicalBoundingBox() const {
- return layoutObject()->visualOverflowRect();
+ LayoutRect rect = layoutObject()->visualOverflowRect();
+
+ if (isRootLayer()) {
+ rect.unite(
+ LayoutRect(rect.location(), layoutObject()->view()->viewRect().size()));
+ }
+
+ return rect;
}
static inline LayoutRect flippedLogicalBoundingBox(
@@ -2541,8 +2548,15 @@ LayoutRect PaintLayer::boundingBoxForCompositing(
return LayoutRect();
// Without composited scrolling, the root layer is the size of the document.
- if (isRootLayer() && !needsCompositedScrolling())
- return LayoutRect(m_layoutObject->view()->documentRect());
+ if (isRootLayer() && !needsCompositedScrolling()) {
+ IntRect documentRect = layoutObject()->view()->documentRect();
+
+ if (FrameView* frameView = layoutObject()->document().view()) {
+ documentRect.unite(IntRect(IntPoint(), frameView->visibleContentSize()));
+ }
+
+ return LayoutRect(documentRect);
+ }
// The layer created for the LayoutFlowThread is just a helper for painting
// and hit-testing, and should not contribute to the bounding box. The

Powered by Google App Engine
This is Rietveld 408576698