| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <script src='../../resources/testharness.js'></script> | 3 <script src='../../resources/testharness.js'></script> |
| 4 <script src='../../resources/testharnessreport.js'></script> | 4 <script src='../../resources/testharnessreport.js'></script> |
| 5 | 5 |
| 6 <style> | 6 <style> |
| 7 #testElement { | 7 #testElement { |
| 8 border: 5px solid purple; | 8 border: 5px solid purple; |
| 9 } | 9 } |
| 10 | 10 |
| 11 #testElement:after { | 11 #testElement:after { |
| 12 border: 1px solid black; | 12 border: 1px solid black; |
| 13 } | 13 } |
| 14 </style> | 14 </style> |
| 15 | 15 |
| 16 <div id="testElement"></div> | 16 <div id="testElement"></div> |
| 17 | 17 |
| 18 <script> | 18 <script> |
| 19 | 19 |
| 20 var computedStyleMap = getComputedStyleMap(testElement); | 20 var computedStyleMap = getComputedStyleMap(testElement); |
| 21 var pseudoComputedStyleMap = getComputedStyleMap(testElement, '::after'); | 21 var pseudoComputedStyleMap = getComputedStyleMap(testElement, '::after'); |
| 22 test(function() { | 22 test(function() { |
| 23 assert_equals(computedStyleMap.get('border-top-width').cssString, '5px'); | 23 assert_equals(computedStyleMap.get('border-top-width').cssText, '5px'); |
| 24 assert_equals(pseudoComputedStyleMap.get('border-top-width').cssString, '1px')
; | 24 assert_equals(pseudoComputedStyleMap.get('border-top-width').cssText, '1px'); |
| 25 }, 'get on Computed StyleMap of pseudo element returns correct styles'); | 25 }, 'get on Computed StyleMap of pseudo element returns correct styles'); |
| 26 | 26 |
| 27 test(function() { | 27 test(function() { |
| 28 // TODO(meade): When actual multiple valued properties are supported, use one
of them. | 28 // TODO(meade): When actual multiple valued properties are supported, use one
of them. |
| 29 | 29 |
| 30 var styleValueList = pseudoComputedStyleMap.getAll('border-top-width'); | 30 var styleValueList = pseudoComputedStyleMap.getAll('border-top-width'); |
| 31 assert_equals(styleValueList.length, 1); | 31 assert_equals(styleValueList.length, 1); |
| 32 assert_equals(styleValueList[0].cssString, '1px'); | 32 assert_equals(styleValueList[0].cssText, '1px'); |
| 33 }, 'getAll on Computed StyleMap of pseudo element returns list of correct styles
'); | 33 }, 'getAll on Computed StyleMap of pseudo element returns list of correct styles
'); |
| 34 | 34 |
| 35 </script> | 35 </script> |
| OLD | NEW |