style-sharing.html (868B)
1 <!doctype html> 2 <title>CSS Shadow Parts test: Parts don't incorrectly share style with other elements</title> 3 <link rel="help" href="https://drafts.csswg.org/css-shadow-parts/"> 4 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 5 <link rel="author" href="https://mozilla.org/" title="Mozilla"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <style>::part(part1) { color: green; }</style> 9 <div id="host"></div> 10 <script> 11 "use strict"; 12 test(function() { 13 host.attachShadow({ mode: "open" }).innerHTML = ` 14 <div></div> 15 <div part="part1"></div> 16 `; 17 assert_equals( 18 getComputedStyle(host.shadowRoot.querySelector("[part]")).color, 19 "rgb(0, 128, 0)", 20 "Part should be green", 21 ); 22 }, "Part in selected host does not incorrectly share style with non-part"); 23 </script>