Make sure that expando properties aren't set on embed, applet, or object elements...
[jquery.git] / src / dimensions.js
index 69cfc45..3b74ded 100644 (file)
@@ -20,14 +20,14 @@ jQuery.each([ "Height", "Width" ], function(i, name){
        jQuery.fn[ type ] = function( size ) {
                // Get window width or height
                var elem = this[0];
-               if ( !elem ) return null;
+               if ( !elem ) { return null; }
                return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
                        elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
                        elem.document.body[ "client" + name ] :
 
                        // Get document width or height
-                       (elem.nodeName === "#document") ? // is it a document
+                       (elem.nodeType === 9) ? // is it a document
                                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
                                Math.max(
                                        elem.documentElement["client" + name],