simple-inline.html (1166B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Shadow Parts - Simple Inline</title> 5 <meta href="mailto:fergal@chromium.org" rel="author" title="Fergal Daly"> 6 <link href="http://www.google.com/" rel="author" title="Google"> 7 <link href="https://drafts.csswg.org/css-shadow-parts/" rel="help"> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="support/shadow-helper.js"></script> 11 </head> 12 <body> 13 <style>#c-e::part(partp) { color: green; }</style> 14 <script>installCustomElement("custom-element", "custom-element-template");</script> 15 <template id="custom-element-template"> 16 <span id="part" part="partp" style="color: red">This text</span> 17 </template> 18 The following text should be green: 19 <custom-element id="c-e"></custom-element> 20 <script> 21 "use strict"; 22 const colorGreen = "rgb(0, 128, 0)"; 23 test(function() { 24 const el = getElementByShadowIds(document, ["c-e", "part"]); 25 assert_equals(window.getComputedStyle(el).color, colorGreen); 26 }, "Part in selected host is styled"); 27 </script> 28 </body> 29 </html>