OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <link id="importLink" rel="import" href="data:text/html,<div id=host></div>"> |
| 5 <script> |
| 6 var importDoc = importLink.import; |
| 7 var root = importDoc.querySelector("#host").attachShadow({mode:"open"}); |
| 8 var shadowStyle = importDoc.createElement("style"); |
| 9 shadowStyle.appendChild(importDoc.createTextNode("div{color:pink}")); |
| 10 root.appendChild(shadowStyle); |
| 11 |
| 12 test(() => { |
| 13 assert_true(!!shadowStyle.sheet, |
| 14 "The shadow tree Element.sheet should be defined."); |
| 15 assert_equals(shadowStyle.sheet.cssRules.length, 1, |
| 16 "The number of rules in the shadow tree stylesheet should 1."); |
| 17 }, "Element.sheet on style element in shadow tree in html import."); |
| 18 |
| 19 test(() => { |
| 20 assert_equals(root.styleSheets.length, 1, |
| 21 "Length of the ShadowRoot.styleSheets should be 1."); |
| 22 assert_equals(root.styleSheets[0].cssRules.length, 1, |
| 23 "The number of rules in the shadow stylesheet should be 1."); |
| 24 }, "ShadowRoot.styleSheets on shadow root in html import."); |
| 25 </script> |
OLD | NEW |