2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 https://bugzilla.mozilla.org/show_bug.cgi?id=449327
7 <title>Test for getBBox
</title>
8 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
14 <div id=
"content" style=
"display: none"></div>
16 <iframe id=
"svg" src=
"bbox-helper.svg"></iframe>
19 <script class=
"testbody" type=
"application/javascript">
20 SimpleTest.waitForExplicitFinish();
24 var doc = $(
"svg").contentDocument;
26 function getBBox(id) {
27 return doc.getElementById(id).getBBox();
29 function checkBBox(id, x, y, width, height) {
30 var bbox = getBBox(id);
31 is(bbox.x, x, id +
".getBBox().x");
32 is(bbox.y, y, id +
".getBBox().y");
33 is(bbox.width, width, id +
".getBBox().width");
34 is(bbox.height, height, id +
".getBBox().height");
36 function checkBBoxHeight(id1, id2) {
37 var bbox1 = getBBox(id1);
38 var bbox2 = getBBox(id2);
39 is(bbox1.height, bbox2.height, id1 +
".getBBox().height");
42 checkBBox(
"f",
0,
0,
100,
100);
43 checkBBoxHeight(
"a",
"b");
44 checkBBoxHeight(
"a",
"y");
49 window.addEventListener(
"load", run, false);