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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <head>
3 <style>
4 * { margin: 0; padding: 0; }
5
6 svg { width: 200px; height: 100px; }
7 a div { width: 200px; height: 100px; background-color: yellow; }
8 </style>
9 </head>
10 <body>
11 <a href="#" class="icon-link">
12 <svg>
13 <defs>
14 <rect id="blue-rectangle" width="200" height="100" style ="fill:#00f;" />
15 </defs>
16 <use xlink:href="#blue-rectangle"></use></svg>
17
18 <div></div>
19 </a>
20
21 <div class="log"></div>
22
23 <script>
24 var expected = null;
25
26 if (window.testRunner)
27 testRunner.dumpAsText();
28
29 function clickAt(x,y,expectedElm)
30 {
31 expected = expectedElm;
32 if (window.eventSender) {
33 eventSender.mouseMoveTo(x, y);
34 eventSender.mouseDown();
35 eventSender.mouseUp();
36 }
37 expected = null;
38 }
39
40 document.querySelector("a").addEventListener("click", function(e vent) {
41 var result = "";
42 if (event.target == expected)
43 result = "PASS - " + event.target + " was clicke d.";
44 else
45 result = "FAIL - expected " + expected + " but g ot " + event.target + ".";
46 document.querySelector('.log').innerHTML += result + '<b r />';
47 event.preventDefault();
48 }, false);
49
50 clickAt(50,50,document.querySelector("use"));
51 clickAt(50,130,document.querySelector("a div"));
52 </script>
53 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698