Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / remove-target-in-mouseup-insertback.html
blobfb67518cd29089d336d2fb6aa992a8add5efb8a8
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test ensures WebKit does not fire click event on a node that has been removed and inserted back in mouseup event.</p>
5 <div id="test"><span id="target" onmouseup="mouseup()" onclick="test.innerHTML = 'FAIL';">click here</span></div>
6 <script>
8 var test = document.getElementById('test');
9 var target = document.getElementById('target');
11 function mouseup() {
12 test.appendChild(document.createTextNode('PASS'));
13 test.removeChild(target);
14 test.appendChild(target);
17 if (window.testRunner) {
18 testRunner.dumpAsText();
19 if (!window.eventSender)
20 test.innerHTML = 'FAIL - this test requires eventSender';
21 else {
22 eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2);
23 eventSender.mouseDown();
24 eventSender.leapForward(200);
25 eventSender.mouseUp();
26 test.removeChild(target);
30 </script>
31 </body>
32 </html>