Re: [csswg-drafts] [css-images] Behaviour of SVG degenerate aspect-ratios (#6286)

The CSS Working Group just discussed `[css-images] Behaviour of SVG degenerate aspect-ratios`, and agreed to the following:

* `RESOLVED: for degenerate ratios, take the viewBox ratio with the positive dimension. If both are negative or zero, then drop the block-size`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> fantasai: there was a discussion about degenerate ratios derived from svg, when if degenerate we fall back to the viewBox aspect ratio<br>
&lt;emilio> ... but do we discard the width or the height<br>
&lt;emilio> ... mozilla discards the height<br>
&lt;emilio> ... but I think it makes sense to discard the zero dimension<br>
&lt;emilio> ... and if both are zero probably discard the height?<br>
&lt;emilio> astearns: so this would amend the previous resolution<br>
&lt;emilio> fantasai: yeah<br>
&lt;emilio> ... let's say you have &lt;svg width height viewBox><br>
&lt;emilio> ... but viewBox A/R is 2/1 but width/height aspect ratio is different<br>
&lt;emilio> ... so if width / height ratio is degenerate we resolved to use viewBox<br>
&lt;emilio> ... but we need that plus a size to apply the viewBox ratio on<br>
&lt;emilio> ... so gecko always drops the height<br>
&lt;emilio> ... but if we have a 0 dimension and a non-zero dimension it seems keeping the non-zero dimension would make more sense<br>
&lt;emilio> astearns: so proposal would be to amend the previous resolution to take the non zero dimension<br>
&lt;emilio> astearns: iank_ commented that negative dimensions and zero are different<br>
&lt;ydaniv> +1<br>
&lt;emilio> fantasai: probably we floor negative dimensions at 0<br>
&lt;flackr> Sounds reasonable<br>
&lt;emilio> emilio: I agree, if compat allows this makes more sense<br>
&lt;Kurt> width = "&lt;length>"<br>
&lt;Kurt> The width of the rectangle.<br>
&lt;Kurt> A negative value is an error<br>
&lt;Kurt> https://www.w3.org/TR/SVG11/shapes.html#RectElement<br>
&lt;kbabbitt> +1<br>
&lt;emilio> PROPOSAL: for degenerate ratios, take the viewBox ratio with the positive dimension. If both are negative or zero, then drop the block-size<br>
&lt;fantasai> +1<br>
&lt;emilio> RESOLVED: for degenerate ratios, take the viewBox ratio with the positive dimension. If both are negative or zero, then drop the block-size<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-3407407106 using your GitHub account


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

Received on Wednesday, 15 October 2025 16:52:45 UTC