]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects: Check for anonymous content being exposed via document.activeElement. Fixes...
authorScott González <scott.gonzalez@gmail.com>
Mon, 7 May 2012 14:34:15 +0000 (10:34 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 7 May 2012 14:34:15 +0000 (10:34 -0400)
(cherry picked from commit a7e143b4fe395baeda297ea96ef39921ea7f5a5d)

Conflicts:

ui/jquery.effects.core.js

ui/jquery.effects.core.js

index eb848a13f87b09ca83836d68be50b499188998af..8ce867bd42ac98fd98dc4fb9fbfcf7c008b30df0 100644 (file)
@@ -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 ) ) {