From: Richard Gibson Date: Mon, 14 Jan 2013 01:37:14 +0000 (-0500) Subject: Fix f860e0bd Firefox failures X-Git-Tag: 1.9.0~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0a3a424e65f66414305bf6a34fc6fd93d3b61c62;p=jquery.git Fix f860e0bd Firefox failures --- diff --git a/test/unit/event.js b/test/unit/event.js index 182e10b1a..041920a53 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 e, + var instanceRoot, e, svg = jQuery( "" + "" + @@ -1258,10 +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) - if ( document.createEvent ) { + instanceRoot = svg.find("#use")[0].instanceRoot; + if ( instanceRoot && document.createEvent ) { e = document.createEvent("MouseEvents"); e.initEvent( "click", true, true ); - svg.find("#use")[0].instanceRoot.dispatchEvent( e ); + instanceRoot.dispatchEvent( e ); } jQuery("#qunit-fixture").off("click");