Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / drag-svg-image-crash.html
blob708cbe2918a5211db39ac6f56bc1cc9cd5314adc
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
9 var dragIcon = document.createElementNS("http://www.w3.org/2000/svg", "img");
10 </script>
11 <p>Tests dragging an SVG image. Test passes if the test does not crash.</p>
12 <img id="elementToDrag" src="resources/abe.png" draggable="true" ondragstart="dragStart(event);" onload="runTest()"/>
13 <div id="dragTarget" ondragenter="dragEnter(this);" style="width: 300px; height: 300px; border: 1px solid gray;"></div>
14 <script>
15 function dragStart(event)
17 event.dataTransfer.setDragImage(dragIcon, -10, -10);
20 function dragEnter(div)
22 div.innerText = "Success - drag entered";
23 if (window.testRunner)
24 testRunner.notifyDone();
27 function runTest()
29 var elementToDrag = document.getElementById("elementToDrag");
30 var x1 = elementToDrag.offsetLeft + elementToDrag.offsetWidth / 2;
31 var y1 = elementToDrag.offsetTop + elementToDrag.offsetHeight / 2;
33 eventSender.mouseMoveTo(x1, y1);
34 eventSender.mouseDown();
36 var dragTarget = document.getElementById("dragTarget");
37 var x2 = dragTarget.offsetLeft + dragTarget.offsetWidth / 2;
38 var y2 = dragTarget.offsetTop + dragTarget.offsetHeight / 2;
40 eventSender.mouseMoveTo(x2, y2);
41 eventSender.mouseUp();
43 </script>
44 </body>
45 </html>