W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: aspect-ratio property

From: L. David Baron <dbaron@dbaron.org>
Date: Fri, 2 Dec 2011 16:15:22 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <20111203001522.GA22091@pickering.dbaron.org>
On Friday 2011-12-02 16:02 -0800, Tab Atkins Jr. wrote:
> dbaron suggested switching this to an explicit ratio with two numbers,
> but that doesn't solve the issue at all - now *both* numbers have to
> be greater than zero. For example, for "aspect-ratio: 1 .0000001;
> width: auto; height: 1px;", the width would get resolved to 1 million
> pixels.  As the ratio approaches "1 0", the width approaches infinity.
>  The same happens if the first number approaches zero if height is
> underspecified instead.

I'd use the 4/3 syntax that media queries uses rather than "4 3".
See http://www.w3.org/TR/css3-mediaqueries/#values .

> I can resolve this by including zero but making its behavior
> discontinuous (probably by saying that "0" is the same as "none").
> Thoughts?

It would only have to be discontinuous one way around.  And people
might want to use it the other way around (i.e., to make the output
dimension zero when the other dimension is input).

> 3. How should this be interpolated for Transitions/Animations?  Do we
> want to make it work like a normal number?  Work in ratio space (if
> the number is >1, represent it as "x : 1", if it's <1, represent it as
> "1 : 1/x", then interpolate each side)?  Work in log space?  Work in
> width/height space instead?  I haven't given this enough thought to
> know if any of the preceding are identical, or what each looks like.

I'd prefer something that's symmetric for widths and heights (i.e.,
not interpolating as a single number).

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Saturday, 3 December 2011 00:15:58 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:47 GMT