| OLD | NEW |
| 1 suite('transform-handler parsing', function() { | 1 suite('transform-handler parsing', function() { |
| 2 test('parse skew values', function() { | 2 test('parse skew values', function() { |
| 3 assert.deepEqual(parseTransform('skew(10deg) skew(12deg,45deg) skewX(0) skew
Y(1.5rad)'), [ | 3 assert.deepEqual(parseTransform('skew(10deg) skew(12deg,45deg) skewX(0) skew
Y(1.5rad)'), [ |
| 4 {t: 'skew', d: [{deg: 10}, {deg: 0}]}, | 4 {t: 'skew', d: [{deg: 10}, {deg: 0}]}, |
| 5 {t: 'skew', d: [{deg: 12}, {deg: 45}]}, | 5 {t: 'skew', d: [{deg: 12}, {deg: 45}]}, |
| 6 {t: 'skewx', d: [{deg: 0}]}, | 6 {t: 'skewx', d: [{deg: 0}]}, |
| 7 {t: 'skewy', d: [{rad: 1.5}]} | 7 {t: 'skewy', d: [{rad: 1.5}]} |
| 8 ]); | 8 ]); |
| 9 }); | 9 }); |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 assert.isUndefined(parseTransform('rotate(5)')); | 65 assert.isUndefined(parseTransform('rotate(5)')); |
| 66 assert.isUndefined(parseTransform('skew(5)')); | 66 assert.isUndefined(parseTransform('skew(5)')); |
| 67 assert.isUndefined(parseTransform('scale(5px)')); | 67 assert.isUndefined(parseTransform('scale(5px)')); |
| 68 assert.isUndefined(parseTransform('rotatex(5px)')); | 68 assert.isUndefined(parseTransform('rotatex(5px)')); |
| 69 }); | 69 }); |
| 70 }); | 70 }); |
| 71 | 71 |
| 72 suite('transform-handler interpolation', function() { | 72 suite('transform-handler interpolation', function() { |
| 73 test('simple transform interpolations', function() { | 73 test('simple transform interpolations', function() { |
| 74 assert.equal( | 74 assert.equal( |
| 75 webAnimationsMinifill.propertyInterpolation( | 75 webAnimations1.propertyInterpolation( |
| 76 'transform', | 76 'transform', |
| 77 'translateX(10px)', | 77 'translateX(10px)', |
| 78 'translateX(20px)')(0.2), | 78 'translateX(20px)')(0.2), |
| 79 'translatex(12px)'); | 79 'translatex(12px)'); |
| 80 assert.equal( | 80 assert.equal( |
| 81 webAnimationsMinifill.propertyInterpolation( | 81 webAnimations1.propertyInterpolation( |
| 82 'transform', | 82 'transform', |
| 83 'translate(10px, 10px) rotate(20deg)', | 83 'translate(10px, 10px) rotate(20deg)', |
| 84 'translate(20px, 20px) rotate(90deg)')(0.2), | 84 'translate(20px, 20px) rotate(90deg)')(0.2), |
| 85 'translate(12px,12px) rotate(34deg)'); | 85 'translate(12px,12px) rotate(34deg)'); |
| 86 assert.equal( | 86 assert.equal( |
| 87 webAnimationsMinifill.propertyInterpolation( | 87 webAnimations1.propertyInterpolation( |
| 88 'transform', | 88 'transform', |
| 89 'translate(10px, 10em) rotate(20deg)', | 89 'translate(10px, 10em) rotate(20deg)', |
| 90 'translate(20em, 20px) rotate(90deg)')(0.5), | 90 'translate(20em, 20px) rotate(90deg)')(0.5), |
| 91 'translate(calc(5px + 10em),calc(5em + 10px)) rotate(55deg)'); | 91 'translate(calc(5px + 10em),calc(5em + 10px)) rotate(55deg)'); |
| 92 assert.equal( | 92 assert.equal( |
| 93 webAnimationsMinifill.propertyInterpolation( | 93 webAnimations1.propertyInterpolation( |
| 94 'transform', | 94 'transform', |
| 95 'rotateY(1000deg)', | 95 'rotateY(1000deg)', |
| 96 'rotateY(3000deg)')(0.4), | 96 'rotateY(3000deg)')(0.4), |
| 97 'rotatey(1800deg)'); | 97 'rotatey(1800deg)'); |
| 98 assert.equal( | 98 assert.equal( |
| 99 webAnimationsMinifill.propertyInterpolation( | 99 webAnimations1.propertyInterpolation( |
| 100 'transform', | 100 'transform', |
| 101 'scale(6)', | 101 'scale(6)', |
| 102 'scale(1,-4)')(0.2), | 102 'scale(1,-4)')(0.2), |
| 103 'scale(5,4)'); | 103 'scale(5,4)'); |
| 104 assert.equal( | 104 assert.equal( |
| 105 webAnimationsMinifill.propertyInterpolation( | 105 webAnimations1.propertyInterpolation( |
| 106 'transform', | 106 'transform', |
| 107 'skewX(5deg) translateY(5px)', | 107 'skewX(5deg) translateY(5px)', |
| 108 'skewX(-35deg) translateY(45px)')(0.25), | 108 'skewX(-35deg) translateY(45px)')(0.25), |
| 109 'skewx(-5deg) translatey(15px)'); | 109 'skewx(-5deg) translatey(15px)'); |
| 110 }); | 110 }); |
| 111 | 111 |
| 112 test('transform interpolations with conversion to primitives', function() { | 112 test('transform interpolations with conversion to primitives', function() { |
| 113 assert.equal( | 113 assert.equal( |
| 114 webAnimationsMinifill.propertyInterpolation( | 114 webAnimations1.propertyInterpolation( |
| 115 'transform', | 115 'transform', |
| 116 'translateX(10px)', | 116 'translateX(10px)', |
| 117 'translate(20px, 10px)')(0.2), | 117 'translate(20px, 10px)')(0.2), |
| 118 'translate(12px,2px)'); | 118 'translate(12px,2px)'); |
| 119 assert.equal( | 119 assert.equal( |
| 120 webAnimationsMinifill.propertyInterpolation( | 120 webAnimations1.propertyInterpolation( |
| 121 'transform', | 121 'transform', |
| 122 'translateX(10px)', | 122 'translateX(10px)', |
| 123 'translateY(10px)')(0.2), | 123 'translateY(10px)')(0.2), |
| 124 'translate(8px,2px)'); | 124 'translate(8px,2px)'); |
| 125 assert.equal( | 125 assert.equal( |
| 126 webAnimationsMinifill.propertyInterpolation( | 126 webAnimations1.propertyInterpolation( |
| 127 'transform', | 127 'transform', |
| 128 'translateX(10px)', | 128 'translateX(10px)', |
| 129 'translateZ(10px)')(0.2), | 129 'translateZ(10px)')(0.2), |
| 130 'translate3d(8px,0px,2px)'); | 130 'translate3d(8px,0px,2px)'); |
| 131 assert.equal( | 131 assert.equal( |
| 132 webAnimationsMinifill.propertyInterpolation( | 132 webAnimations1.propertyInterpolation( |
| 133 'transform', | 133 'transform', |
| 134 'scaleX(6)', | 134 'scaleX(6)', |
| 135 'scale(1,6)')(0.2), | 135 'scale(1,6)')(0.2), |
| 136 'scale(5,2)'); | 136 'scale(5,2)'); |
| 137 assert.equal( | 137 assert.equal( |
| 138 webAnimationsMinifill.propertyInterpolation( | 138 webAnimations1.propertyInterpolation( |
| 139 'transform', | 139 'transform', |
| 140 'skew(10deg)', | 140 'skew(10deg)', |
| 141 'skewY(30deg)')(0.2), | 141 'skewY(30deg)')(0.2), |
| 142 'skew(8deg,6deg)'); | 142 'skew(8deg,6deg)'); |
| 143 }); | 143 }); |
| 144 | 144 |
| 145 test('transform interpolations with none', function() { | 145 test('transform interpolations with none', function() { |
| 146 assert.equal( | 146 assert.equal( |
| 147 webAnimationsMinifill.propertyInterpolation( | 147 webAnimations1.propertyInterpolation( |
| 148 'transform', | 148 'transform', |
| 149 'none', | 149 'none', |
| 150 'scale(5) translateX(100px) rotate(1000deg)')(0.25), | 150 'scale(5) translateX(100px) rotate(1000deg)')(0.25), |
| 151 'scale(2,2) translatex(25px) rotate(250deg)'); | 151 'scale(2,2) translatex(25px) rotate(250deg)'); |
| 152 assert.equal( | 152 assert.equal( |
| 153 webAnimationsMinifill.propertyInterpolation( | 153 webAnimations1.propertyInterpolation( |
| 154 'transform', | 154 'transform', |
| 155 'scale(5) translateX(100px) rotate(1000deg)', | 155 'scale(5) translateX(100px) rotate(1000deg)', |
| 156 'none')(0.75), | 156 'none')(0.75), |
| 157 'scale(2,2) translatex(25px) rotate(250deg)'); | 157 'scale(2,2) translatex(25px) rotate(250deg)'); |
| 158 assert.equal( | 158 assert.equal( |
| 159 webAnimationsMinifill.propertyInterpolation( | 159 webAnimations1.propertyInterpolation( |
| 160 'transform', | 160 'transform', |
| 161 'none', | 161 'none', |
| 162 'scaleX(5) skewY(100grad)')(0.25), | 162 'scaleX(5) skewY(100grad)')(0.25), |
| 163 'scalex(2) skewy(25grad)'); | 163 'scalex(2) skewy(25grad)'); |
| 164 assert.equal( | 164 assert.equal( |
| 165 webAnimationsMinifill.propertyInterpolation( | 165 webAnimations1.propertyInterpolation( |
| 166 'transform', | 166 'transform', |
| 167 'none', | 167 'none', |
| 168 'none')(0.4), | 168 'none')(0.4), |
| 169 'none'); | 169 'none'); |
| 170 }); | 170 }); |
| 171 }); | 171 }); |
| OLD | NEW |