OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/shadow-dom.js"></script> | 4 <script src="resources/shadow-dom.js"></script> |
5 <script src="../../../resources/js-test.js"></script> | 5 <script src="../../../resources/js-test.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <div id="sandbox"></div> | 8 <div id="sandbox"></div> |
9 </body> | 9 </body> |
10 <script> | 10 <script> |
11 var borderColor; | 11 var borderColor; |
12 | 12 |
13 function borderColorOf(node) | 13 function borderColorOf(node) |
14 { | 14 { |
15 return document.defaultView.getComputedStyle(node, null).getPropertyValue('b
order-color'); | 15 return document.defaultView.getComputedStyle(node, null).getPropertyValue('b
order-color'); |
16 } | 16 } |
17 | 17 |
18 function borderColorShouldBe(selector, color) | 18 function borderColorShouldBe(selector, color) |
19 { | 19 { |
20 var text = 'borderColorOf(getNodeInTreeOfTrees("' + selector + '"))'; | 20 var text = 'borderColorOf(getNodeInComposedTree("' + selector + '"))'; |
21 shouldBeEqualToString(text, color); | 21 shouldBeEqualToString(text, color); |
22 } | 22 } |
23 | 23 |
24 function cleanUp() | 24 function cleanUp() |
25 { | 25 { |
26 document.getElementById('sandbox').innerHTML = ''; | 26 document.getElementById('sandbox').innerHTML = ''; |
27 } | 27 } |
28 | 28 |
29 description('Test that :host(selector) can match a shadow host when the host mat
ches the selector: http://crbug.com/313935.'); | 29 description('Test that :host(selector) can match a shadow host when the host mat
ches the selector: http://crbug.com/313935.'); |
30 | 30 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 document.createTextNode(':host(span.foo#host:host) { border: 1px
solid green; }')), | 110 document.createTextNode(':host(span.foo#host:host) { border: 1px
solid green; }')), |
111 createDOM('div', {})))); | 111 createDOM('div', {})))); |
112 | 112 |
113 borderColorShouldBe('host', 'rgb(0, 128, 0)'); | 113 borderColorShouldBe('host', 'rgb(0, 128, 0)'); |
114 | 114 |
115 cleanUp(); | 115 cleanUp(); |
116 | 116 |
117 | 117 |
118 </script> | 118 </script> |
119 </html> | 119 </html> |
OLD | NEW |