]> source.dussan.org Git - jquery.git/commitdiff
Revised the Nokia support fallback. It turns out that Nokia supports the documentElem... 143/head
authorscottjehl <scott@scottjehl.com>
Wed, 19 Jan 2011 17:40:32 +0000 (12:40 -0500)
committerscottjehl <scott@scottjehl.com>
Wed, 19 Jan 2011 17:40:32 +0000 (12:40 -0500)
src/dimensions.js

index 9d8c35454dd98d3f411af1619e439af71b3d175b..e2d411dd22897ee6e26c81c55f2943ad617ec316 100644 (file)
@@ -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 ] || window.screen && window.screen[ name.toLowerCase() ];
+                       // 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 ) {