OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="resources/shadow-dom.js"></script> | 5 <script src="resources/shadow-dom.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <div id='sandbox'></div> | 8 <div id='sandbox'></div> |
9 <pre id='console'></pre> | 9 <pre id='console'></pre> |
10 </body> | 10 </body> |
11 <script> | 11 <script> |
12 description('Test for issue 247275: shadow tree styles selects shadow host.'); | 12 description('Test for issue 247275: shadow tree styles selects shadow host.'); |
13 | 13 |
14 var sandbox = document.getElementById('sandbox'); | 14 var sandbox = document.getElementById('sandbox'); |
15 | 15 |
16 function borderColorOf(selector) { | 16 function borderColorOf(selector) { |
17 return window.getComputedStyle(getNodeInTreeOfTrees(selector)).borderColor; | 17 return window.getComputedStyle(getNodeInComposedTree(selector)).borderColor; |
18 } | 18 } |
19 | 19 |
20 function shouldHaveBorderColor(selector, color) { | 20 function shouldHaveBorderColor(selector, color) { |
21 shouldBeEqualToString('borderColorOf(\'' + selector + '\')', color); | 21 shouldBeEqualToString('borderColorOf(\'' + selector + '\')', color); |
22 } | 22 } |
23 | 23 |
24 function shouldNotHaveBorderColor(selector, color) { | 24 function shouldNotHaveBorderColor(selector, color) { |
25 var text = 'borderColorOf(\'' + selector + '\')'; | 25 var text = 'borderColorOf(\'' + selector + '\')'; |
26 var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"")
+ '"'; | 26 var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"")
+ '"'; |
27 shouldNotBe(text, unevaledString); | 27 shouldNotBe(text, unevaledString); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 createDOM('content', {})), | 211 createDOM('content', {})), |
212 createDOM('div', {}))); | 212 createDOM('div', {}))); |
213 | 213 |
214 // for checking style sharing | 214 // for checking style sharing |
215 shouldHaveBorderColor('hostA', 'rgb(255, 0, 0)'); | 215 shouldHaveBorderColor('hostA', 'rgb(255, 0, 0)'); |
216 shouldHaveBorderColor('hostB', 'rgb(0, 128, 0)'); | 216 shouldHaveBorderColor('hostB', 'rgb(0, 128, 0)'); |
217 | 217 |
218 cleanUp(); | 218 cleanUp(); |
219 </script> | 219 </script> |
220 </html> | 220 </html> |
OLD | NEW |