OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style>.green { color: green }</style> |
| 5 <div id="host"> |
| 6 <div id="inner">Green, should not crash.</div> |
| 7 </div> |
| 8 <script> |
| 9 var root = host.createShadowRoot(); |
| 10 |
| 11 test(() => { |
| 12 root.innerHTML = "<style>:host ::content * { color:red }</style><content
>"; |
| 13 document.body.offsetTop; |
| 14 assert_equals(getComputedStyle(inner).color, "rgb(255, 0, 0)", "#inner i
s initially red."); |
| 15 }, "Check that #inner is initially red."); |
| 16 |
| 17 test(() => { |
| 18 // Inserting a document stylesheet before another one causes a |
| 19 // StyleResolver Reconstruct. |
| 20 var newSheet = document.createElement("style"); |
| 21 newSheet.innerText = "#nomatch { color: red }"; |
| 22 document.head.insertBefore(newSheet, document.querySelector("style")); |
| 23 // Removing the shadow stylesheet will cause the ScopedStyleResolver |
| 24 // to be nuked. |
| 25 root.innerHTML = "<content>"; |
| 26 inner.className = "green"; |
| 27 assert_equals(getComputedStyle(inner).color, "rgb(0, 128, 0)", "Check th
at #inner is green after the class is set."); |
| 28 }, "Reconstructing StyleResolver should not leave any treeBoundaryCrossingSc
opes with null ScopedStyleResolvers in StyleEngine."); |
| 29 </script> |
OLD | NEW |