test_bug1544209.html (770B)
1 <!DOCTYPE HTML> 2 <script src="/tests/SimpleTest/SimpleTest.js"></script> 3 <link rel="stylesheet" href="/tests/SimpleTest/test.css"> 4 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1544209">Mozilla Bug 1544209</a> 5 6 <svg height="800px" width="800px"> 7 <text transform="scale(3,3)" id="a" x="20px" y="20px">ABC<tspan id="b">ABC</tspan></text> 8 </svg> 9 10 <script type="application/javascript"> 11 let a = document.getElementById("a"), 12 b = document.getElementById("b"); 13 14 let wtext = a.getBoundingClientRect().width, 15 wtspan = b.getBoundingClientRect().width; 16 17 ok(wtext >= wtspan, "<tspan> should not be wider than <text>"); 18 isfuzzy((wtext - wtspan) / wtext, 0.5, 0.1, "<tspan> should be approximately half of the <text> width"); 19 </script>