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

The CSS Working Group just discussed `SVG degenerate aspect ratios`, and agreed to the following:

* `RESOLVED: degenerate aspect ratios derived from SVG width/height attributes fall back to viewbox aspect ratio (whether due to negative values or zero values)`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: SVG degenerate aspect ratios<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6286<br>
&lt;fantasai> iank_: We were going to ask Amelia, but she had to defer<br>
&lt;fantasai> iank_: So it's up to us<br>
&lt;fantasai> iank_: I posted a comment describing the various behaviors<br>
&lt;fantasai> iank_: I still slightly prefer the WebKit/Blink behavior<br>
&lt;fantasai> iank_: ...<br>
&lt;fantasai> iank_: Reminder that this is just about interop on an edge case for which we have testcases in WPT, not something that impacts web devs<br>
&lt;fantasai> Rossen: can you summarize?<br>
&lt;fantasai> iank_: With negative widths, Blink/WebKit will treat as invalid whereas Firefox will treat as zero<br>
&lt;fantasai> iank_: Blink/WebKit will use the viewbox aspect ratio as a fallback<br>
&lt;fantasai> iank_: whereas Firefox will have no aspect ratio<br>
&lt;fantasai> iank_: If there is a negative width/height specified, it gets clamped to zero and then continue<br>
&lt;fantasai> iank_: Firefox's behavior from there was to treat aspect-ratio as null<br>
&lt;fantasai> iank_: Whereas when we have a negative width/height, we treat as invalid<br>
&lt;fantasai> iank_: So we use fallback aspect ratio<br>
&lt;fantasai> iank_: Separate issue of when we have explicit width of zero and height of 50<br>
&lt;fantasai> iank_: Blink/WebKit will fallback to viewbox of 1:1<br>
&lt;fantasai> iank_: and Firefox will behave as if there is no aspect ratio<br>
&lt;fantasai> Note: spec currently says “If the &lt;ratio> is degenerate, the property instead behaves as auto.”<br>
&lt;fantasai> Rossen: so your preference is to fall back from degenerate width/height on SVG to the viewbox aspect ratio<br>
&lt;fantasai> iank_: Right. This mirrors how the aspect-ratio property itself falls back from degenerate ratio value to intrinsic ratio of image<br>
&lt;fantasai> dholbert: Are you proposing just for negative case, or also for zero case?<br>
&lt;emeyer> fantasai: So the proposal is to fall back to the intrinsic aspect ratio<br>
&lt;emeyer> fantasi: In all degenerate cases<br>
&lt;fantasai> s/intrinsic/viewbox/<br>
&lt;fantasai> dholbert: OK, would not object to that<br>
&lt;emeyer> s/fantasi/fantasai/<br>
&lt;dholbert> iank_, got it, thanks<br>
&lt;fantasai> fantasai: So the proposal is that in the same way that the aspect-ratio property's explicit degenerate aspect ratios fall back to the intrinsic aspect ratio of the image, the proposal is that a degenerate aspect ratio from an SVG derived from its width/height attributes also falls back: to its viewbox ratio<br>
&lt;fantasai> RESOLVED: degenerate aspect ratios derived from SVG width/height attributes fall back to viewbox aspect ratio (whether due to negative values or zero values)<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-866986544 using your GitHub account


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

Received on Wednesday, 23 June 2021 16:29:20 UTC