| <!DOCTYPE html> |
| <html> |
| <!-- Test that svg bounding boxes are not affected by empty containers --> |
| <head> |
| <script type="text/javascript"> |
| function checkBoundingBoxesEqual() { |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| |
| // Ensure both boxes are the same size, meaning the empty <g> does not affect the bbox size. |
| var bboxA = document.getElementById('ga').getBBox(); |
| var bboxB = document.getElementById('gb').getBBox(); |
| var results = "FAIL"; |
| if (bboxA.width == bboxB.width && bboxA.height == bboxB.height) |
| results = "PASS"; |
| document.body.innerHTML = results + ", bounding box sizes are (" + |
| bboxA.width + ", " + bboxA.height + ") and (" + |
| bboxB.width + ", " + bboxB.height + ")"; |
| } |
| </script> |
| </head> |
| <body onload="checkBoundingBoxesEqual()"> |
| <svg width="400" height="400" xmlns="http://www.w3.org/2000/svg"> |
| <g id="ga"> |
| <g></g> |
| <g transform="translate(100, 100)"> |
| <g></g> |
| <rect x="0" y="0" width="100" height="100" rx="10" ry="10" stroke="#000000" stroke-width="1" fill="#ffffcc" /> |
| </g> |
| </g> |
| <g id="gb"> |
| <g transform="translate(100, 100)"> |
| <rect x="0" y="0" width="100" height="100" rx="10" ry="10" stroke="#000000" stroke-width="1" fill="#ffffcc" /> |
| </g> |
| </g> |
| </svg> |
| </body> |
| </html> |