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

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>

Received on Thursday, 6 May 2010 13:51:01 UTC