| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 </head> | |
| 5 <body> | |
| 6 <div id="container"><span id="in-host-children" class="kotori" href="/">tehepero
</span></div> | |
| 7 <div><span id="outside-of-shadow" class="kotori" href="/">tehepero</span></div> | |
| 8 | |
| 9 <script src="../../../resources/js-test.js"></script> | |
| 10 <script> | |
| 11 function computedBackgroundColor(elem) { | |
| 12 var style = document.defaultView.getComputedStyle(elem, ''); | |
| 13 return style.backgroundColor; | |
| 14 } | |
| 15 | |
| 16 var container = document.getElementById('container'); | |
| 17 | |
| 18 var shadowRoot = container.createShadowRoot(); | |
| 19 | |
| 20 var link = document.createElement('link'); | |
| 21 link.setAttribute('rel', 'stylesheet'); | |
| 22 link.setAttribute('href', 'resources/link-in-shadow-style.css'); | |
| 23 | |
| 24 var spanInShadow = document.createElement('span'); | |
| 25 spanInShadow.innerHTML = 'tehepero'; | |
| 26 spanInShadow.className = 'kotori'; | |
| 27 | |
| 28 shadowRoot.appendChild(link); | |
| 29 shadowRoot.appendChild(spanInShadow); | |
| 30 shadowRoot.appendChild(document.createElement('content')); | |
| 31 | |
| 32 var spanInHostChildren = document.getElementById('in-host-children'); | |
| 33 var spanOutsideOfShadow = document.getElementById('outside-of-shadow'); | |
| 34 | |
| 35 shouldBe('computedBackgroundColor(spanInShadow)', '"rgba(0, 0, 0, 0)"'); | |
| 36 shouldBe('computedBackgroundColor(spanInHostChildren)', '"rgba(0, 0, 0, 0)"'); | |
| 37 shouldBe('computedBackgroundColor(spanOutsideOfShadow)', '"rgba(0, 0, 0, 0)"'); | |
| 38 | |
| 39 var successfullyParsed = true; | |
| 40 </script> | |
| 41 </body> | |
| 42 </html> | |
| OLD | NEW |