[whatwg] question on @width and @height attributes on <video>

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Mon Nov 8 22:48:39 PST 2010


On Tue, Nov 9, 2010 at 1:55 AM, Simon Pieters <simonp at opera.com> wrote:
> On Mon, 08 Nov 2010 15:36:38 +0100, Silvia Pfeiffer
> <silviapfeiffer1 at gmail.com> wrote:
>
>> On Tue, Nov 9, 2010 at 12:16 AM, Simon Pieters <simonp at opera.com> wrote:
>>>
>>> On Mon, 08 Nov 2010 08:27:30 +0100, Silvia Pfeiffer
>>> <silviapfeiffer1 at gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I am staring at the @width and @height attributes of the <video>
>>>> element, because I have just noticed that the implementation of IE9
>>>> doesn't respect percentage values in there. I remembered Hixie saying
>>>> that if you gave them a value that included "px", that's strictly
>>>> speaking not valid, since the value is a unsigned long but a browser
>>>> will just drop the "px" and interpret it correctly.
>>>
>>> That it's unsigned long is only relevant for getting and setting the
>>> .width
>>> and .height IDL attributes, it's not relevant for how the content
>>> attribute's value is interpreted.
>>>
>>>
>>>> I am now wondering if a percentage value is correct,
>>>
>>> Following the link for <video width> I come to
>>>
>>>
>>> http://www.whatwg.org/specs/web-apps/current-work/complete/the-map-element.html#attr-dim-width
>>>
>>> which says
>>>
>>> "Author requirements: The width and height attributes [...] if specified,
>>> must have values that are valid non-negative integers."
>>>
>>> and
>>>
>>> "A string is a valid non-negative integer if it consists of one or more
>>> characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)."
>>>
>>> So that makes it clear that percentage values are invalid as far as
>>> document
>>> conformance goes.
>>>
>>> But the UA requirements gives:
>>>
>>>
>>> http://www.whatwg.org/specs/web-apps/current-work/complete/rendering.html#dimRendering
>>>
>>> http://www.whatwg.org/specs/web-apps/current-work/complete/rendering.html#maps-to-the-dimension-property
>>>
>>> http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-dimension-values
>>>
>>> ...which supports percentage values.
>>
>>
>> So, now I am even more confused: are they invalid or supported? How do
>> you reconcile these two seemingly opposing positions?
>
> They are invalid *and* supported. :-) Defined error handling if you will.
> It's all over the place in HTML5. See this section:
>
> http://www.whatwg.org/specs/web-apps/current-work/complete/introduction.html#conformance-requirements-for-authors

As long as the percent-values aren't deprecated... cause if they are,
IE behavior would be accurate, IMO.

Silvia.



More information about the whatwg mailing list