| 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 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 frame()->page()->frameHost().visualViewport(); | 1859 frame()->page()->frameHost().visualViewport(); |
| 1860 | 1860 |
| 1861 // Apply some scroll and scale from the impl-side. | 1861 // Apply some scroll and scale from the impl-side. |
| 1862 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0), | 1862 webViewImpl()->applyViewportDeltas(WebFloatSize(300, 200), WebFloatSize(0, 0), |
| 1863 WebFloatSize(0, 0), 2, 0); | 1863 WebFloatSize(0, 0), 2, 0); |
| 1864 | 1864 |
| 1865 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.getScrollOffset()); | 1865 EXPECT_SIZE_EQ(FloatSize(300, 200), visualViewport.getScrollOffset()); |
| 1866 | 1866 |
| 1867 // Send a scroll event on the main thread path. | 1867 // Send a scroll event on the main thread path. |
| 1868 PlatformGestureEvent gsu(PlatformEvent::GestureScrollUpdate, IntPoint(0, 0), | 1868 PlatformGestureEvent gsu(PlatformEvent::GestureScrollUpdate, IntPoint(0, 0), |
| 1869 IntPoint(0, 0), IntSize(5, 5), 0, | 1869 IntPoint(0, 0), IntSize(5, 5), TimeTicks(), |
| 1870 PlatformEvent::NoModifiers, | 1870 PlatformEvent::NoModifiers, |
| 1871 PlatformGestureSourceTouchpad); | 1871 PlatformGestureSourceTouchpad); |
| 1872 gsu.setScrollGestureData(-50, -60, ScrollByPrecisePixel, 1, 1, | 1872 gsu.setScrollGestureData(-50, -60, ScrollByPrecisePixel, 1, 1, |
| 1873 ScrollInertialPhaseUnknown, false, | 1873 ScrollInertialPhaseUnknown, false, |
| 1874 -1 /* null plugin id */); | 1874 -1 /* null plugin id */); |
| 1875 | 1875 |
| 1876 frame()->eventHandler().handleGestureEvent(gsu); | 1876 frame()->eventHandler().handleGestureEvent(gsu); |
| 1877 | 1877 |
| 1878 // The scroll sent from the impl-side must not be overwritten. | 1878 // The scroll sent from the impl-side must not be overwritten. |
| 1879 EXPECT_SIZE_EQ(FloatSize(350, 260), visualViewport.getScrollOffset()); | 1879 EXPECT_SIZE_EQ(FloatSize(350, 260), visualViewport.getScrollOffset()); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 if (rootLayerScrolling) | 2392 if (rootLayerScrolling) |
| 2393 EXPECT_TRUE(invalidationTracking); | 2393 EXPECT_TRUE(invalidationTracking); |
| 2394 else | 2394 else |
| 2395 EXPECT_FALSE(invalidationTracking); | 2395 EXPECT_FALSE(invalidationTracking); |
| 2396 | 2396 |
| 2397 document->view()->setTracksPaintInvalidations(false); | 2397 document->view()->setTracksPaintInvalidations(false); |
| 2398 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2398 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
| 2399 } | 2399 } |
| 2400 | 2400 |
| 2401 } // namespace | 2401 } // namespace |
| OLD | NEW |