From b676d5956137d8bc35087e3160813a025be436d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 7 May 2012 10:34:15 -0400 Subject: [PATCH] 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 --- ui/jquery.effects.core.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ) ) { -- 2.39.5