keyframes-003.html (784B)
1 <!doctype html> 2 <title>CSS Test: @keyframes applies to :host.</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 { 16 width: 100px; 17 height: 100px; 18 background: blue; 19 animation: myanim 10s infinite; 20 } 21 </style> 22 `; 23 24 assert_equals(document.getElementById('host').getAnimations().length, 1); 25 }, "@keyframes applies to the shadow host"); 26 </script>