Bug 616542 - Shorten file path length of mochitest; r=ted
[gecko.git] / content / svg / content / test / test_bbox.xhtml
blobcf5dc92a55bd604696850a04b24b58b402cc9fce
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=449327
5 -->
6 <head>
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" />
10 </head>
11 <body>
13 <p id="display"></p>
14 <div id="content" style="display: none"></div>
16 <iframe id="svg" src="bbox-helper.svg"></iframe>
18 <pre id="test">
19 <script class="testbody" type="application/javascript">
20 SimpleTest.waitForExplicitFinish();
22 function run()
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");
46 SimpleTest.finish();
49 window.addEventListener("load", run, false);
50 </script>
51 </pre>
52 </body>
53 </html>