HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2556[Authors] [Conformance Checkers] Require <meta charset> within the first 512 bytes. (credit: hs)2008-12-24 08:18
@@ -8979,21 +8979,21 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
   normatively required in the definition of dom-linkstyle-disabled -->
 
 
 
   <h4 id="meta">The <dfn><code>meta</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Metadata content</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
-   <dd>If the <code title="attr-meta-charset">charset</code> attribute is present, or if the element is in the <span title="attr-meta-http-equiv-content-type">Encoding declaration state</span>: as the first element in a <code>head</code> element.</dd>
+   <dd>If the <code title="attr-meta-charset">charset</code> attribute is present, or if the element is in the <span title="attr-meta-http-equiv-content-type">Encoding declaration state</span>: in a <code>head</code> element.</dd>
    <dd>If the <code title="attr-meta-http-equiv">http-equiv</code> attribute is present, and the element is not in the <span title="attr-meta-http-equiv-content-type">Encoding declaration state</span>: in a <code>head</code> element.</dd>
    <dd>If the <code title="attr-meta-http-equiv">http-equiv</code> attribute is present, and the element is not in the <span title="attr-meta-http-equiv-content-type">Encoding declaration state</span>: in a <code>noscript</code> element that is a child of a <code>head</code> element.</dd>
    <dd>If the <code title="attr-meta-name">name</code> attribute is present: where <span>metadata content</span> is expected.</dd>
    <dt>Content model:</dt>
    <dd>Empty.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-meta-name">name</code></dd>
    <dd><code title="attr-meta-http-equiv">http-equiv</code></dd>
    <dd><code title="attr-meta-content">content</code></dd>
    <dd><code title="attr-meta-charset">charset</code> (<span title="HTML documents">HTML</span> only)</dd>
@@ -9031,24 +9031,23 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
   the <code title="attr-meta-content">content</code> attribute must
   also be specified. Otherwise, it must be omitted.</p>
 
   <p>The <dfn title="attr-meta-charset"><code>charset</code></dfn>
   attribute specifies the character encoding used by the
   document. This is called a <span>character encoding
   declaration</span>.</p>
 
   <p>The <code title="attr-meta-charset">charset</code> attribute may
   be specified in <span title="HTML5">HTML documents</span> only, it
-  must not be used in <span title="XHTML">XML documents</span>. If the
-  <code title="attr-meta-charset">charset</code> attribute is
-  specified, the element must be the first element in <span>the
-  <code>head</code> element</span> of the file.</p>
+  must not be used in <span title="XHTML">XML documents</span>. There
+  must not be more than one element with a <code
+  title="attr-meta-charset">charset</code> attribute per document.</p>
 
   <p>The <dfn title="attr-meta-content"><code>content</code></dfn>
   attribute gives the value of the document metadata or pragma
   directive when the element is used for those purposes. The allowed
   values depend on the exact context, as described in subsequent
   sections of this specification.</p>
 
   <p>If a <code>meta</code> element has a <dfn
   title="attr-meta-name"><code>name</code></dfn> attribute, it sets
   document metadata. Document metadata is expressed in terms of
@@ -9380,25 +9379,23 @@ people expect to have work and what is necessary.
     attribute must have a value that is an <span>ASCII
     case-insensitive</span> match for a string that consists of: the
     literal string "<code title="">text/html;</code>", optionally
     followed by any number of <span title="space character">space
     characters</span>, followed by the literal string "<code
     title="">charset=</code>", followed by the character encoding name
     of <a href="#charset">the character encoding declaration</a>.</p>
 
     <p>If the document contains a <code>meta</code> element in the
     <span title="attr-meta-http-equiv-content-type">Encoding
-    declaration state</span> then that element must be the first
-    element in the document's <code>head</code> element, and the
-    document must not contain a <code>meta</code> element with the
-    <code title="attr-meta-charset">charset</code> attribute
-    present.</p>
+    declaration state</span>, then the document must not contain a
+    <code>meta</code> element with the <code
+    title="attr-meta-charset">charset</code> attribute present.</p>
 
     <p>The <span title="attr-meta-http-equiv-content-type">Encoding
     declaration state</span> may be used in <span title="HTML5">HTML
     documents</span> only, elements in that state must not be used in
     <span title="XHTML">XML documents</span>.</p>
 
    </dd>
 
    <dt><dfn title="attr-meta-http-equiv-default-style">Default style state</dfn>
 
@@ -9642,20 +9639,24 @@ people expect to have work and what is necessary.
 
    <li>The value must be a valid character encoding name, and must be
    the preferred name for that encoding. <a
    href="#refsIANACHARSET">[IANACHARSET]</a> <!-- XXX
    http://www.iana.org/assignments/character-sets --></li>
 
    <li>The character encoding declaration must be serialized without
    the use of <span title="syntax-charref">character references</span>
    or character escapes of any kind.</li>
 
+   <li id="charset512">The element containing the character encoding
+   declaration must be serialised completely within the first 512
+   bytes of the document.</p>
+
   </ul>
 
   <p>If the document does not start with a BOM, and if its encoding is
   not explicitly given by <span title="Content-Type">Content-Type
   metadata</span>, then the character encoding used must be an
   <span>ASCII-compatible character encoding</span>, and, in addition,
   if that encoding isn't US-ASCII itself, then the encoding must be
   specified using a <code>meta</code> element with a <code
   title="attr-meta-charset">charset</code> attribute or a
   <code>meta</code> element in the <span

|