( elem, name, extra )
| 106 | } |
| 107 | |
| 108 | function getWidthOrHeight( elem, name, extra ) { |
| 109 | |
| 110 | // Start with offset property, which is equivalent to the border-box value |
| 111 | var valueIsBorderBox = true, |
| 112 | val = name === "width" ? elem.offsetWidth : elem.offsetHeight, |
| 113 | styles = getStyles( elem ), |
| 114 | isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; |
| 115 | |
| 116 | // Some non-html elements return undefined for offsetWidth, so check for null/undefined |
| 117 | // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 |
| 118 | // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 |
| 119 | if ( val <= 0 || val == null ) { |
| 120 | // Fall back to computed then uncomputed css if necessary |
| 121 | val = curCSS( elem, name, styles ); |
| 122 | if ( val < 0 || val == null ) { |
| 123 | val = elem.style[ name ]; |
| 124 | } |
| 125 | |
| 126 | // Computed unit is not pixels. Stop here and return. |
| 127 | if ( rnumnonpx.test(val) ) { |
| 128 | return val; |
| 129 | } |
| 130 | |
| 131 | // Check for style in case a browser which returns unreliable values |
| 132 | // for getComputedStyle silently falls back to the reliable elem.style |
| 133 | valueIsBorderBox = isBorderBox && |
| 134 | ( support.boxSizingReliable() || val === elem.style[ name ] ); |
| 135 | |
| 136 | // Normalize "", auto, and prepare for extra |
| 137 | val = parseFloat( val ) || 0; |
| 138 | } |
| 139 | |
| 140 | // Use the active box-sizing model to add/subtract irrelevant styles |
| 141 | return ( val + |
| 142 | augmentWidthOrHeight( |
| 143 | elem, |
| 144 | name, |
| 145 | extra || ( isBorderBox ? "border" : "content" ), |
| 146 | valueIsBorderBox, |
| 147 | styles |
| 148 | ) |
| 149 | ) + "px"; |
| 150 | } |
| 151 | |
| 152 | function showHide( elements, show ) { |
| 153 | var display, elem, hidden, |
no test coverage detected