| 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.style = ""; | 10 testElement.style = ""; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 testElement.style = "width: 50px"; | 22 testElement.style = "width: 50px"; |
| 23 | 23 |
| 24 var iterator = testElement.styleMap.entries(); | 24 var iterator = testElement.styleMap.entries(); |
| 25 var entry = iterator.next(); | 25 var entry = iterator.next(); |
| 26 assert_false(entry.done); | 26 assert_false(entry.done); |
| 27 // Should only be one entry. | 27 // Should only be one entry. |
| 28 assert_true(iterator.next().done); | 28 assert_true(iterator.next().done); |
| 29 | 29 |
| 30 assert_equals(entry.value[0], 'width'); | 30 assert_equals(entry.value[0], 'width'); |
| 31 assert_true(entry.value[1] instanceof CSSSimpleLength); | 31 assert_true(entry.value[1] instanceof CSSSimpleLength); |
| 32 assert_equals(entry.value[1].cssString, '50px'); | 32 assert_equals(entry.value[1].cssText, '50px'); |
| 33 }, "Iterator for single entry returns iterator with a single value"); | 33 }, "Iterator for single entry returns iterator with a single value"); |
| 34 | 34 |
| 35 test(function() { | 35 test(function() { |
| 36 testElement.style = "width: 60px"; | 36 testElement.style = "width: 60px"; |
| 37 | 37 |
| 38 var iterator = testElement.styleMap.keys(); | 38 var iterator = testElement.styleMap.keys(); |
| 39 var entry = iterator.next(); | 39 var entry = iterator.next(); |
| 40 assert_false(entry.done); | 40 assert_false(entry.done); |
| 41 // Should only be one entry. | 41 // Should only be one entry. |
| 42 assert_true(iterator.next().done); | 42 assert_true(iterator.next().done); |
| 43 | 43 |
| 44 assert_equals(entry.value, 'width'); | 44 assert_equals(entry.value, 'width'); |
| 45 }, "Iterator for single key returns iterator with a single value"); | 45 }, "Iterator for single key returns iterator with a single value"); |
| 46 | 46 |
| 47 test(function() { | 47 test(function() { |
| 48 testElement.style = "width: 70px"; | 48 testElement.style = "width: 70px"; |
| 49 | 49 |
| 50 var iterator = testElement.styleMap.values(); | 50 var iterator = testElement.styleMap.values(); |
| 51 var entry = iterator.next(); | 51 var entry = iterator.next(); |
| 52 assert_false(entry.done); | 52 assert_false(entry.done); |
| 53 // Should only be one entry. | 53 // Should only be one entry. |
| 54 assert_true(iterator.next().done); | 54 assert_true(iterator.next().done); |
| 55 | 55 |
| 56 assert_true(entry.value instanceof CSSSimpleLength); | 56 assert_true(entry.value instanceof CSSSimpleLength); |
| 57 assert_equals(entry.value.cssString, '70px'); | 57 assert_equals(entry.value.cssText, '70px'); |
| 58 }, "Iterator for single value returns iterator with a single value"); | 58 }, "Iterator for single value returns iterator with a single value"); |
| 59 | 59 |
| 60 test(function() { | 60 test(function() { |
| 61 testElement.style = "border: 5px solid lightcoral"; | 61 testElement.style = "border: 5px solid lightcoral"; |
| 62 | 62 |
| 63 var entries = {}; | 63 var entries = {}; |
| 64 var numEntries = 0; | 64 var numEntries = 0; |
| 65 for (let value of testElement.styleMap.entries()) { | 65 for (let value of testElement.styleMap.entries()) { |
| 66 numEntries++; | 66 numEntries++; |
| 67 entries[value[0]] = value[1]; | 67 entries[value[0]] = value[1]; |
| 68 } | 68 } |
| 69 assert_equals(numEntries, 17); | 69 assert_equals(numEntries, 17); |
| 70 | 70 |
| 71 assert_equals(entries['border-top-width'].cssString, '5px'); | 71 assert_equals(entries['border-top-width'].cssText, '5px'); |
| 72 assert_equals(entries['border-right-width'].cssString, '5px'); | 72 assert_equals(entries['border-right-width'].cssText, '5px'); |
| 73 assert_equals(entries['border-bottom-width'].cssString, '5px'); | 73 assert_equals(entries['border-bottom-width'].cssText, '5px'); |
| 74 assert_equals(entries['border-left-width'].cssString, '5px'); | 74 assert_equals(entries['border-left-width'].cssText, '5px'); |
| 75 | 75 |
| 76 assert_equals(entries['border-top-style'].cssString, 'solid'); | 76 assert_equals(entries['border-top-style'].cssText, 'solid'); |
| 77 assert_equals(entries['border-right-style'].cssString, 'solid'); | 77 assert_equals(entries['border-right-style'].cssText, 'solid'); |
| 78 assert_equals(entries['border-bottom-style'].cssString, 'solid'); | 78 assert_equals(entries['border-bottom-style'].cssText, 'solid'); |
| 79 assert_equals(entries['border-left-style'].cssString, 'solid'); | 79 assert_equals(entries['border-left-style'].cssText, 'solid'); |
| 80 | 80 |
| 81 assert_equals(entries['border-top-color'].cssString, 'lightcoral'); | 81 assert_equals(entries['border-top-color'].cssText, 'lightcoral'); |
| 82 assert_equals(entries['border-right-color'].cssString, 'lightcoral'); | 82 assert_equals(entries['border-right-color'].cssText, 'lightcoral'); |
| 83 assert_equals(entries['border-bottom-color'].cssString, 'lightcoral'); | 83 assert_equals(entries['border-bottom-color'].cssText, 'lightcoral'); |
| 84 assert_equals(entries['border-left-color'].cssString, 'lightcoral'); | 84 assert_equals(entries['border-left-color'].cssText, 'lightcoral'); |
| 85 | 85 |
| 86 assert_equals(entries['border-image-source'].cssString, 'initial'); | 86 assert_equals(entries['border-image-source'].cssText, 'initial'); |
| 87 assert_equals(entries['border-image-slice'].cssString, 'initial'); | 87 assert_equals(entries['border-image-slice'].cssText, 'initial'); |
| 88 assert_equals(entries['border-image-width'].cssString, 'initial'); | 88 assert_equals(entries['border-image-width'].cssText, 'initial'); |
| 89 assert_equals(entries['border-image-outset'].cssString, 'initial'); | 89 assert_equals(entries['border-image-outset'].cssText, 'initial'); |
| 90 assert_equals(entries['border-image-repeat'].cssString, 'initial'); | 90 assert_equals(entries['border-image-repeat'].cssText, 'initial'); |
| 91 }, "Iterating entries over border element expansion"); | 91 }, "Iterating entries over border element expansion"); |
| 92 | 92 |
| 93 </script> | 93 </script> |
| OLD | NEW |