- From: Karl Dubost via GitHub <noreply@w3.org>
- Date: Thu, 19 Mar 2026 05:24:44 +0000
- To: public-svg-issues@w3.org
The spec says: https://w3c.github.io/svgwg/svg2-draft/coords.html#BoundingBoxes > Even if an element is not in the [rendering tree](https://w3c.github.io/svgwg/svg2-draft/render.html#RenderingTree) – due to it being 'display: none', within a ‘[defs](https://w3c.github.io/svgwg/svg2-draft/struct.html#DefsElement)’ element, not usually rendered like a ‘[symbol](https://w3c.github.io/svgwg/svg2-draft/struct.html#SymbolElement)’ element or not currently present in the document tree – it still has a bounding box. with > A call to [getBBox](https://w3c.github.io/svgwg/svg2-draft/types.html#__svg__SVGGraphicsElement__getBBox) on the element will return the same rectangle as if the element were rendered. Then > However, an element that is not in the [rendering tree](https://w3c.github.io/svgwg/svg2-draft/render.html#RenderingTree) does not contribute to the bounding box of any ancestor element. And > An element which has zero width, zero height, or both (such as a vertical or horizontal line, or a ‘[rect](https://w3c.github.io/svgwg/svg2-draft/shapes.html#RectElement)’ element with a zero [width](https://w3c.github.io/svgwg/svg2-draft/geometry.html#Sizing) or [height](https://w3c.github.io/svgwg/svg2-draft/geometry.html#Sizing)) still has a bounding box, with a positive value for the positive dimension, or with '0' for both the width and height if no positive dimension is specified. Also > Similarly, subpaths segments of a ‘[path](https://w3c.github.io/svgwg/svg2-draft/paths.html#PathElement)’ element with zero width and height must be included in that element's geometry for the sake of the bounding box. So there might more to change. There is also the algorithm to compute the bounding box. https://w3c.github.io/svgwg/svg2-draft/coords.html#:~:text=algorithm%20to%20compute%20the%20bounding%20box -- GitHub Notification of comment by karlcow Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1018#issuecomment-4087898366 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 19 March 2026 05:24:45 UTC