W3C home > Mailing lists > Public > www-validator@w3.org > October 2011

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

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 23 Oct 2011 01:07:57 +0300
Message-ID: <4EA33EBD.2010401@cs.tut.fi>
To: Kristjan <kristjanile@gmail.com>
CC: www-validator@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:49 GMT