-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: update usage of the MIME Sniffing Standard #3455
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits here are a bit off-topic.
@@ -57289,18 +57293,18 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> { | |||
<li><p>Setting the attribute to any other value means that the script is a <dfn>data | |||
block</dfn>, which is not processed. None of the <code>script</code> attributes (except <code | |||
data-x="attr-script-type">type</code> itself) have any effect on data blocks. Authors must use | |||
a <span>valid MIME type</span> that is not a <span>JavaScript MIME type</span> to denote data | |||
blocks.</p></li> | |||
a <span>valid MIME type string</span> that is not a <span>JavaScript MIME type essence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really want to allow text/javascript;test=test
to denote a data block.
source
Outdated
MIME type essence match</span> concept. (In general, it is best not to think of the | ||
<code>script</code> element's <code data-x="attr-script-type">type</code> attribute as related to | ||
MIME types; instead, it has a hard-coded list of strings, which resemble certain MIME types, that | ||
for historical reasons will trigger the same default behavior as omitting the attribute.)</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This newly added text is incorrect as we want you to think about MIME types for data blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'll just delete it... I still think there's a grain of truth here, but capturing all the subtleties seems hard.
source
Outdated
|
||
<p class="note">For example, scripts with their <code data-x="attr-script-type">type</code> | ||
attribute set to "<code data-x="">text/javascript; charset=utf-8</code>" will not be | ||
evaluated.</p> | ||
evaluated, even though that is a valid <span>JavaScript MIME type</span>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add ", when parsed"?
@@ -92583,7 +92565,7 @@ interface <dfn>MimeType</dfn> { | |||
method.</p> | |||
|
|||
<p>The <dfn><code data-x="dom-MimeType-type">type</code></dfn> attribute must return the | |||
<span>valid MIME type with no parameters</span> describing the <span>MIME type</span>.</p> | |||
<span>valid MIME type string with no parameters</span> describing the <span>MIME type</span>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make much sense to me, but I guess that goes for the original too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, without re-doing this entire section to be on a more rigorous foundation, I think this is the best we're going to get. (Which is probably not worth the work given how at least some browsers always return empty for these.)
This follows whatwg/mimesniff#58 by referencing the definitions for JavaScript and JSON MIME type that now live in MIME Sniffing. It also follows whatwg/mimesniff#36 by using the terms "valid MIME type string" and "valid MIME type string without parameters" instead of their non-string counterparts that previously appeared.
f7a48c3
to
a02afea
Compare
source
Outdated
<p>The term <dfn>JSON MIME type</dfn> is used to refer to the <span data-x="MIME type">MIME | ||
types</span> <code>application/json</code>, <code>text/json</code>, and any <span>MIME | ||
type</span> whose subtype ends with the five characters "<code data-x="">+json</code>". | ||
|
||
<p>An <dfn>explicitly supported JSON type</dfn> is one for which the user agent is configured to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, should we update this at the same time to say JSON MIME type? And make this sentence refer to JSON MIME type?
This follows whatwg/mimesniff#58 by referencing
the definitions for JavaScript and JSON MIME type that now live in MIME
Sniffing. It also follows whatwg/mimesniff#36 by
using the terms "valid MIME type string" and "valid MIME type string
without parameters" instead of their non-string counterparts that
previously appeared.
"do not merge yet" until whatwg/mimesniff#58 gets merged. Editorial review still appreciated.
/browsing-the-web.html ( diff )
/embedded-content.html ( diff )
/iframe-embed-object.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/input.html ( diff )
/links.html ( diff )
/obsolete.html ( diff )
/scripting.html ( diff )
/semantics.html ( diff )
/system-state.html ( diff )
/webappapis.html ( diff )