W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: [css3-mediaqueries] feedback on device-aspect-ratio, aspect-ratio and orientation

From: Simetrical <simetrical@gmail.com>
Date: Fri, 31 Oct 2008 11:11:42 -0400
Message-ID: <7c2a12e20810310811t62e8f950i7c753f064911e84e@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style@w3.org

On Fri, Oct 31, 2008 at 9:15 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Almost this exact discussion came up on the WHATWG list about <video> aspect
> ratios.  ^_^  Ian has so far kept the aspect ratio a float.  His argument is
> that the precision with which we store floats is *vastly* greater than the
> differences between aspect ratios in use today or in the relatively near
> future, and so the difference between a given ratio and the
> closest-approximation float is irrelevant.  (And by the time they might get
> close, we can just upgrade it to a 64-bit float or something.)

The use-cases are different.  In HTML5, a float is used to scale a
video.  If the video is scaled to 1.333 instead of 1.3333..., nobody
will notice: that's almost certainly a subpixel difference, or if it
isn't, it's so few pixels as to be negligible.  In CSS, a float would
be used for *equality testing*, and floats just don't work for
equality testing.  As the standard warning goes, you should never
compare floats for equality: you have to do something like x - y <=
0.00001, not x == y.  If floats were used here, the standard would
have to specify what sort of equality testing would be used.
Received on Friday, 31 October 2008 15:12:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT