Fix crashing fast-clicking WK2 tests on iOS
[WebKit-https.git] / LayoutTests / css3 / touch-action / touch-action-manipulation-fast-clicks.html
1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2
3 <html>
4 <meta name="viewport" content="initial-scale=1.0">
5
6 <head>
7     <script src="../../resources/js-test-pre.js"></script>
8     <script id="ui-script" type="text/plain">
9         (function() {
10             var count = 0;
11             function fireSuccessiveTaps() {
12                 if (count < 3)
13                     uiController.singleTapAtPoint(200, 200, fireSuccessiveTaps);
14                 else
15                     uiController.uiScriptComplete("");
16
17                 count++;
18             }
19             fireSuccessiveTaps();
20         })();
21     </script>
22
23     <script>
24     var scriptCompleted = false;
25     var clickCount = 0;
26     if (window.testRunner)
27         testRunner.waitUntilDone();
28
29     function getUIScript() {
30         return document.getElementById("ui-script").text;
31     }
32
33     function runTest() {
34         if (testRunner.runUIScript)
35             testRunner.runUIScript(getUIScript(), function(result) {
36                 scriptCompleted = true;
37                 if (clickCount == 3)
38                     testRunner.notifyDone();
39             });
40     }
41     function handleClicked() {
42         clickCount++;
43         document.body.appendChild(document.createTextNode("Click!"));
44         document.body.appendChild(document.createElement("br"));
45         if (clickCount == 3 && scriptCompleted)
46             testRunner.notifyDone();
47     }
48     </script>
49
50     <style>
51     body {
52         margin: 0;
53     }
54
55     #target {
56         touch-action: manipulation;
57         width: 400px;
58         height: 400px;
59     }
60     </style>
61 </head>
62
63 <body onload="runTest()">
64     <button id="target" onclick="handleClicked()"></button>
65     <p>Repeatedly tapping on the button should fire click events.</p>
66     <p>This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a "Click!" message to appear below, and that click occurred without the regular 350ms delay for double tapping.</p>
67     <script src="../../resources/js-test-post.js"></script>
68 </body>
69
70 </html>