[whatwg] Change request: rules for pixel ratio

Philip Jägenstedt philipj at opera.com
Tue Jun 10 09:31:05 PDT 2008


Hi!

http://www.w3.org/html/wg/html5/#pixelratio

The pixelratio attribute allows the author to specify the pixel ratio of
anamorphic media resources that do not self-describe their pixel ratio.
[...] The default value, if the attribute is omitted or cannot be
parsed, is 1.0.

This seems more than strange. Should this be taken to mean that the
pixelratio attribute is defaulted to 1.0 even for media resources that
DO NOT self-describe their pixel ratio? To be clear what we are talking
about, here are some example pixel ratios:

PAL (720x576) 4:3 DVD has pixel ratio 16:15 (=1.067)
PAL (720x576) anamorphic 16:9 DVD has pixel ratio 64:45 (=1.422)
NTSC (720x480) 4:3 DVD has pixel ratio 40:45 (=0.889)
NTSC (720x480) anamorphic 16:9 DVD has pixel ratio 32:27 (=1.185)

To display such video correctly, the pixel aspect ratio must be correct.
Since many formats can specify pixel ratio (including Ogg Theora) this
is trivial to do automatically, but it would be a spec violation. In my
opinion, it would make a lot more sense to let the pixel ratio default
to the media resources self-described pixel ratio, and 1.0 only as the
last resort.

Suggested change to http://www.w3.org/html/wg/html5/#pixelratio :

The default value, if the attribute is omitted or cannot be parsed,
is the media resource's self-described pixel ratio, or 1.0 for media
resources that do not self-describe their pixel ratio.

Suggested changes to http://www.w3.org/html/wg/html5/#pick-a

5. If candidate is not null and it has a pixelratio attribute, then let
the chosen resource's pixel ratio be result of applying the rules for
parsing floating point number values to the value of that attribute, or
1.0 if those rules return an error. Otherwise, let the chosen resource's
pixel ratio be the media resource's self-described pixel ratio, or
1.0 for media resources that do not self-describe their pixel ratio.

Just to be clear, the intended priority is:

1. pixelratio attribute
2. self-described pixel ratio
3. 1.0

Perhaps these changes are too verbose, they could be made shorter if the
meaning is still clear.

Comments?

It is also worth noting that when the pixel ratio is < 1.0 it will make
more sense for the user agent to adjust the height than the width if no
width/height attributes have been set. This could be pointed out in the
rendering section eventually.

-- 
Philip Jägenstedt
Opera Software




More information about the whatwg mailing list