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 <div id="testElement"></div> | 4 <div id="testElement"></div> |
5 <script> | 5 <script> |
6 var EPSILON = 1e-6; // float epsilon | 6 var EPSILON = 1e-6; // float epsilon |
7 var supportedUnits = [ | 7 var supportedUnits = [ |
8 'px', | 8 'px', |
9 'em', | 9 'em', |
10 'ex', | 10 'ex', |
(...skipping 25 matching lines...) Expand all Loading... |
36 assert_equals(components.length, 1); | 36 assert_equals(components.length, 1); |
37 assert_equals(components[0].constructor.name, CSSPerspective.name); | 37 assert_equals(components[0].constructor.name, CSSPerspective.name); |
38 assert_equals(components[0].toString(), cssText); | 38 assert_equals(components[0].toString(), cssText); |
39 } | 39 } |
40 }, "Perspective read from a StyleMap is correct"); | 40 }, "Perspective read from a StyleMap is correct"); |
41 | 41 |
42 test(function() { | 42 test(function() { |
43 for (var i = 0; i < supportedUnits.length; i++) { | 43 for (var i = 0; i < supportedUnits.length; i++) { |
44 var unit = supportedUnits[i]; | 44 var unit = supportedUnits[i]; |
45 var perspective = new CSSTransformValue([ | 45 var perspective = new CSSTransformValue([ |
46 new CSSPerspective(new CSSSimpleLength(i, unit))]); | 46 new CSSPerspective(new CSSUnitValue(i, unit))]); |
47 testElement.styleMap.set('transform', perspective); | 47 testElement.styleMap.set('transform', perspective); |
48 | 48 |
49 var cssText = 'perspective(' + i + unit + ')'; | 49 var cssText = 'perspective(' + i + unit + ')'; |
50 assert_equals(testElement.style.transform, cssText); | 50 assert_equals(testElement.style.transform, cssText); |
51 } | 51 } |
52 }, "Set Perspective into the inline StylePropertyMap"); | 52 }, "Set Perspective into the inline StylePropertyMap"); |
53 | 53 |
54 </script> | 54 </script> |
OLD | NEW |