3 <!-- Test that svg bounding boxes are not affected by empty containers -->
5 <script type=
"text/javascript">
6 function checkBoundingBoxesEqual() {
8 window
.testRunner
.dumpAsText();
10 // Ensure both boxes are the same size, meaning the empty <g> does not affect the bbox size.
11 var bboxA
= document
.getElementById('ga').getBBox();
12 var bboxB
= document
.getElementById('gb').getBBox();
14 if (bboxA
.width
== bboxB
.width
&& bboxA
.height
== bboxB
.height
)
16 document
.body
.innerHTML
= results
+ ", bounding box sizes are (" +
17 bboxA
.width
+ ", " + bboxA
.height
+ ") and (" +
18 bboxB
.width
+ ", " + bboxB
.height
+ ")";
22 <body onload=
"checkBoundingBoxesEqual()">
23 <svg width=
"400" height=
"400" xmlns=
"http://www.w3.org/2000/svg">
26 <g transform=
"translate(100, 100)">
28 <rect x=
"0" y=
"0" width=
"100" height=
"100" rx=
"10" ry=
"10" stroke=
"#000000" stroke-width=
"1" fill=
"#ffffcc" />
32 <g transform=
"translate(100, 100)">
33 <rect x=
"0" y=
"0" width=
"100" height=
"100" rx=
"10" ry=
"10" stroke=
"#000000" stroke-width=
"1" fill=
"#ffffcc" />