Commit 2b64b1db authored by scottjehl's avatar scottjehl

Revised the Nokia support fallback. It turns out that Nokia supports the...

Revised the Nokia support fallback. It turns out that Nokia supports the documentElement property but does not define document.compatMode. Adding this third fallback allows Nokia to run jQuery error-free and return proper values for window width and height.
parent cb1f7eea
...@@ -35,8 +35,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { ...@@ -35,8 +35,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( jQuery.isWindow( elem ) ) { if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
elem.document.body[ "client" + name ] || window.screen && window.screen[ name.toLowerCase() ]; var docElemProp = elem.document.documentElement[ "client" + name ];
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
elem.document.body[ "client" + name ] || docElemProp;
// Get document width or height // Get document width or height
} else if ( elem.nodeType === 9 ) { } else if ( elem.nodeType === 9 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment