scratch – Blame information for rev 125

Subversion Repositories:
Rev:
Rev Author Line No. Line
125 office 1 define([
58 office 2 "../core",
3 "./var/rnumnonpx",
4 "./var/rmargin",
5 "./var/getStyles",
125 office 6 "../selector" // contains
7 ], function( jQuery, rnumnonpx, rmargin, getStyles ) {
58 office 8  
9 function curCSS( elem, name, computed ) {
10 var width, minWidth, maxWidth, ret,
11 style = elem.style;
12  
13 computed = computed || getStyles( elem );
14  
125 office 15 // Support: IE9
58 office 16 // getPropertyValue is only needed for .css('filter') (#12537)
17 if ( computed ) {
18 ret = computed.getPropertyValue( name ) || computed[ name ];
125 office 19 }
58 office 20  
125 office 21 if ( computed ) {
22  
58 office 23 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
24 ret = jQuery.style( elem, name );
25 }
26  
125 office 27 // Support: iOS < 6
58 office 28 // A tribute to the "awesome hack by Dean Edwards"
125 office 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 ) ) {
58 office 32  
33 // Remember the original values
34 width = style.width;
35 minWidth = style.minWidth;
36 maxWidth = style.maxWidth;
37  
38 // Put in the new values to get a computed value out
39 style.minWidth = style.maxWidth = style.width = ret;
40 ret = computed.width;
41  
42 // Revert the changed values
43 style.width = width;
44 style.minWidth = minWidth;
45 style.maxWidth = maxWidth;
46 }
47 }
48  
49 return ret !== undefined ?
125 office 50 // Support: IE
58 office 51 // IE returns zIndex value as an integer.
52 ret + "" :
53 ret;
54 }
55  
56 return curCSS;
125 office 57 });