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 var computedStyleMap = getComputedStyleMap(testElement); | 9 var computedStyleMap = getComputedStyleMap(testElement); |
10 | 10 |
11 test(function() { | 11 test(function() { |
12 testElement.style.width = '10px'; | 12 testElement.style.width = '10px'; |
13 | 13 |
14 var result = computedStyleMap.get('width'); | 14 var result = computedStyleMap.get('width'); |
15 assert_true(result instanceof CSSSimpleLength); | 15 assert_true(result instanceof CSSSimpleLength); |
16 assert_equals(result.cssString, '10px'); | 16 assert_equals(result.cssText, '10px'); |
17 }, "Getting a 10px width results in a CSSSimpleLength"); | 17 }, "Getting a 10px width results in a CSSSimpleLength"); |
18 | 18 |
19 test(function() { | 19 test(function() { |
20 testElement.style.width = '20px'; | 20 testElement.style.width = '20px'; |
21 | 21 |
22 var result = computedStyleMap.getAll('width'); | 22 var result = computedStyleMap.getAll('width'); |
23 assert_equals(result.length, 1); | 23 assert_equals(result.length, 1); |
24 assert_equals(result[0].cssString, '20px'); | 24 assert_equals(result[0].cssText, '20px'); |
25 }, "getAll for width returns a single value"); | 25 }, "getAll for width returns a single value"); |
26 | 26 |
27 </script> | 27 </script> |
OLD | NEW |