| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="resources/shadow-dom.js"></script> | 2 <script src="resources/shadow-dom.js"></script> |
| 3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
| 4 <body> | 4 <body> |
| 5 <div id='sandbox'></div> | 5 <div id='sandbox'></div> |
| 6 </body> | 6 </body> |
| 7 <script> | 7 <script> |
| 8 function colorOf(node) | 8 function colorOf(node) |
| 9 { | 9 { |
| 10 return document.defaultView.getComputedStyle(node, null).getPropertyValue('c
olor'); | 10 return document.defaultView.getComputedStyle(node, null).getPropertyValue('c
olor'); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function colorShouldBe(selector, color) | 13 function colorShouldBe(selector, color) |
| 14 { | 14 { |
| 15 var text = 'colorOf(getNodeInTreeOfTrees("' + selector + '"))'; | 15 var text = 'colorOf(getNodeInComposedTree("' + selector + '"))'; |
| 16 shouldBeEqualToString(text, color); | 16 shouldBeEqualToString(text, color); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function colorShouldNotBe(selector, color) | 19 function colorShouldNotBe(selector, color) |
| 20 { | 20 { |
| 21 var text = 'colorOf(getNodeInTreeOfTrees("' + selector + '"))'; | 21 var text = 'colorOf(getNodeInComposedTree("' + selector + '"))'; |
| 22 var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"")
+ '"'; | 22 var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"")
+ '"'; |
| 23 shouldNotBe(text, unevaledString); | 23 shouldNotBe(text, unevaledString); |
| 24 } | 24 } |
| 25 | 25 |
| 26 function cleanUp() | 26 function cleanUp() |
| 27 { | 27 { |
| 28 document.getElementById('sandbox').innerHTML = ''; | 28 document.getElementById('sandbox').innerHTML = ''; |
| 29 } | 29 } |
| 30 | 30 |
| 31 description('Test for ::shadow pseudo element, http://crbug.com/367266.'); | 31 description('Test for ::shadow pseudo element, http://crbug.com/367266.'); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 colorShouldBe('host/direct-child', 'rgb(0, 128, 0)'); | 107 colorShouldBe('host/direct-child', 'rgb(0, 128, 0)'); |
| 108 colorShouldNotBe('host/not-direct-child', 'rgb(0, 128, 0)'); | 108 colorShouldNotBe('host/not-direct-child', 'rgb(0, 128, 0)'); |
| 109 colorShouldNotBe('host-child', 'rgb(0, 128, 0)'); | 109 colorShouldNotBe('host-child', 'rgb(0, 128, 0)'); |
| 110 | 110 |
| 111 cleanUp(); | 111 cleanUp(); |
| 112 | 112 |
| 113 </script> | 113 </script> |
| 114 | 114 |
| 115 | 115 |
| OLD | NEW |