Maintain returning 0px from width/height for disconnected nodes for backwards compat, for now. Fixes #7395.

This commit is contained in:
jeresig 2010-11-09 23:29:26 -05:00
parent 795e880bba
commit 3394d32ea7
3 changed files with 35 additions and 8 deletions

View file

@ -177,13 +177,18 @@ jQuery.each(["height", "width"], function( i, name ) {
}
if ( val != null ) {
return val === "" ? "auto" : val;
// Should return "auto" instead of 0, use 0 for
// temporary backwards-compat
return val === "" ? "0px" : val;
}
}
if ( val < 0 || val == null ) {
val = elem.style[ name ];
return val === "" ? "auto" : val;
// Should return "auto" instead of 0, use 0 for
// temporary backwards-compat
return val === "" ? "0px" : val;
}
return typeof val === "string" ? val : val + "px";