Skip to content

Commit b676d59

Browse files
committed
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 a7e143b) Conflicts: ui/jquery.effects.core.js
1 parent 8445984 commit b676d59

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ui/jquery.effects.core.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,16 @@ $.extend($.effects, {
370370
}),
371371
active = document.activeElement;
372372

373-
element.wrap(wrapper);
373+
// support: Firefox
374+
// Firefox incorrectly exposes anonymous content
375+
// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
376+
try {
377+
active.id;
378+
} catch( e ) {
379+
active = document.body;
380+
}
381+
382+
element.wrap( wrapper );
374383

375384
// Fixes #7595 - Elements lose focus when wrapped.
376385
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {

0 commit comments

Comments
 (0)