| 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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 VisualViewport& visualViewport = | 1858 VisualViewport& visualViewport = |
| 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 WebGestureEvent gsu; | 1868 WebGestureEvent gsu(WebInputEvent::GestureScrollUpdate, |
| 1869 WebInputEvent::NoModifiers, |
| 1870 WebInputEvent::TimeStampForTesting); |
| 1869 gsu.setFrameScale(1); | 1871 gsu.setFrameScale(1); |
| 1870 gsu.type = WebInputEvent::GestureScrollUpdate; | |
| 1871 gsu.sourceDevice = WebGestureDeviceTouchpad; | 1872 gsu.sourceDevice = WebGestureDeviceTouchpad; |
| 1872 gsu.data.scrollUpdate.deltaX = -50; | 1873 gsu.data.scrollUpdate.deltaX = -50; |
| 1873 gsu.data.scrollUpdate.deltaY = -60; | 1874 gsu.data.scrollUpdate.deltaY = -60; |
| 1874 gsu.data.scrollUpdate.deltaUnits = WebGestureEvent::PrecisePixels; | 1875 gsu.data.scrollUpdate.deltaUnits = WebGestureEvent::PrecisePixels; |
| 1875 gsu.data.scrollUpdate.velocityX = 1; | 1876 gsu.data.scrollUpdate.velocityX = 1; |
| 1876 gsu.data.scrollUpdate.velocityY = 1; | 1877 gsu.data.scrollUpdate.velocityY = 1; |
| 1877 | 1878 |
| 1878 frame()->eventHandler().handleGestureEvent(gsu); | 1879 frame()->eventHandler().handleGestureEvent(gsu); |
| 1879 | 1880 |
| 1880 // The scroll sent from the impl-side must not be overwritten. | 1881 // The scroll sent from the impl-side must not be overwritten. |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 " body {" | 2471 " body {" |
| 2471 " margin: 0px;" | 2472 " margin: 0px;" |
| 2472 " }" | 2473 " }" |
| 2473 " div { height:110vh; width: 110vw; }" | 2474 " div { height:110vh; width: 110vw; }" |
| 2474 "</style>" | 2475 "</style>" |
| 2475 "<div></div>", | 2476 "<div></div>", |
| 2476 baseURL); | 2477 baseURL); |
| 2477 } | 2478 } |
| 2478 | 2479 |
| 2479 } // namespace | 2480 } // namespace |
| OLD | NEW |