From: Scott González Date: Mon, 7 May 2012 14:34:15 +0000 (-0400) Subject: Effects: Check for anonymous content being exposed via document.activeElement. Fixes... X-Git-Tag: 1.8.21~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b676d5956137d8bc35087e3160813a025be436d0;p=jquery-ui.git Effects: Check for anonymous content being exposed via document.activeElement. Fixes #8288 - Regression: jquery-ui animations focus fix causes Firefox Security Manager veto. (cherry picked from commit a7e143b4fe395baeda297ea96ef39921ea7f5a5d) Conflicts: ui/jquery.effects.core.js --- diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index eb848a13f..8ce867bd4 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -370,7 +370,16 @@ $.extend($.effects, { }), active = document.activeElement; - element.wrap(wrapper); + // support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + active.id; + } catch( e ) { + active = document.body; + } + + element.wrap( wrapper ); // Fixes #7595 - Elements lose focus when wrapped. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {