keyframes-005.html (796B)
1 <!doctype html> 2 <title>CSS Test: @keyframes should not leak out of shadow tree.</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 <style> 7 #host { 8 width: 100px; 9 height: 100px; 10 background: blue; 11 animation: myanim 10s infinite; 12 } 13 </style> 14 <div id="host"></div> 15 <script> 16 test(function() { 17 host.attachShadow({ mode: "open" }).innerHTML = ` 18 <style> 19 @keyframes myanim { 20 from { background: red; } 21 to { background: green; } 22 } 23 </style> 24 `; 25 26 assert_equals(document.getElementById('host').getAnimations().length, 0); 27 }, "@keyframes should not leak out of the shadow tree."); 28 </script>