W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] media attribute of <source> element, default behavior on getting the property.

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Tue, 08 May 2012 21:43:38 -0700
Message-ID: <4FA9F5FA.3060702@lamouri.fr>
To: whatwg@lists.whatwg.org
On 05/08/2012 10:29 AM, Paul Adenot wrote:
> Currently implementing the "media" attribute for the <source> element in
> Gecko, we are not sure on how to interpret the spec when the attribute
> is not set in the HTML source.
> 
> Considering this snipped of code :
> 
> <video>
>   <source id="asource" src="media.webm">
> </video>
> 
> What should document.getElementById("asource").media [1] be ?
> 
> The spec [2] currently says :
> 
>> The default, if the media attribute is omitted, is "all", meaning
>> that by default the media resource is suitable for all media.
> 
> At that point, we understand that if no media attribute is specified,
> the expression [1] should return "all".

The quoted text says that the default is 'all', not that the default
value of the IDL attribute is 'all'. This is speaking of how the UA
should handle internally the attribute being omitted.

> Then spec then says :
> 
>> The IDL attributes src, type, and media must reflect the respective ?
>> content attributes of the same name.
> 
> At this point, we understand that [1] should return an empty string, but
> the <source> is matched as if media was "all".

AFAICT, this is what should be taken into account.

--
Mounir
Received on Wednesday, 9 May 2012 04:44:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT