The current 2023 validator complains:
Code: Select all
<p> <video autoplay="" playsinline="" loop="" muted="" title="Animation"> <source src="my-video.webm" type="video/webm"> <source src="my-video.mp4" type="video/mp4"> <source src="my-video.ogv" type="video/ogg"> </video> </p>
But the Nu HTML checker validates this.The <source> element cannot be used here (in <video> which is in <p>). This is because the <video> element can contain transparent content. In this case <video>'s allowed content is determined by its ancestor <p> element, and <p> cannot contain <source>.
This Stackoverflow Post explains that <video> is categorized as phrasing content (with links to the W3 docs), and all phrasing content is allowed inside <p>. Since <source> elements are integral children to <video> elements, it'd seem that <video> elements with embedded <source> elements are valid inside <p> elements.
Perhaps the validator is incorrect? Please advise.