aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorMerrifield, Jay <jmerrifiel@gannett.com>2012-10-15 11:54:32 -0400
committerMike Sherov <mike.sherov@gmail.com>2012-10-20 14:00:30 -0400
commit408e5e08c23dda11e6e7a7f8dc44c9e6fcbe870d (patch)
treee8f5b79d56b3e1a9ceef8d39a2e573f956bcd436 /src/event.js
parenta7a8aad4e335f7d61de688f50aefcca4756a2651 (diff)
downloadjquery-408e5e08c23dda11e6e7a7f8dc44c9e6fcbe870d.tar.gz
jquery-408e5e08c23dda11e6e7a7f8dc44c9e6fcbe870d.zip
Fixes #12518, removes an offsetWidth on focus/blur events for an <IE9 bug that caused a performance hit. Closes gh-958
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/event.js b/src/event.js
index f3335a074..330310fc8 100644
--- a/src/event.js
+++ b/src/event.js
@@ -327,8 +327,7 @@ jQuery.event = {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
@@ -339,7 +338,12 @@ jQuery.event = {
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
- elem[ type ]();
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
jQuery.event.triggered = undefined;
if ( old ) {