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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/custom/resources/use-instanceRoot-event-bubbling.js

Issue 2186823002: Do not call an event listener on a cloned node in svg <use>'s UA shadow tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skip timeout test Created 4 years, 4 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 window.testIsAsync = true; 1 window.testIsAsync = true;
2 description("Tests whether SVG event bubbling works across shadow trees."); 2 description("Tests whether SVG event bubbling works across shadow trees.");
3 3
4 var svgNS = "http://www.w3.org/2000/svg"; 4 var svgNS = "http://www.w3.org/2000/svg";
5 var xhtmlNS = "http://www.w3.org/1999/xhtml"; 5 var xhtmlNS = "http://www.w3.org/1999/xhtml";
6 var expected = new Array(4); 6 var expected = new Array(4);
7 var tests = 4; 7 var tests = 2;
8 var counter = 0; 8 var counter = 0;
9 var eventCounter = 0; 9 var eventCounter = 0;
10 10
11 function log(message) { 11 function log(message) {
12 var logDiv = document.getElementById("console"); 12 var logDiv = document.getElementById("console");
13 var newDiv = document.createElementNS(xhtmlNS, "div"); 13 var newDiv = document.createElementNS(xhtmlNS, "div");
14 newDiv.appendChild(document.createTextNode(message)); 14 newDiv.appendChild(document.createTextNode(message));
15 logDiv.appendChild(newDiv); 15 logDiv.appendChild(newDiv);
16 } 16 }
17 17
(...skipping 30 matching lines...) Expand all
48 finishRepaintTest(); 48 finishRepaintTest();
49 } 49 }
50 50
51 function nextTest() 51 function nextTest()
52 { 52 {
53 eventCounter = 0; 53 eventCounter = 0;
54 ++counter; 54 ++counter;
55 55
56 switch (counter) { 56 switch (counter) {
57 case 1: 57 case 1:
58 rect.onclick = function(evt) { eventHandler(evt, 1); }; 58 use.setAttribute("onclick", "eventHandler(evt, 1)");
59 expected[0] = "[EventHandler 1] type: click phase: AT_TARGET target: [ob ject SVGRectElement] (id: rect) currentTarget: [object SVGRectElement] (id: rect )"; 59 expected[0] = "[EventHandler 1] type: click phase: AT_TARGET target: [ob ject SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)";
60 testListeners(); 60 testListeners();
61 break; 61 break;
62 case 2: 62 case 2:
63 rectContainer.addEventListener("click", function(evt) { eventHandler(evt , 2) }, false); 63 useContainer.onclick = function(evt) { eventHandler(evt, 2) };
64 expected[1] = "[EventHandler 2] type: click phase: BUBBLING target: [obj ect SVGRectElement] (id: rect) currentTarget: [object SVGGElement] (id: rectPare nt)"; 64 expected[1] = "[EventHandler 2] type: click phase: BUBBLING target: [obj ect SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent) ";
65 testListeners();
66 break;
67 case 3:
68 use.setAttribute("onclick", "eventHandler(evt, 3)");
69 expected[2] = "[EventHandler 3] type: click phase: AT_TARGET target: [ob ject SVGUseElement] (id: use) currentTarget: [object SVGUseElement] (id: use)";
70 testListeners();
71 break;
72 case 4:
73 useContainer.onclick = function(evt) { eventHandler(evt, 4) };
74 expected[3] = "[EventHandler 4] type: click phase: BUBBLING target: [obj ect SVGUseElement] (id: use) currentTarget: [object SVGGElement] (id: useParent) ";
75 testListeners(); 65 testListeners();
76 break; 66 break;
77 } 67 }
78 } 68 }
79 69
80 function testListeners() 70 function testListeners()
81 { 71 {
82 if (window.eventSender) { 72 if (window.eventSender) {
83 eventSender.mouseMoveTo(50, 50); 73 eventSender.mouseMoveTo(50, 50);
84 eventSender.mouseDown(); 74 eventSender.mouseDown();
(...skipping 29 matching lines...) Expand all
114 svg.appendChild(useContainer); 104 svg.appendChild(useContainer);
115 105
116 var use = document.createElementNS(svgNS, "use"); 106 var use = document.createElementNS(svgNS, "use");
117 use.id = "use"; 107 use.id = "use";
118 use.href.baseVal = "#rectParent"; 108 use.href.baseVal = "#rectParent";
119 useContainer.appendChild(use); 109 useContainer.appendChild(use);
120 110
121 function repaintTest() { 111 function repaintTest() {
122 nextTest(); 112 nextTest();
123 } 113 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/LayoutTests/svg/custom/use-event-attribute.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698