]> source.dussan.org Git - jquery.git/commitdiff
Fix #13315 for IE9: compare typeof xmlNode.method to var instead of literal "undefine... 1144/head
authorRichard Gibson <richard.gibson@gmail.com>
Thu, 24 Jan 2013 04:25:29 +0000 (23:25 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Sun, 27 Jan 2013 15:04:09 +0000 (10:04 -0500)
(cherry picked from commit ec9b38a34fb9bd81d1903cf12b69466f699abca5)

src/attributes.js
src/core.js
src/event.js
src/manipulation.js
src/offset.js

index fd40f0018f2fba0a595445a8eec44274ada70f7c..c9e7dbc47ebe53390e354dc91c1ef15046ff2d36 100644 (file)
@@ -134,7 +134,7 @@ jQuery.fn.extend({
                                }
 
                        // Toggle whole class name
-                       } else if ( type === "undefined" || type === "boolean" ) {
+                       } else if ( type === core_strundefined || type === "boolean" ) {
                                if ( this.className ) {
                                        // store className if set
                                        jQuery._data( this, "__className__", this.className );
@@ -296,7 +296,7 @@ jQuery.extend({
                }
 
                // Fallback to prop when attributes are not supported
-               if ( typeof elem.getAttribute === "undefined" ) {
+               if ( typeof elem.getAttribute === core_strundefined ) {
                        return jQuery.prop( elem, name, value );
                }
 
@@ -329,7 +329,7 @@ jQuery.extend({
 
                        // In IE9+, Flash objects don't have .getAttribute (#12945)
                        // Support: IE9+
-                       if ( typeof elem.getAttribute !== "undefined" ) {
+                       if ( typeof elem.getAttribute !== core_strundefined ) {
                                ret =  elem.getAttribute( name );
                        }
 
index 9efdc229e0476fc89d7312ff888b472a3b59d91e..c2dc4bc9bd11d910eedb3694503effe78fdda90b 100644 (file)
@@ -5,6 +5,10 @@ var
        // The deferred used on DOM ready
        readyList,
 
+       // Support: IE9
+       // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
+       core_strundefined = typeof undefined,
+
        // Use the correct document accordingly with window argument (sandbox)
        document = window.document,
        location = window.location,
index 7cb141a63a92b174ee87a568be95e0e5702813a5..54e08c8e7e264734de89c291dc972cc10d94561d 100644 (file)
@@ -51,7 +51,7 @@ jQuery.event = {
                        eventHandle = elemData.handle = function( e ) {
                                // Discard the second event of a jQuery.event.trigger() and
                                // when an event is called after a page has unloaded
-                               return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+                               return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
                                        jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
                                        undefined;
                        };
index 9b70db7f3c29cc41bacd11b303565481e359677c..708d7851dd2cfe40eba3b3a8a10c4f25e77266c1 100644 (file)
@@ -563,7 +563,6 @@ function restoreScript( elem ) {
 
        if ( match ) {
                elem.type = match[ 1 ];
-
        } else {
                elem.removeAttribute("type");
        }
index 4fb37bb7cea59f7a5b36c1f8e2d0f4cda5e521d7..fc110f012089ed1b022b57183ff19514351c2b80 100644 (file)
@@ -25,7 +25,7 @@ jQuery.fn.offset = function( options ) {
 
        // If we don't have gBCR, just use 0,0 rather than error
        // BlackBerry 5, iOS 3 (original iPhone)
-       if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+       if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
                box = elem.getBoundingClientRect();
        }
        win = getWindow( doc );