Re: [svgwg] Behaviour of degenerate aspect-ratios. (#848)

Hmmm, SVG has no direct attribute for the aspect-ratio.
As far as I can see, such cases with width or height 0 or nonsense like negative length result either in no rendering or in error processing, therefore no need to calculate an aspect-ratio for a viewer.

In these cases an (X)HTML:img element is used.
From the CSS point of view this is a replaced element.
For such CSS has some rules:
https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width

Now we have to find out, which case applies.

In your example the SVG provides information about width, height, viewBox
The SVG has a width of zero, therefore this becomes the value of CSS:width.
The same for height: 50 px.
Does CSS need an aspect ratio, if width and height can be determined by the SVG document?
With aspect-ratio = width/height it becomes 0 for your example, more problematic would be height 0 resulting in an infinite ratio.
In physics, if this can happen, one prefers something like contrast anyway, for example: (width - height)/(width+height).
Here you get only in trouble for both beeing 0, in such a case there is no information at all to care about. But if needed, CSS could define for such a case contrast as 0 without harm.






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


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

Received on Tuesday, 11 May 2021 08:38:51 UTC