keyframes-006.html (1033B)
1 <!doctype html> 2 <title>CSS Test: @keyframes applies to :host::before/::after.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="help" href="https://drafts.csswg.org/css-scoping/#shadow-names"> 6 <div id="host"></div> 7 <script> 8 test(function() { 9 host.attachShadow({ mode: "open" }).innerHTML = ` 10 <style> 11 @keyframes myanim { 12 from { background: red; } 13 to { background: green; } 14 } 15 :host::before, :host::after { 16 content: ""; 17 display: block; 18 width: 100px; 19 height: 100px; 20 background: blue; 21 animation: myanim 10s infinite step-end; 22 } 23 </style> 24 `; 25 26 assert_equals(getComputedStyle(document.getElementById('host'), "::before").backgroundColor, "rgb(255, 0, 0)"); 27 assert_equals(getComputedStyle(document.getElementById('host'), "::after").backgroundColor, "rgb(255, 0, 0)"); 28 }, "@keyframes applies to the shadow host"); 29 </script>