diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-01-13 20:37:14 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-01-13 20:37:53 -0500 |
commit | de486684e3df1988080fd41c97d5f6ab8e6171ed (patch) | |
tree | 10bfb18f00552f616fe3ac7b5e4fde081040ccbe | |
parent | b75b9ef8d030b0dbf247e826bfbf9585c7dbf98b (diff) | |
download | jquery-de486684e3df1988080fd41c97d5f6ab8e6171ed.tar.gz jquery-de486684e3df1988080fd41c97d5f6ab8e6171ed.zip |
Fix f860e0bd Firefox failures
(cherry picked from commit 0a3a424e65f66414305bf6a34fc6fd93d3b61c62)
-rw-r--r-- | test/unit/event.js | 7 |
1 files changed, 4 insertions, 3 deletions
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( "<svg height='1' version='1.1' width='1' xmlns='http://www.w3.org/2000/svg'>" + "<defs><rect id='ref' x='10' y='20' width='100' height='60' r='10' rx='10' ry='10'></rect></defs>" + @@ -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 <use>) // 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"); |