scratch – Blame information for rev 58
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
58 | office | 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 | "use strict"; |
||
11 | |||
12 | function curCSS( elem, name, computed ) { |
||
13 | var width, minWidth, maxWidth, ret, |
||
14 | style = elem.style; |
||
15 | |||
16 | computed = computed || getStyles( elem ); |
||
17 | |||
18 | // Support: IE <=9 only |
||
19 | // getPropertyValue is only needed for .css('filter') (#12537) |
||
20 | if ( computed ) { |
||
21 | ret = computed.getPropertyValue( name ) || computed[ name ]; |
||
22 | |||
23 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { |
||
24 | ret = jQuery.style( elem, name ); |
||
25 | } |
||
26 | |||
27 | // A tribute to the "awesome hack by Dean Edwards" |
||
28 | // Android Browser returns percentage for some values, |
||
29 | // but width seems to be reliably pixels. |
||
30 | // This is against the CSSOM draft spec: |
||
31 | // https://drafts.csswg.org/cssom/#resolved-values |
||
32 | if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { |
||
33 | |||
34 | // Remember the original values |
||
35 | width = style.width; |
||
36 | minWidth = style.minWidth; |
||
37 | maxWidth = style.maxWidth; |
||
38 | |||
39 | // Put in the new values to get a computed value out |
||
40 | style.minWidth = style.maxWidth = style.width = ret; |
||
41 | ret = computed.width; |
||
42 | |||
43 | // Revert the changed values |
||
44 | style.width = width; |
||
45 | style.minWidth = minWidth; |
||
46 | style.maxWidth = maxWidth; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return ret !== undefined ? |
||
51 | |||
52 | // Support: IE <=9 - 11 only |
||
53 | // IE returns zIndex value as an integer. |
||
54 | ret + "" : |
||
55 | ret; |
||
56 | } |
||
57 | |||
58 | return curCSS; |
||
59 | } ); |