| 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">text</div> | 5 <div id="testElement"></div> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 var gettingProperties = [ | 9 var gettingProperties = [ |
| 10 'animation-iteration-count', | 10 'animation-iteration-count', |
| 11 'column-count', | 11 'column-count', |
| 12 'line-height', | 12 'line-height', |
| 13 'opacity', | 13 'opacity', |
| 14 'orphans', | 14 'orphans', |
| 15 'widows', | 15 'widows', |
| 16 'z-index' | 16 'z-index' |
| 17 ]; | 17 ]; |
| 18 | 18 |
| 19 test(function() { | 19 test(function() { |
| 20 for (var i = 0; i < gettingProperties.length; i++) { | 20 for (var i = 0; i < gettingProperties.length; i++) { |
| 21 var value = 10 * (i + 1); | 21 var value = 10 * (i + 1); |
| 22 testElement.style[gettingProperties[i]] = "" + value; | 22 testElement.style[gettingProperties[i]] = "" + value; |
| 23 var result = testElement.styleMap.get(gettingProperties[i]); | 23 var result = testElement.styleMap.get(gettingProperties[i]); |
| 24 assert_equals(result.constructor.name, CSSNumberValue.name, | 24 assert_equals(result.constructor.name, CSSUnitValue.name, |
| 25 "result from " + gettingProperties[i].name); | 25 "result from " + gettingProperties[i].name); |
| 26 assert_equals(result.value, value); | 26 assert_equals(result.value, value); |
| 27 } | 27 } |
| 28 }, "Single valued CSSNumberValues can be retrieved from Inline StyleMap"); | 28 }, "Single valued CSSUnitValues can be retrieved from Inline StyleMap"); |
| 29 | 29 |
| 30 test(function() { | 30 test(function() { |
| 31 testElement.style.animationIterationCount = "6.2, 9.8, 1"; | 31 testElement.style.animationIterationCount = "6.2, 9.8, 1"; |
| 32 | 32 |
| 33 var result = testElement.styleMap.getAll('animation-iteration-count'); | 33 var result = testElement.styleMap.getAll('animation-iteration-count'); |
| 34 assert_equals(result.length, 3); | 34 assert_equals(result.length, 3); |
| 35 assert_equals(result[0].constructor.name, CSSNumberValue.name); | 35 assert_equals(result[0].constructor.name, CSSUnitValue.name); |
| 36 assert_equals(result[1].constructor.name, CSSNumberValue.name); | 36 assert_equals(result[1].constructor.name, CSSUnitValue.name); |
| 37 assert_equals(result[2].constructor.name, CSSNumberValue.name); | 37 assert_equals(result[2].constructor.name, CSSUnitValue.name); |
| 38 assert_equals(result[0].value, 6.2); | 38 assert_equals(result[0].value, 6.2); |
| 39 assert_equals(result[1].value, 9.8); | 39 assert_equals(result[1].value, 9.8); |
| 40 assert_equals(result[2].value, 1); | 40 assert_equals(result[2].value, 1); |
| 41 }, "Can retrieve list of CSSNumberValues from list-valued property"); | 41 }, "Can retrieve list of CSSUnitValues from list-valued property"); |
| 42 | 42 |
| 43 </script> | 43 </script> |
| OLD | NEW |