| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="resources/shadow-dom.js"></script> | |
| 5 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <style> |
| 6 .contentClass { |
| 7 color: blue; |
| 8 } |
| 9 </style> |
| 6 </head> | 10 </head> |
| 7 <body class="bodyClass"> | 11 <body class="bodyClass"> |
| 8 | 12 |
| 9 <template id="tmpl"> | 13 <template id="tmpl"> |
| 10 <style> | 14 <style> |
| 11 :host > .blue { | 15 ::content > * { |
| 12 color: blue; | |
| 13 } | |
| 14 :host content /content/ * { | |
| 15 color: red; | 16 color: red; |
| 16 } | 17 } |
| 17 </style> | 18 </style> |
| 18 <div class="blue">I am blue!</div> | |
| 19 <content></content> | 19 <content></content> |
| 20 </template> | 20 </template> |
| 21 | 21 |
| 22 <div id="host" class="hostClass"> | 22 <div id="host" class="hostClass"> |
| 23 <div class="content"> | 23 <div class="contentClass"> |
| 24 content | 24 content |
| 25 </div> | 25 </div> |
| 26 </div> | 26 </div> |
| 27 | 27 |
| 28 <pre id="console"></pre> | 28 <pre id='console'></pre> |
| 29 </body> | 29 </body> |
| 30 <script> | 30 <script> |
| 31 description("Test for crbug.com/274063, cannot style /content/ with a rule that
includes :host."); | 31 description('Test for crbug.com/274059. Should be able to override ::content sty
les in shadow root style sheet from the document.'); |
| 32 | |
| 33 var host = document.querySelector('#host'); | 32 var host = document.querySelector('#host'); |
| 34 var root = host.createShadowRoot(); | 33 var root = host.createShadowRoot(); |
| 35 var template = document.querySelector('#tmpl'); | 34 var template = document.querySelector('#tmpl'); |
| 36 root.appendChild(template.content); | 35 root.appendChild(template.content); |
| 37 | 36 shouldBe('window.getComputedStyle(document.querySelector(".contentClass")).color
', '"rgb(0, 0, 255)"'); |
| 38 shouldBe('window.getComputedStyle(document.querySelector("#host > .content")).co
lor', '"rgb(255, 0, 0)"'); | |
| 39 </script> | 37 </script> |
| 40 </html> | 38 </html> |
| OLD | NEW |