Unify the means of detecting a window across the library. Fixes jQuery UI bug #5438...
[jquery.git] / src / dimensions.js
index 7ca3379..5aafbf4 100644 (file)
@@ -33,7 +33,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
                        });
                }
 
-               return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+               return jQuery.isWindow( elem ) ?
                        // 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 ] :