OLD | NEW |
---|---|
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 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2367 // setNeedsLayout from viewportSizeChanged. | 2367 // setNeedsLayout from viewportSizeChanged. |
2368 document->view()->viewportSizeChanged(false, true); | 2368 document->view()->viewportSizeChanged(false, true); |
2369 unsigned needsLayoutObjects = 0; | 2369 unsigned needsLayoutObjects = 0; |
2370 unsigned totalObjects = 0; | 2370 unsigned totalObjects = 0; |
2371 bool isSubtree = false; | 2371 bool isSubtree = false; |
2372 EXPECT_FALSE(document->view()->needsLayout()); | 2372 EXPECT_FALSE(document->view()->needsLayout()); |
2373 document->view()->countObjectsNeedingLayout(needsLayoutObjects, totalObjects, | 2373 document->view()->countObjectsNeedingLayout(needsLayoutObjects, totalObjects, |
2374 isSubtree); | 2374 isSubtree); |
2375 EXPECT_EQ(0u, needsLayoutObjects); | 2375 EXPECT_EQ(0u, needsLayoutObjects); |
2376 | 2376 |
2377 webViewImpl->updateAllLifecyclePhases(); | |
chrishtr
2016/11/18 00:37:09
Why this change?
bokan
2016/11/18 22:30:35
The viewportSizeChange call now causes a paint inv
| |
2378 | |
2377 // Do a real resize to check for invalidations. | 2379 // Do a real resize to check for invalidations. |
2378 document->view()->setTracksPaintInvalidations(true); | 2380 document->view()->setTracksPaintInvalidations(true); |
2379 webViewImpl->resizeWithBrowserControls(WebSize(pageWidth, smallestHeight), | 2381 webViewImpl->resizeWithBrowserControls(WebSize(pageWidth, smallestHeight), |
2380 browserControlsHeight, true); | 2382 browserControlsHeight, true); |
2381 | 2383 |
2382 // The layout size should not have changed. | 2384 // The layout size should not have changed. |
2383 ASSERT_EQ(pageWidth, document->view()->layoutSize().width()); | 2385 ASSERT_EQ(pageWidth, document->view()->layoutSize().width()); |
2384 ASSERT_EQ(smallestHeight, document->view()->layoutSize().height()); | 2386 ASSERT_EQ(smallestHeight, document->view()->layoutSize().height()); |
2385 | 2387 |
2386 const RasterInvalidationTracking* invalidationTracking = | 2388 const RasterInvalidationTracking* invalidationTracking = |
(...skipping 10 matching lines...) Expand all Loading... | |
2397 if (rootLayerScrolling) | 2399 if (rootLayerScrolling) |
2398 EXPECT_TRUE(invalidationTracking); | 2400 EXPECT_TRUE(invalidationTracking); |
2399 else | 2401 else |
2400 EXPECT_FALSE(invalidationTracking); | 2402 EXPECT_FALSE(invalidationTracking); |
2401 | 2403 |
2402 document->view()->setTracksPaintInvalidations(false); | 2404 document->view()->setTracksPaintInvalidations(false); |
2403 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2405 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
2404 } | 2406 } |
2405 | 2407 |
2406 } // namespace | 2408 } // namespace |
OLD | NEW |