Re: aspect-ratio property

Hope this isn't too divergent; spin-off the thread if necessary, but I
just read your proposed spec Tab (http://www.xanthir.com/blog/b4810),
and have some comments.

> You can use it to, for example, require that an HTML <video> element is as wide as its parent element at all times, but maintain a 4:3 ratio.

> However, several common ratios are usually expressed as fractions or explicit ratios, such as "16 by 9". These can be easily expressed using the calc() function, like aspect-ratio: calc(16/9);.

The problem with these is that in the video world, aspect ratio is a
lot more complicated. When somebody says "4:3" or "16:9", all you can
really be sure of what they mean is "frame size that is nearly as tall
as it is wide" and "frame size that is noticeably wider than it is
tall", respectively. The aspect ratios of video described in these
terms, more often than not aren't literally 4:3 or 16:9, due to
varying pixel aspect ratio dimensions.

I explained this problem in some detail on WHATWG a few years back
(first reply block):
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-December/024541.html

The problem is, if an author has a 720x480 pixel video, and specifies:

    max-height: 480px;
    aspect-ratio: calc(16/9);

What do they get? The blind mathematics are simple, but the correct
square-pixel width could be 853, 854, 856, 864, 873, or 875 depending
on the video specification being observed. And that's just on the
"NTSC" side; there are still other definitions for PAL-area video.
Most authors and even video professionals are oblivious to these
conflicting definitions so even if there were a way to specify the
standard manually it wouldn't be used.

Thus I think the best solution would be a rewording of the spec that
states the value of aspect-ratio is interpreted literally; that
depending on the video standard, the shorthands 4:3 or 16:9 may not
produce the correct ratio.

Received on Thursday, 5 January 2012 22:21:06 UTC