Skip to content

Commit

Permalink
Make <script charset> non-conforming
Browse files Browse the repository at this point in the history
Fixes #3004.
  • Loading branch information
annevk committed Sep 5, 2017
1 parent ea14be5 commit f643895
Showing 1 changed file with 24 additions and 36 deletions.
60 changes: 24 additions & 36 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -57316,7 +57316,6 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<dd><code data-x="attr-script-src">src</code></dd>
<dd><code data-x="attr-script-type">type</code></dd>
<dd><code data-x="attr-script-nomodule">nomodule</code></dd>
<dd><code data-x="attr-script-charset">charset</code></dd>
<dd><code data-x="attr-script-async">async</code></dd>
<dd><code data-x="attr-script-defer">defer</code></dd>
<dd><code data-x="attr-script-crossorigin">crossorigin</code></dd>
Expand All @@ -57330,7 +57329,6 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute USVString <span data-x="dom-script-src">src</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-script-type">type</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-script-noModule">noModule</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-script-charset">charset</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-script-async">async</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-script-defer">defer</span>;
[<span>CEReactions</span>] attribute DOMString? <span data-x="dom-script-crossOrigin">crossOrigin</span>;
Expand All @@ -57354,17 +57352,15 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
<li><p>Omitting the attribute, or setting it to a <span>JavaScript MIME type</span>, means that
the script is a <span>classic script</span>, to be interpreted according to the JavaScript <i
data-x="js-prod-Script">Script</i> top-level production. Classic scripts are affected by the
<code data-x="attr-script-charset">charset</code>, <code
data-x="attr-script-async">async</code>, and <code data-x="attr-script-defer">defer</code>
<code data-x="attr-script-async">async</code>, and <code data-x="attr-script-defer">defer</code>
attributes. Authors should omit the attribute, instead of redundantly giving a <span>JavaScript
MIME type</span>.</p></li>

<li><p>Setting the attribute to an <span>ASCII case-insensitive</span> match for the string
"<code data-x="">module</code>" means that the script is a <span>module script</span>, to be
interpreted according to the JavaScript <i data-x="js-prod-Module">Module</i> top-level
production. Module scripts are not affected by the <code
data-x="attr-script-charset">charset</code> and <code data-x="attr-script-defer">defer</code>
attributes.</p></li>
production. Module scripts are not affected by the <code data-x="attr-script-defer">defer</code>
attribute.</p></li>

<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
Expand Down Expand Up @@ -57398,11 +57394,11 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
inline, the format of the data must be given using the <code
data-x="attr-script-type">type</code> attribute, and the contents of the <code>script</code>
element must conform to the requirements defined for the format used. The <code
data-x="attr-script-src">src</code>, <code data-x="attr-script-charset">charset</code>, <code
data-x="attr-script-async">async</code>, <code data-x="attr-script-nomodule">nomodule</code>,
<code data-x="attr-script-defer">defer</code>, <code
data-x="attr-script-crossorigin">crossorigin</code>, <code data-x="attr-script-nonce">nonce</code>
and <code data-x="attr-script-integrity">integrity</code> attributes must not be specified.</p>
data-x="attr-script-src">src</code>, <code data-x="attr-script-async">async</code>, <code
data-x="attr-script-nomodule">nomodule</code>, <code data-x="attr-script-defer">defer</code>,
<code data-x="attr-script-crossorigin">crossorigin</code>, <code
data-x="attr-script-nonce">nonce</code> and <code data-x="attr-script-integrity">integrity</code>
attributes must not be specified.</p>

<p>The <dfn><code data-x="attr-script-nomodule">nomodule</code></dfn> attribute is a <span>boolean
attribute</span> that prevents a script from being executed in user agents that support
Expand All @@ -57413,16 +57409,6 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
specified on <span data-x="module script">module scripts</span> (and will be ignored if it
is).</p>

<p>The <dfn><code data-x="attr-script-charset">charset</code></dfn> attribute gives the character
encoding of the external script resource. The attribute must not be specified if the <code
data-x="attr-script-src">src</code> attribute is not present, or if the script is not a
<span>classic script</span>. (<span data-x="module script">Module scripts</span> are always
interpreted as UTF-8.) If the attribute is set, its value must be an <span>ASCII
case-insensitive</span> match for one of the <span data-x="encoding label">labels</span> of an
<span>encoding</span>, and must specify the same <span>encoding</span> as the <code
data-x="">charset</code> parameter of the <span data-x="Content-Type">Content-Type
metadata</span> of the external file, if any. <ref spec=ENCODING></p>

<p>The <dfn><code data-x="attr-script-async">async</code></dfn> and <dfn><code
data-x="attr-script-defer">defer</code></dfn> attributes are <span data-x="boolean
attribute">boolean attributes</span> that indicate how the script should be evaluated. <span
Expand Down Expand Up @@ -57500,8 +57486,7 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {


<p>Changing the <code data-x="attr-script-src">src</code>, <code
data-x="attr-script-type">type</code>, <code data-x="attr-script-charset">charset</code>, <code
data-x="attr-script-nomodule">nomodule</code>, <code
data-x="attr-script-type">type</code>, <code data-x="attr-script-nomodule">nomodule</code>, <code
data-x="attr-script-async">async</code>, <code data-x="attr-script-defer">defer</code>, <code
data-x="attr-script-crossorigin">crossorigin</code>, <code data-x="attr-script-nonce">nonce</code>
and <code data-x="attr-script-integrity">integrity</code> attributes dynamically has no direct
Expand All @@ -57512,7 +57497,6 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {

<p>The IDL attributes <dfn><code data-x="dom-script-src">src</code></dfn>, <dfn><code
data-x="dom-script-type">type</code></dfn>, <dfn><code
data-x="dom-script-charset">charset</code></dfn>, <dfn><code
data-x="dom-script-defer">defer</code></dfn>, <dfn><code
data-x="dom-script-integrity">integrity</code></dfn>, and <dfn><code
data-x="dom-script-nonce">nonce</code></dfn>, must each <span>reflect</span> the respective
Expand Down Expand Up @@ -89872,14 +89856,6 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent

<hr>

<!-- this guy is only on Document and not on HTMLElement because otherwise HTMLScriptElement would
have it and that causes compatibility issues since IE fires readystatechange events on <script>,
not load events, and we can't fire both, and some sites try to decide which to look for based on
the presence of script.onreadystatechange on HTMLScriptElement.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13965
https://lists.w3.org/Archives/Public/public-whatwg-archive/2011Sep/0074.html
-->

<p>The following are the <span>event handlers</span> (and their corresponding <span
data-x="event handler event type">event handler event types</span>) <span w-nodev>that must be</span>
supported by all <span>HTML elements</span>, as both <span>event handler content attributes</span>
Expand All @@ -89895,10 +89871,20 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
<tr><td><dfn><code data-x="handler-onpaste">onpaste</code></dfn> <td> <code data-x="event-paste">paste</code>
</table>

<hr>

<p>The following are the <span>event handlers</span> (and their corresponding <span data-x="event
handler event type">event handler event types</span>) <span w-nodev>that must be</span>
supported on <code>Document</code> objects as <span>event handler IDL attributes</span>:</p>

<!-- this is only on Document and not on HTMLElement because otherwise HTMLScriptElement would
have it and that causes compatibility issues since IE fires readystatechange events on <script>,
not load events, and we can't fire both, and some sites try to decide which to look for based on
the presence of script.onreadystatechange on HTMLScriptElement.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13965
https://lists.w3.org/Archives/Public/public-whatwg-archive/2011Sep/0074.html
-->

<table>
<thead>
<tr><th><span data-x="event handlers">Event handler</span> <th><span>Event handler event type</span>
Expand Down Expand Up @@ -113106,6 +113092,7 @@ if (s = prompt('What is your name?')) {

<dt><dfn><code data-x="attr-a-charset">charset</code></dfn> on <code>a</code> elements</dt>
<dt><dfn><code data-x="attr-link-charset">charset</code></dfn> on <code>link</code> elements</dt>
<dt><dfn><code data-x="attr-script-charset">charset</code></dfn> on <code>script</code> elements</dt>
<dd><p>Use an HTTP `<code>Content-Type</code>` header on the linked resource instead.</p></dd>

<dt><dfn><code data-x="attr-a-coords">coords</code></dfn> on <code>a</code> elements</dt>
Expand Down Expand Up @@ -114194,13 +114181,14 @@ interface <dfn>HTMLFontElement</dfn> : <span>HTMLElement</span> {
<hr>

<pre class="idl">partial interface <span id="HTMLScriptElement-partial">HTMLScriptElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-script-charset">charset</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-script-event">event</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-script-htmlFor">htmlFor</span>;
};</pre>

<p>The <dfn><code data-x="dom-script-event">event</code></dfn> IDL attribute of the
<code>script</code> element must <span>reflect</span> the element's
<code data-x="attr-script-event">event</code> content attribute.</p>
<p>The <dfn><code data-x="dom-script-event">charset</code></dfn> and <dfn><code
data-x="dom-script-event">event</code></dfn> IDL attributes of the <code>script</code> element
must <span>reflect</span> the content attributes of the same name.</p>

<p>The <dfn><code data-x="dom-script-htmlFor">htmlFor</code></dfn> IDL attribute of the
<code>script</code> element must <span>reflect</span> the element's
Expand Down

0 comments on commit f643895

Please sign in to comment.