transform-dynamic-update.html (799B)
1 <!DOCTYPE HTML> 2 <link rel="help" href="http://crbug.com/1266389"> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <body> 6 7 <svg width="800" height="600" xmlns="http://www.w3.org/2000/svg"> 8 <text id="text" x="200" y="200">123</text> 9 <text id="ref" x="200" y="200" 10 transform="scale(10)">123</text> 11 </svg> 12 13 <script> 14 test(() => { 15 const referenceBox = document.querySelector('#ref').getBBox(); 16 const text = document.querySelector('#text'); 17 18 // Make the transform of #text same as #ref. 19 text.style.transform = 'scale(10)'; 20 21 const box = text.getBBox(); 22 assert_approx_equals(box.y, referenceBox.y, 0.8); 23 assert_approx_equals(box.height, referenceBox.height, 0.8); 24 }, 'Dynamic update of transform CSS property'); 25 </script> 26 </body>