Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / range / slider-delete-while-dragging-thumb.html
blobd43a691221761f2551d0497c297187042d5b3bc2
1 <html>
2 <head>
3 <script>
4 function log(msg)
6 var console = document.getElementById('console');
7 console.innerHTML = console.innerHTML + msg + "<br>";
10 function buttonClick()
12 log("<br>clicking button");
14 // click the button
15 var button = document.getElementById('button');
16 eventSender.mouseMoveTo(button.offsetLeft + 20, button.offsetTop + 7);
17 eventSender.mouseDown();
18 eventSender.mouseUp();
20 testRunner.notifyDone();
23 function deleteSlider()
25 // delete the slider
26 log("<br>deleting slider");
27 var slider = document.getElementById('slider');
28 slider.parentNode.removeChild(slider);
30 setTimeout(buttonClick, 10);
33 function drag()
35 if (!window.testRunner)
36 return;
38 var slider = document.getElementById('slider');
40 testRunner.dumpAsText();
41 testRunner.waitUntilDone();
43 // drag slider, leave the mouse down
44 log("dragging slider");
45 eventSender.mouseMoveTo(slider.offsetLeft + 7, slider.offsetTop + 7);
46 eventSender.mouseDown();
47 eventSender.mouseMoveTo(slider.offsetLeft + 50, slider.offsetTop + 7);
49 setTimeout(deleteSlider, 10);
51 </script>
52 </head>
53 <body onload="drag()">
54 This tests that events don't continue to target a slider thumb if it is deleted while dragging.
55 <br>
56 <input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
57 <br>
58 <input type="range" id="slider" onmousedown="log('mousedown')" onmouseup="log('mouseup')" onmousemove="log('mousemove')" oninput="log('input')" value=0>
59 <div id="console"></div>
60 </body>
61 </html>