Skip to content
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

Merged
merged 3 commits into from
Feb 16, 2018

Conversation

domenic
Copy link
Member

@domenic domenic commented Feb 5, 2018

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 )

@domenic domenic added the do not merge yet Pull request must not be merged per rationale in comment label Feb 5, 2018
Copy link
Member

@annevk annevk left a 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
Copy link
Member

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>
Copy link
Member

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.

Copy link
Member Author

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>
Copy link
Member

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>
Copy link
Member

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...

Copy link
Member Author

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.
@domenic domenic removed the do not merge yet Pull request must not be merged per rationale in comment label Feb 16, 2018
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
Copy link
Member

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?

@domenic domenic merged commit fc82f4f into master Feb 16, 2018
@domenic domenic deleted the move-mime-type-groups branch February 16, 2018 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants