keyframes-002.html (935B)
1 <!doctype html> 2 <title>CSS Test: @keyframes from the document should apply in the shadow tree.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 6 <link rel="help" href="https://drafts.csswg.org/css-scoping/#selectors-data-model"> 7 8 <style> 9 @keyframes myanim { 10 from { background: red; } 11 to { background: red; } 12 } 13 </style> 14 <div id="host"></div> 15 <script> 16 test(function() { 17 host.attachShadow({ mode: "open" }).innerHTML = ` 18 <style> 19 #in-shadow { 20 width: 100px; 21 height: 100px; 22 background: blue; 23 animation: myanim 10s infinite; 24 } 25 </style> 26 <div id="in-shadow"></div> 27 `; 28 29 assert_equals(host.shadowRoot.getElementById('in-shadow').getAnimations().length, 1); 30 }, "@keyframes from the document should apply in the shadow tree"); 31 </script>