OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style type="text/css"> |
| 5 .box { |
| 6 width: 200px; |
| 7 height: 200px; |
| 8 position: absolute; |
| 9 top: 100px; |
| 10 left: 100px; |
| 11 } |
| 12 |
| 13 .composited { |
| 14 -webkit-transform: translateZ(0); |
| 15 } |
| 16 |
| 17 .lime { |
| 18 background-color: lime; |
| 19 } |
| 20 |
| 21 .black { |
| 22 background-color: black; |
| 23 } |
| 24 |
| 25 .animating { |
| 26 -webkit-animation-duration: 1s; |
| 27 -webkit-animation-name: transformWithOpacity; |
| 28 -webkit-animation-timing-function: linear; |
| 29 } |
| 30 |
| 31 @-webkit-keyframes transformWithOpacity { |
| 32 0% { |
| 33 -webkit-transform: rotate(10deg); |
| 34 -webkit-filter: opacity(0); |
| 35 } |
| 36 100% { |
| 37 -webkit-transform: rotate(80deg); |
| 38 -webkit-filter: opacity(1); |
| 39 } |
| 40 } |
| 41 </style> |
| 42 <script src="resources/animation-test-helpers.js"></script> |
| 43 <script> |
| 44 const expectedValues = [ |
| 45 // [animation-name, time, element-id, property, expected-value, tolerance] |
| 46 ["transformWithOpacity", 0.5, "animatingBox", "webkitTransform", [0.707, 0
.707, -0.707, 0.707, 0, 0], 0.05], |
| 47 ["transformWithOpacity", 0.5, "animatingBox", "webkitFilter", 'opacity(0.
5)', 0.15], |
| 48 ]; |
| 49 |
| 50 var doPixelTest = true; |
| 51 runAnimationTest(expectedValues, null, null, null, doPixelTest); |
| 52 </script> |
| 53 </head> |
| 54 <!-- |
| 55 crbug.com/143658 |
| 56 When trying to give an animation to the compositor for acceleration, logic w
as missing to properly handle when |
| 57 one component of the animation is rejected (such as filter) while the other
was accepted (such as transform). |
| 58 |
| 59 When viewed as a web page, the lime box should be seen animating both transf
orm and |
| 60 opacity, with a stationary black box underneath. If the box doesn't animates
both rotation and filter, |
| 61 the test has failed. |
| 62 |
| 63 When viewed by DumpRenderTree, there should be one green-ish box, which is t
he lime box |
| 64 with 50% opacity, rotated by 45 degree on top of the black box. |
| 65 --> |
| 66 <body> |
| 67 <div class="composited black box"> </div> |
| 68 <div id="animatingBox" class="composited animating lime box"> </div> |
| 69 <div id="result"></div> |
| 70 </body> |
| 71 </html> |
OLD | NEW |