| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
| 3 <style> | 3 <style> |
| 4 .parent { |
| 5 transform: translate(30px); |
| 6 } |
| 4 .target { | 7 .target { |
| 5 color: white; | 8 color: white; |
| 6 width: 100px; | 9 width: 100px; |
| 7 height: 100px; | 10 height: 100px; |
| 8 background-color: black; | 11 background-color: black; |
| 9 display: inline-block; | 12 display: inline-block; |
| 10 overflow: hidden; | 13 overflow: hidden; |
| 14 transform: translate(10px); |
| 11 } | 15 } |
| 12 .expected { | 16 .expected { |
| 13 background-color: green; | 17 background-color: green; |
| 14 } | 18 } |
| 15 .target div { | 19 .parent { |
| 20 transform: 30px; |
| 21 } |
| 22 .target > div { |
| 16 width: 10px; | 23 width: 10px; |
| 17 height: 10px; | 24 height: 10px; |
| 18 display: inline-block; | 25 display: inline-block; |
| 19 background: orange; | 26 background: orange; |
| 20 margin: 1px; | 27 margin: 1px; |
| 21 } | 28 } |
| 22 .test { | 29 .test { |
| 23 overflow: hidden; | 30 overflow: hidden; |
| 24 } | 31 } |
| 25 </style> | 32 </style> |
| 26 <body> | 33 <body> |
| 27 <template id="target-template"> | 34 <template id="target-template"> |
| 28 <div></div> | 35 <div></div> |
| 29 </template> | 36 </template> |
| 30 <script src="resources/interpolation-test.js"></script> | 37 <script src="resources/interpolation-test.js"></script> |
| 31 <script> | 38 <script> |
| 39 assertInterpolation({ |
| 40 property: 'transform', |
| 41 from: '', |
| 42 to: 'translate(20px)', |
| 43 }, [ |
| 44 {at: -1, is: 'translate(0px)'}, |
| 45 {at: 0, is: 'translate(10px)'}, |
| 46 {at: 0.25, is: 'translate(12.5px)'}, |
| 47 {at: 0.75, is: 'translate(17.5px)'}, |
| 48 {at: 1, is: 'translate(20px)'}, |
| 49 {at: 2, is: 'translate(30px)'}, |
| 50 ]); |
| 51 |
| 52 assertInterpolation({ |
| 53 property: 'transform', |
| 54 from: 'initial', |
| 55 to: 'translate(20px)', |
| 56 }, [ |
| 57 {at: -1, is: 'translate(-20px)'}, |
| 58 {at: 0, is: 'translate(0px)'}, |
| 59 {at: 0.25, is: 'translate(5px)'}, |
| 60 {at: 0.75, is: 'translate(15px)'}, |
| 61 {at: 1, is: 'translate(20px)'}, |
| 62 {at: 2, is: 'translate(40px)'}, |
| 63 ]); |
| 64 |
| 65 assertInterpolation({ |
| 66 property: 'transform', |
| 67 from: 'inherit', |
| 68 to: 'translate(20px)', |
| 69 }, [ |
| 70 {at: -1, is: 'translate(40px)'}, |
| 71 {at: 0, is: 'translate(30px)'}, |
| 72 {at: 0.25, is: 'translate(27.5px)'}, |
| 73 {at: 0.75, is: 'translate(22.5px)'}, |
| 74 {at: 1, is: 'translate(20px)'}, |
| 75 {at: 2, is: 'translate(10px)'}, |
| 76 ]); |
| 77 |
| 78 assertInterpolation({ |
| 79 property: 'transform', |
| 80 from: 'unset', |
| 81 to: 'translate(20px)', |
| 82 }, [ |
| 83 {at: -1, is: 'translate(-20px)'}, |
| 84 {at: 0, is: 'translate(0px)'}, |
| 85 {at: 0.25, is: 'translate(5px)'}, |
| 86 {at: 0.75, is: 'translate(15px)'}, |
| 87 {at: 1, is: 'translate(20px)'}, |
| 88 {at: 2, is: 'translate(40px)'}, |
| 89 ]); |
| 32 | 90 |
| 33 // Perspective | 91 // Perspective |
| 34 assertInterpolation({ | 92 assertInterpolation({ |
| 35 property: 'transform', | 93 property: 'transform', |
| 36 from: 'perspective(400px)', | 94 from: 'perspective(400px)', |
| 37 to: 'perspective(500px)' | 95 to: 'perspective(500px)' |
| 38 }, [ | 96 }, [ |
| 39 {at: -1, is: 'perspective(300px)'}, | 97 {at: -1, is: 'perspective(300px)'}, |
| 40 {at: 0, is: 'perspective(400px)'}, | 98 {at: 0, is: 'perspective(400px)'}, |
| 41 {at: 0.25, is: 'perspective(425px)'}, | 99 {at: 0.25, is: 'perspective(425px)'}, |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 }, [ | 708 }, [ |
| 651 {at: -1, is: 'rotate(-360deg)'}, | 709 {at: -1, is: 'rotate(-360deg)'}, |
| 652 {at: 0, is: 'rotate(0deg)'}, | 710 {at: 0, is: 'rotate(0deg)'}, |
| 653 {at: 0.25, is: 'rotate(90deg)'}, | 711 {at: 0.25, is: 'rotate(90deg)'}, |
| 654 {at: 0.75, is: 'rotate(270deg)'}, | 712 {at: 0.75, is: 'rotate(270deg)'}, |
| 655 {at: 1, is: 'rotate(360deg)'}, | 713 {at: 1, is: 'rotate(360deg)'}, |
| 656 {at: 2, is: 'rotate(720deg)'}, | 714 {at: 2, is: 'rotate(720deg)'}, |
| 657 ]); | 715 ]); |
| 658 </script> | 716 </script> |
| 659 </body> | 717 </body> |
| OLD | NEW |