attribute-value-unaffected-by-animation-001.html (1147B)
1 <!doctype html> 2 <title>An animation of an attribute ('class') does not change the DOM attribute value</title> 3 <link rel="help" href="https://www.w3.org/TR/2001/REC-smil-animation-20010904/#BasicAnim"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 .animated { 8 fill: blue; 9 } 10 </style> 11 <svg> 12 <rect class="base"> 13 <set attributeName="class" to="animated"/> 14 </rect> 15 <rect> 16 <set attributeName="class" to="animated"/> 17 </rect> 18 </svg> 19 <script> 20 async_test(t => { 21 onload = t.step_func(() => { 22 requestAnimationFrame(t.step_func_done(() => { 23 let rects = document.getElementsByTagName('rect'); 24 assert_true(rects[0].hasAttribute('class')); 25 assert_equals(rects[0].getAttribute('class'), 'base'); 26 assert_equals(getComputedStyle(rects[0]).getPropertyValue('fill'), 'rgb(0, 0, 255)'); 27 28 assert_false(rects[1].hasAttribute('class')); 29 assert_equals(rects[1].getAttribute('class'), null); 30 assert_equals(getComputedStyle(rects[0]).getPropertyValue('fill'), 'rgb(0, 0, 255)'); 31 })); 32 }); 33 }); 34 </script>