7 "../selector" // Get jQuery.contains
8 ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
12 function curCSS( elem, name, computed ) {
13 var width, minWidth, maxWidth, ret,
15 // Support: Firefox 51+
16 // Retrieving style before computed somehow
17 // fixes an issue with getting wrong values
18 // on detached elements
21 computed = computed || getStyles( elem );
23 // getPropertyValue is needed for:
24 // .css('filter') (IE 9 only, #12537)
25 // .css('--customProperty) (#3144)
27 ret = computed.getPropertyValue( name ) || computed[ name ];
29 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
30 ret = jQuery.style( elem, name );
33 // A tribute to the "awesome hack by Dean Edwards"
34 // Android Browser returns percentage for some values,
35 // but width seems to be reliably pixels.
36 // This is against the CSSOM draft spec:
37 // https://drafts.csswg.org/cssom/#resolved-values
38 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
40 // Remember the original values
42 minWidth = style.minWidth;
43 maxWidth = style.maxWidth;
45 // Put in the new values to get a computed value out
46 style.minWidth = style.maxWidth = style.width = ret;
49 // Revert the changed values
51 style.minWidth = minWidth;
52 style.maxWidth = maxWidth;
56 return ret !== undefined ?
58 // Support: IE <=9 - 11 only
59 // IE returns zIndex value as an integer.