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> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 document.createTextNode('* { border: 1px solid green; }')), | 56 document.createTextNode('* { border: 1px solid green; }')), |
57 createDOM('content', {})), | 57 createDOM('content', {})), |
58 createDOM('div', {'id': 'host-child'}, | 58 createDOM('div', {'id': 'host-child'}, |
59 document.createTextNode('Hello, Host!')))); | 59 document.createTextNode('Hello, Host!')))); |
60 | 60 |
61 shouldNotHaveBorderColor('host', 'rgb(0, 128, 0)'); | 61 shouldNotHaveBorderColor('host', 'rgb(0, 128, 0)'); |
62 shouldHaveBorderColor('host-child', 'rgb(0, 0, 0)'); | 62 shouldHaveBorderColor('host-child', 'rgb(0, 0, 0)'); |
63 | 63 |
64 cleanUp(); | 64 cleanUp(); |
65 | 65 |
66 debug('Test that :not(*) in a shadow tree can match without :host.'); | 66 debug('Test that :not(*) in a shadow tree cannot match without :host.'); |
67 | 67 |
68 sandbox.appendChild( | 68 sandbox.appendChild( |
69 createDOM('div', {'id': 'host'}, | 69 createDOM('div', {'id': 'host'}, |
70 createShadowRoot( | 70 createShadowRoot( |
71 createDOM('style', {}, | 71 createDOM('style', {}, |
72 document.createTextNode(':not(*) { border: 1px solid green; }'))
, | 72 document.createTextNode(':not(*) { border: 1px solid green; }'))
, |
73 createDOM('content', {})), | 73 createDOM('content', {})), |
74 createDOM('div', {'id': 'host-child'}, | 74 createDOM('div', {'id': 'host-child'}, |
75 document.createTextNode('Hello, Host!')))); | 75 document.createTextNode('Hello, Host!')))); |
76 | 76 |
77 shouldHaveBorderColor('host', 'rgb(0, 128, 0)'); | 77 shouldHaveBorderColor('host', 'rgb(0, 0, 0)'); |
78 shouldHaveBorderColor('host-child', 'rgb(0, 0, 0)'); | 78 shouldHaveBorderColor('host-child', 'rgb(0, 0, 0)'); |
79 | 79 |
80 cleanUp(); | 80 cleanUp(); |
81 | 81 |
| 82 debug('Test that :first-child in a shadow tree cannot match without :host.'); |
| 83 |
| 84 sandbox.appendChild( |
| 85 createDOM('div', {'id': 'host'}, |
| 86 createShadowRoot( |
| 87 createDOM('style', {}, |
| 88 document.createTextNode(':first-child { border: 1px solid green;
}')), |
| 89 createDOM('content', {})), |
| 90 createDOM('div', {'id': 'host-child'}, |
| 91 document.createTextNode('Hello, Host!')))); |
| 92 |
| 93 shouldHaveBorderColor('host', 'rgb(0, 0, 0)'); |
| 94 |
| 95 cleanUp(); |
| 96 |
82 debug('Test that styles in a containing treescope wins if specificities are the
same.'); | 97 debug('Test that styles in a containing treescope wins if specificities are the
same.'); |
83 | 98 |
84 sandbox.appendChild( | 99 sandbox.appendChild( |
85 createDOM('style', {}, | 100 createDOM('style', {}, |
86 document.createTextNode(':last-child { border: 1px solid green; }'))); | 101 document.createTextNode(':last-child { border: 1px solid green; }'))); |
87 sandbox.appendChild( | 102 sandbox.appendChild( |
88 createDOM('div', {'id': 'host'}, | 103 createDOM('div', {'id': 'host'}, |
89 createShadowRoot( | 104 createShadowRoot( |
90 createDOM('style', {}, | 105 createDOM('style', {}, |
91 document.createTextNode(':host { border: 1px solid red; }')), | 106 document.createTextNode(':host { border: 1px solid red; }')), |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 createDOM('content', {})), | 233 createDOM('content', {})), |
219 createDOM('div', {}))); | 234 createDOM('div', {}))); |
220 | 235 |
221 // for checking style sharing | 236 // for checking style sharing |
222 shouldHaveBorderColor('hostA', 'rgb(255, 0, 0)'); | 237 shouldHaveBorderColor('hostA', 'rgb(255, 0, 0)'); |
223 shouldHaveBorderColor('hostB', 'rgb(0, 128, 0)'); | 238 shouldHaveBorderColor('hostB', 'rgb(0, 128, 0)'); |
224 | 239 |
225 cleanUp(); | 240 cleanUp(); |
226 </script> | 241 </script> |
227 </html> | 242 </html> |
OLD | NEW |