Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: LayoutTests/svg/custom/use-event-retargeting.html

Issue 323343004: [SVG2] The exposed event target should be the <use> element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase :P Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/custom/use-event-retargeting.html
diff --git a/LayoutTests/svg/custom/use-event-retargeting.html b/LayoutTests/svg/custom/use-event-retargeting.html
new file mode 100644
index 0000000000000000000000000000000000000000..e1c2a71fc9ad4bdc74e786b7a866d5123a8c6222
--- /dev/null
+++ b/LayoutTests/svg/custom/use-event-retargeting.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<head>
+ <style>
+ * { margin: 0; padding: 0; }
+
+ svg { width: 200px; height: 100px; }
+ a div { width: 200px; height: 100px; background-color: yellow; }
+ </style>
+</head>
+<body>
+ <a href="#" class="icon-link">
+ <svg>
+ <defs>
+ <rect id="blue-rectangle" width="200" height="100" style="fill:#00f;" />
+ </defs>
+ <use xlink:href="#blue-rectangle"></use></svg>
+
+ <div></div>
+ </a>
+
+ <div class="log"></div>
+
+ <script>
+ var expected = null;
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function clickAt(x,y,expectedElm)
+ {
+ expected = expectedElm;
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ expected = null;
+ }
+
+ document.querySelector("a").addEventListener("click", function(event) {
+ var result = "";
+ if (event.target == expected)
+ result = "PASS - " + event.target + " was clicked.";
+ else
+ result = "FAIL - expected " + expected + " but got " + event.target + ".";
+ document.querySelector('.log').innerHTML += result + '<br />';
+ event.preventDefault();
+ }, false);
+
+ clickAt(50,50,document.querySelector("use"));
+ clickAt(50,130,document.querySelector("a div"));
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698