W3C home > Mailing lists > Public > www-style@w3.org > May 2010

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

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Thu, 06 May 2010 15:50:26 +0200
Message-ID: <4BE2C922.6030304@disruptive-innovations.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: julien.cayzac@gmail.com, www-style@w3.org
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:

     no aspect ratio specified

     the aspect ratio width/height; example: 'aspect-ratio: 1.5'

     the aspect ratio width/height computed by the division of the two
     integers; both integers must be positive, second integer cannot be

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'.

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:45 UTC