OLD | NEW |
---|---|
1 <!DOCTYPE> | 1 <!DOCTYPE> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <style> | 5 <style> |
6 .init { | 6 .init { |
7 transition-duration: 1s; | 7 transition-duration: 1s; |
8 transition-timing-function: linear; | 8 transition-timing-function: linear; |
9 } | 9 } |
10 | 10 |
11 #x { | 11 #x { |
12 transition-property: x; | 12 transition-property: x; |
13 } | 13 } |
14 #x.final { | 14 #x.final { |
15 x: 200px; | 15 x: 200px; |
16 } | 16 } |
17 | 17 |
18 #y { | 18 #y { |
19 transition-property: y; | 19 transition-property: y; |
20 } | 20 } |
21 #y.final { | 21 #y.final { |
22 y: 200px; | 22 y: 200px; |
23 } | 23 } |
24 | |
25 .rx { | |
26 transition-property: rx; | |
27 } | |
28 .rx.final { | |
29 rx: 200px; | |
30 } | |
31 | |
32 .ry { | |
33 transition-property: ry; | |
34 } | |
35 .ry.final { | |
36 ry: 200px; | |
37 } | |
24 </style> | 38 </style> |
25 <script src="../animations/resources/animation-test-helpers.js"></script> | 39 <script src="../animations/resources/animation-test-helpers.js"></script> |
26 <script type="text/javascript"> | 40 <script type="text/javascript"> |
27 | 41 |
28 const expectedValues = [ | 42 const expectedValues = [ |
29 // [time, element-id, property, expected-value, tolerance] | 43 // [time, element-id, property, expected-value, tolerance] |
30 [0.5, 'x', 'x', 150, 20], | 44 [0.5, 'x', 'x', 150, 20], |
31 [0.5, 'y', 'y', 150, 20], | 45 [0.5, 'y', 'y', 150, 20], |
46 [0.5, 'rx', 'rx', 150, 20], | |
47 [0.5, 'ry', 'ry', 150, 20], | |
48 [0.5, 'erx', 'rx', 150, 20], | |
49 [0.5, 'ery', 'ry', 150, 20], | |
32 ]; | 50 ]; |
33 | |
34 function setupTest() | 51 function setupTest() |
35 { | 52 { |
36 document.getElementById('x').setAttribute('class', 'init final'); | 53 » for (var i = 0; i < expectedValues.length; i++) |
fs
2015/02/26 14:20:58
Nit: Tabs vs. spaces.
Erik Dahlström (inactive)
2015/02/26 16:16:33
Done.
| |
37 document.getElementById('y').setAttribute('class', 'init final'); | 54 » » document.getElementById(expectedValues[i][1]).classList.add("fin al"); |
38 } | 55 } |
39 | 56 |
40 runTransitionTest(expectedValues, setupTest); | 57 runTransitionTest(expectedValues, setupTest); |
41 </script> | 58 </script> |
42 </head> | 59 </head> |
43 <body> | 60 <body> |
44 <svg> | 61 <svg> |
45 <rect x="100" y="100" width="100" height="100" class="init" id="x"/> | 62 <rect x="100" y="100" width="100" height="100" class="init" id="x"/> |
46 <rect x="100" y="100" width="100" height="100" class="init" id="y"/> | 63 <rect x="100" y="100" width="100" height="100" class="init" id="y"/> |
64 <rect x="100" y="100" width="100" height="100" rx="100" ry="100" class="init rx" id="rx"/> | |
65 <rect x="100" y="100" width="100" height="100" rx="100" ry="100" class="init ry" id="ry"/> | |
66 <ellipse class="init rx" rx="100" ry="100" id="erx"/> | |
67 <ellipse class="init ry" rx="100" ry="100" id="ery"/> | |
47 </svg> | 68 </svg> |
48 | 69 |
49 <div id="result"> | 70 <div id="result"> |
50 </div> | 71 </div> |
51 | 72 |
52 </body> | 73 </body> |
53 </html> | 74 </html> |
OLD | NEW |