From: Richard Gibson Date: Mon, 14 Jan 2013 03:59:20 +0000 (-0500) Subject: de486684 with moar guard for IE6 X-Git-Tag: 2.0.0b1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=348e1a75c87d13a0c87c6cc58b82bf9746e7eb9c;p=jquery.git de486684 with moar guard for IE6 (cherry picked from commit 6c29dd24e9786dfd61cdfdb5d21ffcb5694e25ea) --- diff --git a/test/unit/event.js b/test/unit/event.js index bc98f73cb..6984b4945 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1234,7 +1234,7 @@ test(".trigger() doesn't bubble load event (#10717)", function() { test("Delegated events in SVG (#10791; #13180)", function() { expect(2); - var instanceRoot, e, + var useElem, e, svg = jQuery( "" + "" + @@ -1258,11 +1258,11 @@ test("Delegated events in SVG (#10791; #13180)", function() { // Fire a native click on an SVGElementInstance (the instance tree of an SVG ) // to confirm that it doesn't break our event delegation handling (#13180) - instanceRoot = svg.find("#use")[0].instanceRoot; - if ( instanceRoot && document.createEvent ) { + useElem = svg.find("#use")[0]; + if ( document.createEvent && useElem && useElem.instanceRoot ) { e = document.createEvent("MouseEvents"); e.initEvent( "click", true, true ); - instanceRoot.dispatchEvent( e ); + useElem.instanceRoot.dispatchEvent( e ); } jQuery("#qunit-fixture").off("click");