Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<title>SVGGraphicsElement.prototype.getBBox on &lt;tspan&gt;</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg height="100">
<text y="180" font-size="100" font-family="Ahem" fill="lightblue"
transform="translate(0, -100)">X<tspan fill="blue">X</tspan></text>
</svg>
<script>
async_test(t => {
onload = t.step_func_done(() => {
let tspan = document.querySelector('tspan');
let bbox = tspan.getBBox();
for (let property of ['x', 'y', 'width', 'height'])
assert_equals(bbox[property], 100, property);
});
});
</script>