Limit user-agent interactions based on the touch-action property on iOS
[WebKit-https.git] / LayoutTests / pointerevents / ios / touch-action-pan-x-pan-y.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
19     target.style.touchAction = "pan-x pan-y";
20
21     ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => {
22         assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis.");
23         assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis.");
24         test.done();
25     });
26 }, "Testing that setting 'touch-action: pan-x pan-y' on an element allows page scrolling in both axes.");
27
28 </script>
29 </body>
30 </html>