4167a5b7676900a54f1958721a7d82ee107b4eef
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / tap-on-input-type-button-element.html
1 <html>
2 <head>
3 <title>This tests the case when the tap target node is a form control element.</title>
4 <script src="../../../../../resources/basic-gestures.js"></script>
5 <style>
6 #becomesVisible {
7     visibility: hidden;
8     width: 100px;
9     height: 100px;
10     background-color: green;
11         transition-property: opacity, left;
12         transition-duration: 100ms, 200ms;
13 }
14 </style>
15 <script>
16 async function test() {
17     if (!window.testRunner || !testRunner.runUIScript)
18         return;
19     if (window.internals)
20         internals.settings.setContentChangeObserverEnabled(true);
21
22     testRunner.waitUntilDone();
23     testRunner.dumpAsText();
24
25     let rect = tapthis.getBoundingClientRect();
26     let x = rect.left + rect.width / 2;
27     let y = rect.top + rect.height / 2;
28
29     await tapAtPoint(x, y);
30 }
31 </script>
32 </head>
33 <body onload="test()">
34 PASS if 'clicked' text is shown below.<br>
35 <input type="button" value="tap this button" id=tapthis>
36 <div id=becomesVisible></div>
37 <pre id=result></pre>
38 <script>
39 tapthis.addEventListener("mousemove", function( event ) {
40     becomesVisible.style.visibility = "visible";
41 }, false);
42
43 becomesVisible.addEventListener("click", function( event ) {   
44     result.innerHTML = "clicked hidden";
45 }, false);
46
47 tapthis.addEventListener("click", function( event ) {   
48     result.innerHTML = "clicked";
49     if (window.testRunner)
50         testRunner.notifyDone();
51 }, false);
52 </script>
53 </body>
54 </html>