c5169e0e
Renato De Donato
a new hope
|
1
|
define([
|
74249687
Luigi Serra
Cross browser con...
|
2
3
4
5
|
"../core",
"./var/rnumnonpx",
"./var/rmargin",
"./var/getStyles",
|
c5169e0e
Renato De Donato
a new hope
|
6
7
|
"../selector" // contains
], function( jQuery, rnumnonpx, rmargin, getStyles ) {
|
74249687
Luigi Serra
Cross browser con...
|
8
9
10
11
12
13
14
15
16
17
18
|
function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
style = elem.style;
computed = computed || getStyles( elem );
// Support: IE9
// getPropertyValue is only needed for .css('filter') (#12537)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
|
c5169e0e
Renato De Donato
a new hope
|
19
20
21
|
}
if ( computed ) {
|
74249687
Luigi Serra
Cross browser con...
|
22
23
24
25
26
|
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
|
c5169e0e
Renato De Donato
a new hope
|
27
|
// Support: iOS < 6
|
74249687
Luigi Serra
Cross browser con...
|
28
|
// A tribute to the "awesome hack by Dean Edwards"
|
c5169e0e
Renato De Donato
a new hope
|
29
30
31
|
// iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
74249687
Luigi Serra
Cross browser con...
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret !== undefined ?
|
c5169e0e
Renato De Donato
a new hope
|
50
|
// Support: IE
|
74249687
Luigi Serra
Cross browser con...
|
51
52
53
54
55
56
|
// IE returns zIndex value as an integer.
ret + "" :
ret;
}
return curCSS;
|
c5169e0e
Renato De Donato
a new hope
|
57
|
});
|