6 "../selector" // contains
7 ], function( jQuery, rnumnonpx, rmargin, getStyles ) {
9 function curCSS( elem, name, computed ) {
10 var width, minWidth, maxWidth, ret,
13 computed = computed || getStyles( elem );
16 // getPropertyValue is only needed for .css('filter') (#12537)
18 ret = computed.getPropertyValue( name ) || computed[ name ];
23 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
24 ret = jQuery.style( elem, name );
28 // A tribute to the "awesome hack by Dean Edwards"
29 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
30 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
31 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
33 // Remember the original values
35 minWidth = style.minWidth;
36 maxWidth = style.maxWidth;
38 // Put in the new values to get a computed value out
39 style.minWidth = style.maxWidth = style.width = ret;
42 // Revert the changed values
44 style.minWidth = minWidth;
45 style.maxWidth = maxWidth;
49 return ret !== undefined ?
51 // IE returns zIndex value as an integer.