Index: LayoutTests/svg/custom/use-event-handler-on-referenced-element-addEventListener.svg |
diff --git a/LayoutTests/svg/custom/use-event-handler-on-referenced-element-addEventListener.svg b/LayoutTests/svg/custom/use-event-handler-on-referenced-element-addEventListener.svg |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f048162760578d85aedfc9dc54c5837bb3f6057c |
--- /dev/null |
+++ b/LayoutTests/svg/custom/use-event-handler-on-referenced-element-addEventListener.svg |
@@ -0,0 +1,44 @@ |
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="clickRect()"> |
+ <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/> |
+ <defs id="hidden"> |
+ <g id="reference"> |
+ <rect id="referenceRect" x="240" y="1" width="239" height="358"/> |
+ </g> |
+ |
+ <script type="text/ecmascript"> |
+ <![CDATA[ |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ function clickRect() { |
+ if (window.eventSender) { |
+ testRunner.waitUntilDone(); |
+ eventSender.mouseMoveTo(250, 50); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+ } |
+ |
+ function test() { |
+ var rect = this; |
+ var g = document.getElementById("reference"); |
+ var defs = document.getElementById("hidden"); |
+ if (rect.parentNode == g && rect.parentNode.parentNode == defs) |
+ document.getElementById("text").firstChild.nodeValue = "Test passed."; |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ var el = document.getElementById("referenceRect"); |
+ el.addEventListener("click", test, false); |
+ |
+ var use = document.createElementNS("http://www.w3.org/2000/svg", "use"); |
+ use.setAttribute("fill", "grey"); |
+ use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#reference') |
+ document.documentElement.appendChild(use); |
+ ]]> |
+ </script> |
+ </defs> |
+ |
+ <text id="text" transform="translate(5,20)">Test failed.</text> |
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
+</svg> |