Skip to content

Commit 348e1a7

Browse files
committed
de48668 with moar guard for IE6
(cherry picked from commit 6c29dd2)
1 parent eff59f9 commit 348e1a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/unit/event.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ test(".trigger() doesn't bubble load event (#10717)", function() {
12341234
test("Delegated events in SVG (#10791; #13180)", function() {
12351235
expect(2);
12361236

1237-
var instanceRoot, e,
1237+
var useElem, e,
12381238
svg = jQuery(
12391239
"<svg height='1' version='1.1' width='1' xmlns='http://www.w3.org/2000/svg'>" +
12401240
"<defs><rect id='ref' x='10' y='20' width='100' height='60' r='10' rx='10' ry='10'></rect></defs>" +
@@ -1258,11 +1258,11 @@ test("Delegated events in SVG (#10791; #13180)", function() {
12581258

12591259
// Fire a native click on an SVGElementInstance (the instance tree of an SVG <use>)
12601260
// to confirm that it doesn't break our event delegation handling (#13180)
1261-
instanceRoot = svg.find("#use")[0].instanceRoot;
1262-
if ( instanceRoot && document.createEvent ) {
1261+
useElem = svg.find("#use")[0];
1262+
if ( document.createEvent && useElem && useElem.instanceRoot ) {
12631263
e = document.createEvent("MouseEvents");
12641264
e.initEvent( "click", true, true );
1265-
instanceRoot.dispatchEvent( e );
1265+
useElem.instanceRoot.dispatchEvent( e );
12661266
}
12671267

12681268
jQuery("#qunit-fixture").off("click");

0 commit comments

Comments
 (0)