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 | 4 |
5 <div id="testElement"></div> | 5 <div id="testElement"></div> |
6 | 6 |
7 <script> | 7 <script> |
8 | 8 |
9 test(function() { | 9 test(function() { |
10 testElement.styleMap.set('width', new CSSSimpleLength(10, 'px')); | 10 testElement.styleMap.set('width', new CSSSimpleLength(10, 'px')); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 }, "Getting a property that doesn't exist throws"); | 62 }, "Getting a property that doesn't exist throws"); |
63 | 63 |
64 test(function() { | 64 test(function() { |
65 assert_throws(new TypeError(), function() { | 65 assert_throws(new TypeError(), function() { |
66 testElement.styleMap.set('width', null); | 66 testElement.styleMap.set('width', null); |
67 }); | 67 }); |
68 // Force a style recalc. | 68 // Force a style recalc. |
69 getComputedStyle(testElement).width; | 69 getComputedStyle(testElement).width; |
70 }, "Setting null to a property does not crash"); | 70 }, "Setting null to a property does not crash"); |
71 | 71 |
| 72 test(function() { |
| 73 var values = [new CSSNumberValue(3), new CSSKeywordValue("infinite")]; |
| 74 testElement.styleMap.set('animation-iteration-count', values); |
| 75 |
| 76 var result = testElement.styleMap.getAll('animation-iteration-count'); |
| 77 assert_equals(result.length, 2); |
| 78 assert_true(result[0] instanceof CSSNumberValue); |
| 79 assert_true(result[1] instanceof CSSKeywordValue); |
| 80 assert_equals(result[0].value, 3); |
| 81 assert_equals(result[1].value, "infinite"); |
| 82 |
| 83 assert_equals(testElement.style.animationIterationCount, "3, infinite"); |
| 84 }, "Setting a property with mixed types works if the types are all valid"); |
72 | 85 |
73 </script> | 86 </script> |
OLD | NEW |