Tagging the 1.5rc1 release.
[jquery.git] / src / dimensions.js
index f5212e1..e2d411d 100644 (file)
@@ -25,7 +25,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
                if ( !elem ) {
                        return size == null ? null : this;
                }
-               
+
                if ( jQuery.isFunction( size ) ) {
                        return this.each(function( i ) {
                                var self = jQuery( this );
@@ -35,8 +35,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
 
                if ( jQuery.isWindow( elem ) ) {
                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
-                       return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
-                               elem.document.body[ "client" + name ];
+                       // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+                       var docElemProp = elem.document.documentElement[ "client" + name ];
+                       return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+                               elem.document.body[ "client" + name ] || docElemProp;
 
                // Get document width or height
                } else if ( elem.nodeType === 9 ) {
@@ -49,7 +51,9 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
 
                // Get or set width or height on the element
                } else if ( size === undefined ) {
-                       var orig = jQuery.css( elem, type ), ret = parseFloat( orig );
+                       var orig = jQuery.css( elem, type ),
+                               ret = parseFloat( orig );
+
                        return jQuery.isNaN( ret ) ? orig : ret;
 
                // Set the width or height on the element (default to pixels if value is unitless)