Skip to content

Commit

Permalink
Move JavaScript and JSON MIME types from HTML
Browse files Browse the repository at this point in the history
This consolidates the lists of MIME types in a single specification, instead of spreading them out among two.
  • Loading branch information
domenic committed Feb 16, 2018
1 parent 4529389 commit 2ca219f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions mimesniff.bs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ Markup Shorthands: css off
url:https://tools.ietf.org/html/rfc7230#section-3.2.6;text:token;type:dfn;spec:http
url:https://tools.ietf.org/html/rfc7230#section-3.2.6;text:quoted-string;type:dfn;spec:http
url:https://tools.ietf.org/html/rfc7231#section-3.1.1.1;text:media-type;type:dfn;spec:http

# https://github.com/tabatkins/bikeshed/issues/1180
url:https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type;text:type;for:script;type:element-attr;spec:html
</pre>

<pre class=link-defaults>
spec:infra; type:dfn; text:string
spec:html; type:element; text:script
</pre>


Expand Down Expand Up @@ -460,6 +468,36 @@ is "<code>text/html</code>".
<p>A <dfn>scriptable MIME type</dfn> is an <a>XML MIME type</a>, <a>HTML MIME type</a>, or any
<a>MIME type</a> whose <a for="MIME type">essence</a> is "<code>application/pdf</code>".

<p>A <dfn export>JavaScript MIME type</dfn> is any <a>MIME type</a> whose
<a for="MIME type">essence</a> is one of the following:

<ul class="brief">
<li><code>application/ecmascript</code>
<li><code>application/javascript</code>
<li><code>application/x-ecmascript</code>
<li><code>application/x-javascript</code>
<li><code>text/ecmascript</code>
<li><code>text/javascript</code>
<li><code>text/javascript1.0</code>
<li><code>text/javascript1.1</code>
<li><code>text/javascript1.2</code>
<li><code>text/javascript1.3</code>
<li><code>text/javascript1.4</code>
<li><code>text/javascript1.5</code>
<li><code>text/jscript</code>
<li><code>text/livescript</code>
<li><code>text/x-ecmascript</code>
<li><code>text/x-javascript</code>
</ul>

<p>A <a>string</a> is a <dfn export>JavaScript MIME type essence match</dfn> if it is an
<a>ASCII case-insensitive</a> match for one of the <a>JavaScript MIME type</a> essence strings.

<p class="note">This hook is used by the <{script/type}> attribute of <{script}> elements.

<p>A <dfn export>JSON MIME type</dfn> is any <a>MIME type</a> whose <a for="MIME type">subtype</a>
ends in "<code>+json</code>" or whose <a for="MIME type">essence</a> is
"<code>application/json</code>" or "<code>text/json</code>".


<h2 id=handling-a-resource>Handling a resource</h2>
Expand Down

0 comments on commit 2ca219f

Please sign in to comment.