Limit user-agent interactions based on the touch-action property on iOS
[WebKit-https.git] / LayoutTests / pointerevents / ios / touch-action-none-on-parent.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset=utf-8>
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 </head>
7 <body>
8 <script src="../../resources/testharness.js"></script>
9 <script src="../../resources/testharnessreport.js"></script>
10 <script src="../utils.js"></script>
11 <script>
12
13 'use strict';
14
15 target_test({ width: "200px", height: "200px" }, (target, test) => {
16     document.body.style.width = "2000px";
17     document.body.style.height = "2000px";
18     document.body.style.touchAction = "none";
19
20     ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => {
21         assert_equals(window.pageXOffset, 0, "The page was not scrolled in the x-axis.");
22         assert_equals(window.pageYOffset, 0, "The page was not scrolled in the y-axis.");
23         test.done();
24     });
25 }, "Testing that setting touch-action: none on a parent element prevents page scrolling.");
26
27 </script>
28 </body>
29 </html>