[whatwg] media attribute of <source> element, default behavior on getting the property.
padenot+whatwg at mozilla.com
Tue May 8 10:29:05 PDT 2012
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 :
<source id="asource" src="media.webm">
What should document.getElementById("asource").media  be ?
The spec  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  should return "all".
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  should return an empty string, but
the <source> is matched as if media was "all".
The part of the spec about reflection  states :
> If a reflecting IDL attribute is a DOMString attribute but doesn't
> fall into any of the above categories, then the getting and setting
> must be done in a transparent, case-preserving manner.
which means that  should return an empty string.
What is the actual intended behavior for this feature ? This section may
need some clarification.
: http://www.whatwg.org/html#reflect, sixth paragraph
More information about the whatwg