Bugzilla – Bug 695
<video></video> should be valid
Last modified: 2011-08-03 07:17:48 CEST
<!DOCTYPE html> <title>Video test</title> <video></video> Expected: This should be an error. Actual result: "The document validates according to the specified schema(s)." Spec text: "Content model: If the element does not have a src attribute: one or more source elements, then, transparent, but with no media element descendants." The same bug is present for the audio element.
In my workspace and at http://www.w3.org/html/check (which is running my workspace code), <video></video> causes the following error to be emitted as expected. Error: Element video is missing a required instance of child element source. And similarly for the audio case. I thought that I had already pushed all the relevant code to the main repo prior to the latest deployment of http://validator.nu but I guess I didn't. So I will re-check this again after the next time it does get redeployed.
The example now gives "Element video is missing a required instance of child element source." so this has been fixed.
WFM.
The spec has however changed since. "If the element does not have a src attribute: **zero or more** source elements, then zero or more track elements, then transparent, but with no media element descendants."
Isn't that a spec bug?
No, it was changed when getUserMedia was added. You don't have a src until the user has chosen a camera, but you still want a video placeholder.
Excellent, that will make my code where I use <video></video> and set the src by script later valid!
https://bitbucket.org/validator/syntax/changeset/ea447905c22f