nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jquery / src / css / curCSS.js
1 define( [
2         "../core",
3         "./var/rnumnonpx",
4         "./var/rmargin",
5         "./var/getStyles",
6         "./support",
7         "../selector" // Get jQuery.contains
8 ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
9
10 function curCSS( elem, name, computed ) {
11         var width, minWidth, maxWidth, ret,
12                 style = elem.style;
13
14         computed = computed || getStyles( elem );
15         ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
16
17         // Support: Opera 12.1x only
18         // Fall back to style even without computed
19         // computed is undefined for elems on document fragments
20         if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
21                 ret = jQuery.style( elem, name );
22         }
23
24         // Support: IE9
25         // getPropertyValue is only needed for .css('filter') (#12537)
26         if ( computed ) {
27
28                 // A tribute to the "awesome hack by Dean Edwards"
29                 // Android Browser returns percentage for some values,
30                 // but width seems to be reliably pixels.
31                 // This is against the CSSOM draft spec:
32                 // http://dev.w3.org/csswg/cssom/#resolved-values
33                 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
34
35                         // Remember the original values
36                         width = style.width;
37                         minWidth = style.minWidth;
38                         maxWidth = style.maxWidth;
39
40                         // Put in the new values to get a computed value out
41                         style.minWidth = style.maxWidth = style.width = ret;
42                         ret = computed.width;
43
44                         // Revert the changed values
45                         style.width = width;
46                         style.minWidth = minWidth;
47                         style.maxWidth = maxWidth;
48                 }
49         }
50
51         return ret !== undefined ?
52
53                 // Support: IE9-11+
54                 // IE returns zIndex value as an integer.
55                 ret + "" :
56                 ret;
57 }
58
59 return curCSS;
60 } );