These questions in HTML5 always consist of two parts: is this really the case, and what happens if I do this?
1. Is it really?
No. Although the link to the markup language link does not seem useful, as it omits a critical fact. (see below).
Instead, view the actual specification for the audio element .
The content model for this says:
If an element has the src attribute: zero or more track elements, then transparent, but with no descendants of media elements.
If an element does not have the src attribute: one or more sources of elements, then zero or more track elements, then transparent, but with no descendants of media elements.
Thus, the source element is not specifically invoked as resolved when the src attribute is present.
But what about a transparent bit? This means that elements that are valid inside the parent element of the audio element are also valid inside the audio element. Therefore, if the source element was valid in the parent element, then it will also be valid inside the audio element, even if the audio element has the src attribute.
Is it possible? If we check the specification for the source element , we will see that the context in which this element can be used is
Being a child of a media element, before any stream content or track elements.
Thus, the parent element of the audio element must be a multimedia element, that is, <video> or <audio> .
However, again, when defining the content model of an audio element (see above), it says that audio cannot have descendants of media elements - therefore, an audio element cannot be embedded in another audio element. The video element is defined in a similar way, so <source> cannot be a valid child <audio> element through the "transparent" part of the audio element content model.
Therefore, a sound element with the src and <source> attributes cannot be valid.
(Note that the link to the Markup Language link that you are linking to does not mention the restriction of descending descendants of media elements, so I donβt believe that you can determine the correct check from it.)
2. What happens if I do this?
This is a bit easier. The specification for the src attribute for media elements says:
There are two ways to specify a media resource, an src attribute, or a source element. The attribute overrides elements.
In other words, if the src attribute is present, any <source> elements are simply ignored.
See Ian Boyd's answer for a few src attributes.