HTML Standard Tracker

Diff (omit for latest revision)

Short URL:

File a bug

SVNBugCommentTime (UTC)
2697Define handling of MIME type charsets in <script src> external scripts2009-01-23 10:19
Index: source
--- source	(revision 2696)
+++ source	(revision 2697)
@@ -10243,15 +10243,12 @@
   resource. The attribute must not be specified if the <code
   title="attr-script-src">src</code> attribute is not present. If the
   attribute is set, its value must be a valid character encoding name,
-  and must be the preferred name for that encoding. <a
+  must be the preferred name for that encoding, and must match the
+  encoding given in the <code title="">charset</code> parameter of the
+  <span title="Content-Type">Content-Type metadata</span> of the
+  external file, if any. <a
-  <p>The encoding specified must be the encoding used by the script
-  resource. If the <code title="attr-script-charset">charset</code>
-  attribute is omitted, the character encoding of the document will be
-  used. If the script resource uses a different encoding than the
-  document, then the attribute must be specified.</p>
   <p>The <dfn title="attr-script-async"><code>async</code></dfn> and
   <dfn title="attr-script-defer"><code>defer</code></dfn> attributes
   are <span title="boolean attribute">boolean attributes</span> that
@@ -10424,6 +10421,13 @@
     agent must act as if it had received an empty HTTP 400
+    <p>Once the resource's <span title="Content-Type">Content Type
+    metadata</span> is available, if it ever is, apply the
+    <span>algorithm for extracting an encoding from a
+    Content-Type</span> to it. If this returns an encoding, and the
+    user agent supports that encoding, then let <var>the script
+    block's character encoding</var> be that encoding.</p>
     <p>Once the fetching process has completed, and the script has
     <dfn>completed loading</dfn>, the user agent will have to complete
     <span title="when a script completes loading">the steps described