@@ -9,12 +9,120 @@ var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationPro
99 var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out' ;
1010 var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in' ;
1111
12+
13+ var ANIMATED_PROPS = [
14+ 'MozOutlineRadius' ,
15+ 'MozOutlineRadiusBottomleft' ,
16+ 'MozOutlineRadiusBottomright' ,
17+ 'MozOutlineRadiusTopleft' ,
18+ 'MozOutlineRadiusTopright' ,
19+ 'WebkitTextStroke' ,
20+ 'WebkitTextStrokeColor' ,
21+ 'WebkitTouchCallout' ,
22+ 'backdropFilter' ,
23+ 'background' ,
24+ 'backgroundColor' ,
25+ 'backgroundPosition' ,
26+ 'backgroundSize' ,
27+ 'border' ,
28+ 'borderBottom' ,
29+ 'borderBottomColor' ,
30+ 'borderBottomLeftRadius' ,
31+ 'borderBottomRightRadius' ,
32+ 'borderBottomWidth' ,
33+ 'borderColor' ,
34+ 'borderLeft' ,
35+ 'borderLeftColor' ,
36+ 'borderLeftWidth' ,
37+ 'borderRadius' ,
38+ 'borderRight' ,
39+ 'borderRightColor' ,
40+ 'borderRightWidth' ,
41+ 'borderTop' ,
42+ 'borderTopColor' ,
43+ 'borderTopLeftRadius' ,
44+ 'borderTopRightRadius' ,
45+ 'borderTopWidth' ,
46+ 'borderWidth' ,
47+ 'bottom' ,
48+ 'boxShadow' ,
49+ 'clip' ,
50+ 'clipPath' ,
51+ 'color' ,
52+ 'columnCount' ,
53+ 'columnGap' ,
54+ 'columnRule' ,
55+ 'columnRuleColor' ,
56+ 'columnRuleWidth' ,
57+ 'columnWidth' ,
58+ 'columns' ,
59+ 'filter' ,
60+ 'flex' ,
61+ 'flexBasis' ,
62+ 'flexGrow' ,
63+ 'flexShrink' ,
64+ 'font' ,
65+ 'fontSize' ,
66+ 'fontSizeAdjust' ,
67+ 'fontStretch' ,
68+ 'fontWeight' ,
69+ 'gridColumnGap' ,
70+ 'gridGap' ,
71+ 'gridRowGap' ,
72+ 'letterSpacing' ,
73+ 'lineHeight' ,
74+ 'margin' ,
75+ 'marginBottom' ,
76+ 'marginLeft' ,
77+ 'marginRight' ,
78+ 'marginTop' ,
79+ 'mask' ,
80+ 'maskPosition' ,
81+ 'maskSize' ,
82+ 'maxHeight' ,
83+ 'maxWidth' ,
84+ 'minHeight' ,
85+ 'minWidth' ,
86+ 'motionOffset' ,
87+ 'motionRotation' ,
88+ 'objectPosition' ,
89+ 'opacity' ,
90+ 'order' ,
91+ 'outline' ,
92+ 'outlineColor' ,
93+ 'outlineOffset' ,
94+ 'outlineWidth' ,
95+ 'padding' ,
96+ 'paddingBottom' ,
97+ 'paddingLeft' ,
98+ 'paddingRight' ,
99+ 'paddingTop' ,
100+ 'perspective' ,
101+ 'perspectiveOrigin' ,
102+ 'scrollSnapCoordinate' ,
103+ 'scrollSnapDestination' ,
104+ 'shapeImageThreshold' ,
105+ 'shapeMargin' ,
106+ 'shapeOutside' ,
107+ 'textDecoration' ,
108+ 'textDecorationColor' ,
109+ 'textEmphasis' ,
110+ 'textEmphasisColor' ,
111+ 'textIndent' ,
112+ 'textShadow' ,
113+ 'transform' ,
114+ 'transformOrigin' ,
115+ 'verticalAlign' ,
116+ 'wordSpacing' ,
117+ 'zIndex'
118+ ] ;
119+
12120 function isDocumentFragment ( node ) {
13121 return node . parentNode && node . parentNode . nodeType === 11 ;
14122 }
15123
16- this . $get = [ '$animateCss' , '$rootScope' , '$$AnimateRunner' , '$rootElement' , '$sniffer' , '$$jqLite' , '$document' ,
17- function ( $animateCss , $rootScope , $$AnimateRunner , $rootElement , $sniffer , $$jqLite , $document ) {
124+ this . $get = [ '$animateCss' , '$rootScope' , '$$AnimateRunner' , '$rootElement' , '$sniffer' , '$$jqLite' , '$document' , '$window' ,
125+ function ( $animateCss , $rootScope , $$AnimateRunner , $rootElement , $sniffer , $$jqLite , $document , $window ) {
18126
19127 // only browsers that support these properties can render animations
20128 if ( ! $sniffer . animations && ! $sniffer . transitions ) return noop ;
@@ -121,11 +229,13 @@ var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationPro
121229 function calculateAnchorStyles ( anchor ) {
122230 var styles = { } ;
123231
124- var coords = getDomNode ( anchor ) . getBoundingClientRect ( ) ;
232+ var domNode = getDomNode ( anchor ) ;
233+ var computedStyle = domNode . currentStyle || $window . getComputedStyle ( domNode ) || [ ] ;
234+ var coords = domNode . getBoundingClientRect ( ) ;
125235
126236 // we iterate directly since safari messes up and doesn't return
127237 // all the keys for the coords object when iterated
128- forEach ( [ 'width' , 'height' , 'top' , 'left' ] , function ( key ) {
238+ forEach ( [ 'width' , 'height' , 'top' , 'left' , 'color' ] , function ( key ) {
129239 var value = coords [ key ] ;
130240 switch ( key ) {
131241 case 'top' :
@@ -137,6 +247,10 @@ var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationPro
137247 }
138248 styles [ key ] = Math . floor ( value ) + 'px' ;
139249 } ) ;
250+ forEach ( ANIMATED_PROPS , function ( prop ) {
251+ styles [ prop ] = computedStyle [ prop ] ;
252+ } ) ;
253+
140254 return styles ;
141255 }
142256
0 commit comments