OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src='../../../resources/testharness.js'></script> | 2 <script src='../../../resources/testharness.js'></script> |
3 <script src='../../../resources/testharnessreport.js'></script> | 3 <script src='../../../resources/testharnessreport.js'></script> |
4 <script src='property-suite.js'></script> | 4 <script src='property-suite.js'></script> |
5 | 5 |
6 <div id="testElement"></div> | 6 <div id="testElement"></div> |
7 | 7 |
8 <script> | 8 <script> |
9 | 9 |
10 let zeroAngle = new CSSAngleValue(0, 'deg'); | 10 let zeroAngle = new CSSUnitValue(0, 'deg'); |
11 | 11 |
12 function angleValue(value, unit) { | 12 function angleValue(value, unit) { |
13 return new CSSAngleValue(value, unit); | 13 return new CSSUnitValue(value, unit); |
14 } | 14 } |
15 | 15 |
16 function cssTransformWithRotate(angleValue) { | 16 function cssTransformWithRotate(angleValue) { |
17 return new CSSTransformValue([ | 17 return new CSSTransformValue([ |
18 new CSSRotation(angleValue)]); | 18 new CSSRotation(angleValue)]); |
19 } | 19 } |
20 | 20 |
21 function cssTransformWithRotate3D(x, y, z, angleValue) { | 21 function cssTransformWithRotate3D(x, y, z, angleValue) { |
22 return new CSSTransformValue([ | 22 return new CSSTransformValue([ |
23 new CSSRotation(x, y, z, angleValue)]); | 23 new CSSRotation(x, y, z, angleValue)]); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 'rotateY(0.31turn)': | 96 'rotateY(0.31turn)': |
97 cssTransformWithRotate3D(0, 1, 0, angleValue(0.31, 'turn')), | 97 cssTransformWithRotate3D(0, 1, 0, angleValue(0.31, 'turn')), |
98 'rotateZ(45deg)': cssTransformWithRotate3D(0, 0, 1, angleValue(45, 'deg')), | 98 'rotateZ(45deg)': cssTransformWithRotate3D(0, 0, 1, angleValue(45, 'deg')), |
99 'rotateZ(1rad)': cssTransformWithRotate3D(0, 0, 1, angleValue(1, 'rad')), | 99 'rotateZ(1rad)': cssTransformWithRotate3D(0, 0, 1, angleValue(1, 'rad')), |
100 'rotateZ(6.2grad)': | 100 'rotateZ(6.2grad)': |
101 cssTransformWithRotate3D(0, 0, 1, angleValue(6.2, 'grad')), | 101 cssTransformWithRotate3D(0, 0, 1, angleValue(6.2, 'grad')), |
102 'rotateZ(0.31turn)': | 102 'rotateZ(0.31turn)': |
103 cssTransformWithRotate3D(0, 0, 1, angleValue(0.31, 'turn')), | 103 cssTransformWithRotate3D(0, 0, 1, angleValue(0.31, 'turn')), |
104 }, | 104 }, |
105 supportsMultiple: false, | 105 supportsMultiple: false, |
106 invalidObjects: [new CSSSimpleLength(4, 'px')] | 106 invalidObjects: [new CSSUnitValue(4, 'px')] |
107 }); | 107 }); |
108 | 108 |
109 // TODO(meade): Remove/update this test once translate is supported. | 109 // TODO(meade): Remove/update this test once translate is supported. |
110 test(function() { | 110 test(function() { |
111 testElement.style.transform = 'translateY(50px)'; | 111 testElement.style.transform = 'translateY(50px)'; |
112 testElement.styleMap.entries(); | 112 testElement.styleMap.entries(); |
113 }, "Unhandled case doesn't crash."); | 113 }, "Unhandled case doesn't crash."); |
114 | 114 |
115 test(function() { | 115 test(function() { |
116 testElement.style.transform = 'rotate(calc(45deg + 1rad))'; | 116 testElement.style.transform = 'rotate(calc(45deg + 1rad))'; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 }, 'Getting transform when it has a skewX with a calc angle does not crash'); | 156 }, 'Getting transform when it has a skewX with a calc angle does not crash'); |
157 | 157 |
158 test(function() { | 158 test(function() { |
159 testElement.style.transform = 'skewY(calc(5deg + 0.1rad))'; | 159 testElement.style.transform = 'skewY(calc(5deg + 0.1rad))'; |
160 let result = testElement.styleMap.get('transform'); | 160 let result = testElement.styleMap.get('transform'); |
161 assert_equals(result.cssText, 'skewY(calc(10.7296deg))'); | 161 assert_equals(result.cssText, 'skewY(calc(10.7296deg))'); |
162 assert_equals(result.constructor, CSSStyleValue); | 162 assert_equals(result.constructor, CSSStyleValue); |
163 }, 'Getting transform when it has a skewY with a calc angle does not crash'); | 163 }, 'Getting transform when it has a skewY with a calc angle does not crash'); |
164 | 164 |
165 </script> | 165 </script> |
OLD | NEW |