Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / svg / test / test_pointer-events-7.xhtml
blobd254c401922d49269fe7ab3ba8531b78356e1f24
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=1119698
4 -->
5 <head>
6 <title>Test pointer events with image</title>
7 <script src="/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
9 </head>
10 <body onload="run()">
11 <script class="testbody" type="text/javascript">
12 <![CDATA[
14 SimpleTest.waitForExplicitFinish();
16 function run() {
17 var div = document.getElementById("div");
18 // Get the coords of the origin of the SVG canvas:
19 var originX = div.offsetLeft;
20 var originY = div.offsetTop;
21 var image4 = document.getElementById("image4");
22 var image5 = document.getElementById("image5");
23 var element;
24 var background = document.getElementById("background");
26 element = document.elementFromPoint(originX + 20, originY + 20);
27 is(element, background, "Should not hit visibility:hidden image by default");
29 element = document.elementFromPoint(originX + 120, originY + 20);
30 is(element, background, "Should not hit pointer-events:none image");
32 element = document.elementFromPoint(originX + 220, originY + 20);
33 is(element, background, "Should not hit pointer-events:visible visibility:hidden image");
35 element = document.elementFromPoint(originX + 320, originY + 20);
36 is(element, image4, "Should hit pointer-events:painted visibility:hidden image");
38 element = document.elementFromPoint(originX + 420, originY + 20);
39 is(element, image5, "Should hit pointer-events:stroke visibility:hidden image");
41 SimpleTest.finish();
44 ]]>
45 </script>
46 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1119698">Mozilla Bug 1119698</a>
47 <p id="display"></p>
48 <div id="content">
50 <div width="100%" height="1" id="div">
51 </div>
52 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" id="svg">
53 <rect id="background" width="100%" height="100%" fill="blue"/>
54 <image x="10" y="10" width="100" height="100" visibility="hidden" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
55 <image x="110" y="10" width="100" height="100" pointer-events="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
56 <image x="210" y="10" width="100" height="100" pointer-events="visible" visibility="hidden" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
57 <image id="image4" x="310" y="10" width="100" height="100" pointer-events="painted" visibility="hidden" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
58 <image id="image5" x="410" y="10" width="100" height="100" pointer-events="stroke" visibility="hidden" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
59 </svg>
61 </div>
62 <pre id="test">
63 </pre>
64 </body>
65 </html>