Re: suggestion: fixed-aspect-ratio CSS rule for block elements

This seems reasonable, but is #3 ALWAYS "width / height"? What if the writing and filling directions change? The text explaining this should have a warning that authors in other writing systems need to be careful not to expect these two directions to change if it is defined as always "width/height". Otherwise, if the order might change with writing / filling directions, the text needs to make that clear, also.

Another point -- the pair of integers could be specified as "width, height" or even "width height". And what if an author uses an integer (ddd.dd)? is that an error, or is the second number ignored, or is the ratio still used. SVG users would expect the numbers to be used, even if they were not integers. I hope CSS follows that path.

On May 6, 2010, at 6:50 AM, Daniel Glazman wrote:

> Le 05/05/10 17:45, Tab Atkins Jr. a écrit :
>> 3) We add aspect-ratio, but have it only interact with 'auto' values
>> for width/height.  So, in the previous example, the aspect-ratio would
>> have no effect, since both width and height are already specified.  If
>> you set height:auto instead, though, then aspect-ratio will be
>> consulted to resolve it.  Or you could set height and leave width as
>> auto, so aspect-ratio would also have an effect.  Finally, if both
>> were auto (the default), then whichever is resolved first (typically
>> width) would be resolved normally, then aspect-ratio would be used to
>> resolve the other dimension (typically height).
> I agree. 'aspect-ratio' could then take three different values:
>  none
>    no aspect ratio specified
>  <number>
>    the aspect ratio width/height; example: 'aspect-ratio: 1.5'
>  <integer>/<integer>
>    the aspect ratio width/height computed by the division of the two
>    integers; both integers must be positive, second integer cannot be
>    0
> I hope nobody's suggesting keywords like 'vga' or '1080p', because
> that's a true pandora's box.
> And yes, we need to preserve the min/max contraints otherwise the algo
> to computed this will be hell.
> Just one comment: 'aspect-ratio' could take a second component value to
> say if the width or the height has precedence in the case both width
> and height are auto. Like 'aspect-ratio: 4/3 width'.
> </Daniel>

<James />

Received on Thursday, 6 May 2010 14:43:16 UTC