Re: [svgwg] naturalWidth and naturalHeight in the context of an HTML image (#1044)

The sizing is defined in SVG 2 in
https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing

It says:

* The value auto for [width](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) and [height](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) on the ‘[svg](https://svgwg.org/svg2-draft/single-page.html#struct-SVGElement)’ element is treated as 100%.
* The value auto for [width](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) and [height](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) on the ‘[image](https://svgwg.org/svg2-draft/single-page.html#embedded-ImageElement)’ element is calculated from the referenced image's intrinsic dimensions and aspect ratio, according to the CSS [Default Sizing Algorithm](https://www.w3.org/TR/css3-images/#default-sizing-algorithm).
* The value auto for [width](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) and [height](https://svgwg.org/svg2-draft/single-page.html#geometry-Sizing) on other elements is treated as 0.

There is also a note


> New in SVG 2. Images embedded in SVG can now be auto-sized to the intrinsic size, or scaled to a fixed height or width according to the intrinsic aspect ratio. This matches the behavior of embedded images in HTML.

I wonder if we should link to the HTML spec here to make sure about enforcing the 300x150 size.


-- 
GitHub Notification of comment by karlcow
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1044#issuecomment-3717159503 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 7 January 2026 03:15:51 UTC