Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: polymer_0.5.0/bower_components/web-animations-js/test/blink/interpolation/transform-translate-interpolation.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="UTF-8">
3 <style>
4 .target {
5 color: white;
6 width: 100px;
7 height: 100px;
8 background-color: black;
9 display: inline-block;
10 overflow: hidden;
11 }
12 .replica {
13 background-color: green;
14 }
15 .target div {
16 width: 10px;
17 height: 10px;
18 display: inline-block;
19 background: orange;
20 margin: 1px;
21 }
22 .test {
23 overflow: hidden;
24 }
25 </style>
26 <body>
27 <template id="target-template">
28 <div></div>
29 </template>
30 <script src="../testharness/testharness.js"></script>
31 <script src="../testharness/testharnessreport.js"></script>
32 <script src="resources/interpolation-test.js"></script>
33 <script>
34
35 assertInterpolation({
36 property: 'transform',
37 prefixedProperty: ['-webkit-transform'],
38 from: 'translate(12px, 70%)',
39 to: 'translate(13px, 90%)'
40 }, [
41 {at: -1, is: 'translate(11px, 50%)'},
42 {at: 0, is: 'translate(12px, 70%)'},
43 {at: 0.25, is: 'translate(12.25px, 75%)'},
44 {at: 0.75, is: 'translate(12.75px, 85%)'},
45 {at: 1, is: 'translate(13px, 90%)'},
46 {at: 2, is: 'translate(14px, 110%)'},
47 ]);
48 assertInterpolation({
49 property: 'transform',
50 prefixedProperty: ['-webkit-transform'],
51 from: 'translateX(12px)',
52 to: 'translateX(13px)'
53 }, [
54 {at: -1, is: 'translateX(11px)'},
55 {at: 0, is: 'translateX(12px)'},
56 {at: 0.25, is: 'translateX(12.25px)'},
57 {at: 0.75, is: 'translateX(12.75px)'},
58 {at: 1, is: 'translateX(13px)'},
59 {at: 2, is: 'translateX(14px)'},
60 ]);
61 assertInterpolation({
62 property: 'transform',
63 prefixedProperty: ['-webkit-transform'],
64 from: 'translateY(70%)',
65 to: 'translateY(90%)'
66 }, [
67 {at: -1, is: 'translateY(50%)'},
68 {at: 0, is: 'translateY(70%)'},
69 {at: 0.25, is: 'translateY(75%)'},
70 {at: 0.75, is: 'translateY(85%)'},
71 {at: 1, is: 'translateY(90%)'},
72 {at: 2, is: 'translateY(110%)'},
73 ]);
74 assertInterpolation({
75 property: 'transform',
76 prefixedProperty: ['-webkit-transform'],
77 from: 'translateZ(2em)',
78 to: 'translateZ(3em)'
79 }, [
80 {at: -1, is: 'translateZ(1em)'},
81 {at: 0, is: 'translateZ(2em)'},
82 {at: 0.25, is: 'translateZ(2.25em)'},
83 {at: 0.75, is: 'translateZ(2.75em)'},
84 {at: 1, is: 'translateZ(3em)'},
85 {at: 2, is: 'translateZ(4em)'},
86 ]);
87 assertInterpolation({
88 property: 'transform',
89 prefixedProperty: ['-webkit-transform'],
90 from: 'translate3d(12px, 70%, 2em)',
91 to: 'translate3d(13px, 90%, 3em)'
92 }, [
93 {at: -1, is: 'translate3d(11px, 50%, 1em)'},
94 {at: 0, is: 'translate3d(12px, 70%, 2em)'},
95 {at: 0.25, is: 'translate3d(12.25px, 75%, 2.25em)'},
96 {at: 0.75, is: 'translate3d(12.75px, 85%, 2.75em)'},
97 {at: 1, is: 'translate3d(13px, 90%, 3em)'},
98 {at: 2, is: 'translate3d(14px, 110%, 4em)'},
99 ]);
100 assertInterpolation({
101 property: 'transform',
102 prefixedProperty: ['-webkit-transform'],
103 from: 'translateX(12px) translateY(70%) translateZ(2em)',
104 to: 'translateX(13px) translateY(90%) translateZ(3em)'
105 }, [
106 {at: -1, is: 'translateX(11px) translateY(50%) translateZ(1em)'},
107 {at: 0, is: 'translateX(12px) translateY(70%) translateZ(2em)'},
108 {at: 0.25, is: 'translateX(12.25px) translateY(75%) translateZ(2.25em)'},
109 {at: 0.75, is: 'translateX(12.75px) translateY(85%) translateZ(2.75em)'},
110 {at: 1, is: 'translateX(13px) translateY(90%) translateZ(3em)'},
111 {at: 2, is: 'translateX(14px) translateY(110%) translateZ(4em)'},
112 ]);
113 assertInterpolation({
114 property: 'transform',
115 prefixedProperty: ['-webkit-transform'],
116 from: 'skewX(10rad) translateY(70%)',
117 to: 'skewX(20rad) translateY(90%)'
118 }, [
119 {at: -1, is: 'skewX(0rad) translateY(50%)'},
120 {at: 0, is: 'skewX(10rad) translateY(70%)'},
121 {at: 0.25, is: 'skewX(12.5rad) translateY(75%)'},
122 {at: 0.75, is: 'skewX(17.5rad) translateY(85%)'},
123 {at: 1, is: 'skewX(20rad) translateY(90%)'},
124 {at: 2, is: 'skewX(30rad) translateY(110%)'},
125 ]);
126 assertInterpolation({
127 property: 'transform',
128 prefixedProperty: ['-webkit-transform'],
129 from: 'skewX(1rad)',
130 to: 'translate3d(8px, -4px, 12px) skewX(2rad)'
131 }, [
132 {at: -1, is: 'matrix3d(1, 0, 0, 0, 5.2998553125713235, 1, 0, 0, 0, 0, 1, 0, -8 , 4, -12, 1)'},
133 {at: 0, is: 'matrix(1, 0, 1.5574077246549023, 1, 0, 0)'},
134 {at: 0.25, is: 'matrix3d(1, 0, 0, 0, 0.621795827675797, 1, 0, 0, 0, 0, 1, 0, 2 , -1, 3, 1)'},
135 {at: 0.75, is: 'matrix3d(1, 0, 0, 0, -1.2494279662824135, 1, 0, 0, 0, 0, 1, 0, 6, -3, 9, 1)'},
136 {at: 1, is: 'matrix3d(1, 0, 0, 0, -2.185039863261519, 1, 0, 0, 0, 0, 1, 0, 8, -4, 12, 1)'},
137 {at: 2, is: 'matrix3d(1, 0, 0, 0, -5.9274874511779405, 1, 0, 0, 0, 0, 1, 0, 16 , -8, 24, 1)'},
138 ]);
139
140 // FIXME: skewX in matrix decompositions has issues.
141 // assertInterpolation({
142 // property: 'transform',
143 // from: 'translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)',
144 // to: 'scaleY(2) skewX(2rad) perspective(500px)'
145 // }, [
146 // {at: -1, is: 'matrix3d(1, 0, 0, 0, 0, 0, 0, 0, -0.03876288659793814, 0.0193 8144329896907, 0.94, -0.0029653608247422686, 16, -8, 24, 0.986144329896907)'},
147 // {at: 0, is: 'matrix3d(1, 0, 0, 0, 1.5574077246549023, 1, 0, 0, -0.02, 0.01, 0.97, -0.0025, 8, -4, 12, 1)'},
148 // {at: 0.25, is: 'matrix3d(1, 0, 0, 0, 1.1186572632293585, 1.25, 0, 0, -0.015 1159793814433, 0.00755798969072165, 0.9775, -0.002378247422680413, 6, -3, 9, 1.0 012989690721648)'},
149 // {at: 0.75, is: 'matrix3d(1, 0, 0, 0, -0.7525665307288518, 1.75, 0, 0, -0.00 5115979381443298, 0.002557989690721649, 0.9924999999999999, -0.00212824742268041 2, 2, -1, 3, 1.001298969072165)'},
150 // {at: 1, is: 'matrix3d(1, 0, 0, 0, -2.185039863261519, 2, 0, 0, 0, 0, 1, -0. 002, 0, 0, 0, 1)'},
151 // {at: 2, is: 'matrix3d(1, 0, 0, 0, -11.227342763749263, 3, 0, 0, 0.021237113 402061854, -0.010618556701030927, 1.03, -0.0014653608247422677, -8, 4, -12, 0.98 61443298969074)'},
152 // ]);
153 // assertInterpolation({
154 // property: 'transform',
155 // from: 'translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)',
156 // to: 'translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)'
157 // }, [
158 // {at: -1, is: 'matrix3d(1, 0, 0, 0, 0, 0, 0, 0, -0.03165032268879389, -0.003 6057329645461413, 0.956, -0.002984745620652083, 12, 4, 16, 0.9956416059005948)'} ,
159 // {at: 0, is: 'matrix3d(1, 0, 0, 0, 1.5574077246549023, 1, 0, 0, -0.02, 0.01, 0.97, -0.0025, 8, -4, 12, 1)'},
160 // {at: 0.25, is: 'matrix3d(1, 0, 0, 0, 1.4600697418639708, 1.25, 0, 0, -0.017 032782247925572, 0.013463037465426202, 0.9735, -0.0023764300980638675, 7, -6, 11 , 1.0004085994468193)'},
161 // {at: 0.75, is: 'matrix3d(1, 0, 0, 0, 0.68136587953652, 1.75, 0, 0, -0.01103 2782247925572, 0.0204630374654262, 0.9804999999999999, -0.0021264300980638673, 5 , -10, 9, 1.0004085994468193)'},
162 // {at: 1, is: 'matrix3d(1, 0, 0, 0, 0, 2, 0, 0, -0.008, 0.024, 0.984, -0.002, 4, -12, 8, 1)'},
163 // {at: 2, is: 'matrix3d(1, 0, 0, 0, -4.672223173964706, 3, 0, 0, 0.0043496773 112061, 0.038394267035453865, 0.998, -0.0014847456206520829, 0, -20, 4, 0.995641 6059005954)'},
164 // ]);
165 // assertInterpolation({
166 // property: 'transform',
167 // from: 'translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)',
168 // to: 'translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)'
169 // }, [
170 // {at: -1, is: 'matrix3d(1, 0, 0, 0, 0, 0, 0, 0, -0.03876288659793814, 0.0193 8144329896907, 0.94, -0.004845360824742268, 12, 4, 16, 0.9793814432989688)'},
171 // {at: 0, is: 'matrix3d(1, 0, 0, 0, 1.5574077246549023, 1, 0, 0, -0.02, 0.01, 0.97, -0.0025, 8, -4, 12, 1)'},
172 // {at: 0.25, is: 'matrix3d(1, 0, 0, 0, 0.7772447845947462, 1.25, 0, 0, -0.015 1159793814433, 0.00755798969072165, 0.9775, -0.0018894974226804128, 7, -6, 11, 1 .0019329896907216)'},
173 // {at: 0.75, is: 'matrix3d(1, 0, 0, 0, -2.1864989409942237, 1.75, 0, 0, -0.00 5115979381443298, 0.002557989690721649, 0.9924999999999999, -0.00063949742268041 24, 5, -10, 9, 1.0019329896907216)'},
174 // {at: 1, is: 'matrix3d(1, 0, 0, 0, -4.370079726523038, 2, 0, 0, 0, 0, 1, 0, 4, -12, 8, 1)'},
175 // {at: 2, is: 'matrix3d(1, 0, 0, 0, -17.782462353533823, 3, 0, 0, 0.021237113 402061854, -0.010618556701030927, 1.03, 0.0026546391752577322, 0, -20, 4, 0.9793 814432989691)'},
176 // ]);
177 </script>
178 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698