[JSC] DFG::CommonData modification by DFG reallyAdd should be guarded by CodeBlock...
[WebKit-https.git] / LayoutTests / fast / events / input-element-display-none-in-dragleave-crash.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script>
5         if (window.testRunner) {
6             testRunner.dumpAsText();
7             testRunner.waitUntilDone();
8         }
9
10         function test()
11         {
12             var dropTarget = document.getElementById("drop-target");
13             dropTarget.addEventListener("dragleave", function() {
14                 dropTarget.style.display = "none";
15             }, false);
16
17             if (window.eventSender) {
18                 eventSender.beginDragWithFiles(["resources/abe.png"]);
19                 var x = dropTarget.offsetLeft + dropTarget.offsetWidth / 2;
20                 var y = dropTarget.offsetTop + dropTarget.offsetHeight / 2;
21                 eventSender.mouseMoveTo(x, y);
22                 eventSender.mouseMoveTo(0, 0);
23
24                 // The test harness wants us to call eventSender.mouseUp() before finishing,
25                 // but we need to not navigate when that happens, so add a drop handler that
26                 // prevents navigation.
27                 window.addEventListener("dragover", function() {
28                     event.preventDefault();
29                 }, false);
30                 window.addEventListener("drop", function() {
31                     event.preventDefault();
32                 }, false);
33                 eventSender.mouseUp();
34             }
35
36             if (window.testRunner)
37                 testRunner.notifyDone();
38         }
39     </script>
40 </head>
41 <body onload="test()">
42     <p>This test passes if there is no crash when dragging a file over and then away from the file input element below.</p>
43     <input type="file" id="drop-target">
44 </body>
45 </html>