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