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

Side by Side Diff: LayoutTests/svg/custom/use-instanceRoot-event-listener-liveness.xhtml

Issue 257033002: Do not implement EventTarget on SVGElementInstance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Try to fix TestExpectations 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
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head> 3 <head>
4 </head> 4 </head>
5 <body onload="startTest()"> 5 <body onload="startTest()">
6 6
7 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" width="100px" height="100px"> 7 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" width="100px" height="100px">
8 <defs> 8 <defs>
9 <rect id="target" fill="green" width="100" height="100"/> 9 <rect id="target" fill="green" width="100" height="100"/>
10 </defs> 10 </defs>
(...skipping 20 matching lines...) Expand all
31 function fireSimulatedMouseClickEvent(eventTarget) 31 function fireSimulatedMouseClickEvent(eventTarget)
32 { 32 {
33 var event = document.createEvent("MouseEvents"); 33 var event = document.createEvent("MouseEvents");
34 event.initMouseEvent("click", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); 34 event.initMouseEvent("click", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
35 eventTarget.dispatchEvent(event); 35 eventTarget.dispatchEvent(event);
36 } 36 }
37 37
38 function startTest() { 38 function startTest() {
39 var useElement = document.getElementById("test"); 39 var useElement = document.getElementById("test");
40 40
41 var shadowRoot = internals.shadowRoot(useElement);
42
41 // No-op, as no listener is not yet registered 43 // No-op, as no listener is not yet registered
42 fireSimulatedMouseClickEvent(useElement.instanceRoot); 44 fireSimulatedMouseClickEvent(shadowRoot.firstChild);
43 45
44 // Add listener 46 // Add listener
45 useElement.instanceRoot.addEventListener("click", eventHandler, false); 47 shadowRoot.firstChild.addEventListener("click", eventHandler, false);
46 48
47 // Should fire immediately and finish the test 49 // Should fire immediately and finish the test
48 fireSimulatedMouseClickEvent(useElement.instanceRoot); 50 fireSimulatedMouseClickEvent(shadowRoot.firstChild);
49 } 51 }
50 </script> 52 </script>
51 53
52 </body> 54 </body>
53 </html> 55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698