| 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> | 5 <script> |
| 6 description("Test for https://bugs.webkit.org/show_bug.cgi?id=92899. Dynamically
styling ShadowDom content on a node distributed to another shadow insertion poi
nt fails."); | 6 description("Test for https://bugs.webkit.org/show_bug.cgi?id=92899. Dynamically
styling ShadowDom content on a node distributed to another shadow insertion poi
nt fails."); |
| 7 | 7 </script> |
| 8 if (window.testRunner) | |
| 9 testRunner.dumpAsText(); | |
| 10 | |
| 11 </script> | |
| 12 </head> | 8 </head> |
| 13 <body> | 9 <body> |
| 14 <div id="box" style="border: 1px solid black;"> | 10 <div id="box" style="border: 1px solid black;"> |
| 15 <div id="item"><div>Content required here to reproduce bug.</div></div> | 11 <div id="item"><div>Content required here to reproduce bug.</div></div> |
| 16 </div> | 12 </div> |
| 17 <script> | 13 <script> |
| 18 var box = document.querySelector("#box"); | 14 var box = document.querySelector("#box"); |
| 19 var oldestShadowRoot = box.createShadowRoot(); | 15 var oldestShadowRoot = box.createShadowRoot(); |
| 20 oldestShadowRoot.innerHTML = "<content></content>"; | 16 oldestShadowRoot.innerHTML = "<content></content>"; |
| 21 | 17 |
| 22 var youngestShadowRoot = document.querySelector("#item").createShadowRoot(); | 18 var youngestShadowRoot = document.querySelector("#item").createShadowRoot(); |
| 23 youngestShadowRoot.innerHTML = "<style>" + | 19 youngestShadowRoot.innerHTML = "<style>" + |
| 24 ".selected {background: red;}" + | 20 ".selected {background: red;}" + |
| 25 "</style>" + | 21 "</style>" + |
| 26 "<div id='target'>Content</div>"; | 22 "<div id='target'>Content</div>"; |
| 27 | 23 |
| 28 document.body.offsetLeft; | 24 document.body.offsetLeft; |
| 29 | 25 |
| 30 target = youngestShadowRoot.querySelector("div"); | 26 target = youngestShadowRoot.querySelector("div"); |
| 31 target.classList.add("selected"); | 27 target.classList.add("selected"); |
| 32 shouldBe('window.getComputedStyle(target).backgroundColor', '"rgb(255, 0, 0)"'); | 28 shouldBe('window.getComputedStyle(target).backgroundColor', '"rgb(255, 0, 0)"'); |
| 33 </script> | 29 </script> |
| 34 </body> | 30 </body> |
| 35 </html> | 31 </html> |
| OLD | NEW |