Fix #6724, though the Mobile Safari wound remains. Closes gh-764.

This commit is contained in:
Matt Farmer
2012-05-14 14:12:14 -04:00
committed by Dave Methvin
parent 7778c77222
commit ca48d49040
2 changed files with 11 additions and 8 deletions

View File

@@ -28,14 +28,13 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.fn[ type ] = function( value ) {
return jQuery.access( this, function( elem, type, value ) {
var doc, docElemProp, orig, ret;
var doc, orig, ret;
if ( jQuery.isWindow( elem ) ) {
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
doc = elem.document;
docElemProp = doc.documentElement[ clientProp ];
return jQuery.support.boxModel && docElemProp ||
doc.body && doc.body[ clientProp ] || docElemProp;
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ clientProp ];
}
// Get document width or height