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

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2519163003: LayoutView's paint layer should clip to the full viewport size. (Closed)
Patch Set: Add test Created 4 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/VisualViewport.h" 5 #include "core/frame/VisualViewport.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/BrowserControls.h" 8 #include "core/frame/BrowserControls.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 ASSERT_TRUE(invalidationTracking); 2278 ASSERT_TRUE(invalidationTracking);
2279 2279
2280 const auto* rasterInvalidations = 2280 const auto* rasterInvalidations =
2281 &invalidationTracking->trackedRasterInvalidations; 2281 &invalidationTracking->trackedRasterInvalidations;
2282 2282
2283 bool rootLayerScrolling = GetParam(); 2283 bool rootLayerScrolling = GetParam();
2284 2284
2285 // Without root-layer-scrolling, the LayoutView is the size of the document 2285 // Without root-layer-scrolling, the LayoutView is the size of the document
2286 // content so invalidating it for background-attachment: fixed 2286 // content so invalidating it for background-attachment: fixed
2287 // overinvalidates as we should only need to invalidate the viewport size. 2287 // overinvalidates as we should only need to invalidate the viewport size.
2288 int expectedHeight = rootLayerScrolling ? 430 : 1000; 2288 // With root-layer-scrolling, we should invalidate the entire viewport height.
2289 int expectedHeight = rootLayerScrolling ? pageHeight : 1000;
2289 2290
2290 // The entire viewport should have been invalidated. 2291 // The entire viewport should have been invalidated.
2291 EXPECT_EQ(1u, rasterInvalidations->size()); 2292 EXPECT_EQ(1u, rasterInvalidations->size());
2292 EXPECT_EQ(IntRect(0, 0, 640, expectedHeight), (*rasterInvalidations)[0].rect); 2293 EXPECT_EQ(IntRect(0, 0, 640, expectedHeight), (*rasterInvalidations)[0].rect);
2293 document->view()->setTracksPaintInvalidations(false); 2294 document->view()->setTracksPaintInvalidations(false);
2294 2295
2295 invalidationTracking = document->layoutView() 2296 invalidationTracking = document->layoutView()
2296 ->layer() 2297 ->layer()
2297 ->graphicsLayerBacking() 2298 ->graphicsLayerBacking()
2298 ->getRasterInvalidationTracking(); 2299 ->getRasterInvalidationTracking();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 if (rootLayerScrolling) 2398 if (rootLayerScrolling)
2398 EXPECT_TRUE(invalidationTracking); 2399 EXPECT_TRUE(invalidationTracking);
2399 else 2400 else
2400 EXPECT_FALSE(invalidationTracking); 2401 EXPECT_FALSE(invalidationTracking);
2401 2402
2402 document->view()->setTracksPaintInvalidations(false); 2403 document->view()->setTracksPaintInvalidations(false);
2403 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); 2404 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls);
2404 } 2405 }
2405 2406
2406 } // namespace 2407 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698