Return null for outer/inner width/height calls on window/document. Fixes #7557.
This commit is contained in:
parent
1d1cb582c0
commit
edb2286544
3 changed files with 37 additions and 9 deletions
|
@ -170,6 +170,11 @@ jQuery.each(["height", "width"], function( i, name ) {
|
|||
get: function( elem, computed, extra ) {
|
||||
var val;
|
||||
|
||||
// Tests for window/document
|
||||
if ( !elem.style ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( computed ) {
|
||||
if ( elem.offsetWidth !== 0 ) {
|
||||
val = getWH( elem, name, extra );
|
||||
|
@ -196,7 +201,6 @@ jQuery.each(["height", "width"], function( i, name ) {
|
|||
|
||||
if ( val < 0 || val == null ) {
|
||||
val = elem.style[ name ];
|
||||
|
||||
// Should return "auto" instead of 0, use 0 for
|
||||
// temporary backwards-compat
|
||||
return val === "" || val === "auto" ? "0px" : val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue