Re: "Element source not allowed as child of element audio in this context."

22.10.2011 23:36, Kristjan wrote:

> Line 10, Column 50: Element source not allowed as child of element audio
> in this context. (Suppressing further errors from this subtree.)

It seems that the W3C Markup Validator has a bug in its HTML5 mode: it 
acts as if audio and video elements allowed only one source element in 
their content. A minimal document to demonstrate this:

<!doctype html><title></title>
<video><source src=foo><source src=bar></video>

It passes validator.nu validation.

> I need both source tags

Yes, and it's part of the very idea of audio and video elements that you 
can specify alternate sources with different media types. Technically 
you could do the same using nested audio (or video) elements with src 
attributes, but the source element approach is cleaner and simpler - and 
of course the validator's bug does not affect browser behavior. (Browser 
support to these elements and to the data formats is an entirely 
different issue.)

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Saturday, 22 October 2011 22:08:59 UTC