mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #12313, .height()/.width() just use CSS if no offsetWidth. Close gh-909.
This commit is contained in:
parent
9a92c5423f
commit
c078b83b3f
@ -411,7 +411,10 @@ function getWidthOrHeight( elem, name, extra ) {
|
|||||||
valueIsBorderBox = true,
|
valueIsBorderBox = true,
|
||||||
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
|
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
|
||||||
|
|
||||||
if ( val <= 0 ) {
|
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
||||||
|
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
||||||
|
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
||||||
|
if ( val <= 0 || val == null ) {
|
||||||
// Fall back to computed then uncomputed css if necessary
|
// Fall back to computed then uncomputed css if necessary
|
||||||
val = curCSS( elem, name );
|
val = curCSS( elem, name );
|
||||||
if ( val < 0 || val == null ) {
|
if ( val < 0 || val == null ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user