Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / pointer-events-on-svg-with-pointer.xhtml
blobd5026e67f1954229b55c4829bc680635e13469bf
1 <html xmlns='http://www.w3.org/1999/xhtml'>
2 <body style="margin: 0px; padding: 0px">
3 <p></p>
4 <div style="position:absolute; top:50px; left:0px; width:100px; height:100px; background-color:blue;"></div>
5 <svg xmlns="http://www.w3.org/2000/svg" style="position:absolute; top:50px; left:0px; width:100px; height:100px;">
6 <rect width="100" height="100" fill="green" pointer-events="none"/>
7 </svg>
8 <script>
9 var svg = document.getElementsByTagName("svg")[0];
10 var container = document.getElementsByTagName("div")[0];
11 var p = document.getElementsByTagName("p")[0];
13 container.addEventListener("mousedown", failed, false);
14 svg.addEventListener("mousedown", passed, false);
16 function stop() {
17 container.removeEventListener("mousedown", passed, false);
18 svg.removeEventListener("mousedown", failed, false);
20 if (window.testRunner)
21 testRunner.notifyDone();
24 function failed() {
25 p.innerHTML = 'FAILED: HTMLDivElement had pointer';
26 stop();
29 function passed() {
30 p.innerHTML = 'PASSED: SVGSVGElement had pointer';
31 stop();
34 if (window.testRunner) {
35 testRunner.waitUntilDone();
36 testRunner.dumpAsText();
39 if (window.eventSender) {
40 eventSender.mouseMoveTo(50, 75);
41 eventSender.mouseDown();
43 </script>
44 </body>
45 </html>