Skip to content

Commit

Permalink
Clarify MIME type algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Oct 8, 2024
1 parent 324a907 commit 4b5ed31
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,9 @@ spec: mimesniff; urlPrefix: https://mimesniff.spec.whatwg.org/#
To [$check MIME type support$], given a {{DOMString}} |contentType|, a
string |media|, and either a {{MediaEncodingType}} or
{{MediaDecodingType}} |encodingOrDecodingType|, perform the following
steps. They return either failure or a boolean that indicates whether
the MIME type of |contentType| is [=supported by the user agent=]:
steps. They return either a boolean that indicates whether
the MIME type of |contentType| is [=supported by the user agent=], or
<code>failure</code> if |contentType| failed to be parsed:
</p>
<ol>
<li>
Expand All @@ -889,19 +890,23 @@ spec: mimesniff; urlPrefix: https://mimesniff.spec.whatwg.org/#
If |encodingOrDecodingType| is {{MediaEncodingType/webrtc}} ({{MediaEncodingType}})
or {{MediaDecodingType/webrtc}} ({{MediaDecodingType}}):
<ol>
<li>
If |mimeType| is not the list of RTP Payload Format Media Types in
[[IANA-RTP-PARAMETERS]], return <code>false</code>.
</li>
<li>
<p>
Return whether |mimeType| is [=supported by the user agent=].
If |mimeType| is not the list of RTP Payload Format Media Types in
[[IANA-RTP-PARAMETERS]], return <code>false</code>.
</p>
<p class="note">
The codec name is typically specified as subtype and zero or more
parameters may be present depending on the codec.
</p>
</li>
<li>
If |mimeType| is not [=supported by the user agent=], return
<code>false</code>.
</li>
<li>
Return <code>true</code>.
</li>
</ol>
</li>
<li>
Expand All @@ -923,7 +928,11 @@ spec: mimesniff; urlPrefix: https://mimesniff.spec.whatwg.org/#
is not empty, return <code>failure</code>.
</li>
<li>
Return whether |mimeType| is [=supported by the user agent=].
If |mimeType| is not [=supported by the user agent=], return
<code>false</code>.
</li>
<li>
Return <code>true</code>.
</li>
</ol>
</li>
Expand All @@ -941,7 +950,11 @@ spec: mimesniff; urlPrefix: https://mimesniff.spec.whatwg.org/#
<code>false</code>.
</li>
<li>
Return whether |mimeType| is [=supported by the user agent=].
If |mimeType| is not [=supported by the user agent=],
return <code>false</code>.
</li>
<li>
Return <code>true</code>.
</li>
</ol>
</li>
Expand Down

0 comments on commit 4b5ed31

Please sign in to comment.