Browse files

[ac] (0) Require <meta charset> within the first 512 bytes. (credit: hs)

git-svn-id: http://svn.whatwg.org/webapps@2556 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent e6cafa9 commit 12e0e540c1fbd50d8576d6e1ce03da11eb1c87dc @Hixie Hixie committed Dec 24, 2008
Showing with 20 additions and 20 deletions.
  1. +9 −10 index
  2. +11 −10 source
View
19 index
@@ -8643,7 +8643,7 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
<dl class=element><dt>Categories</dt>
<dd><a href=#metadata-content-0>Metadata content</a>.</dd>
<dt>Contexts in which this element may be used:</dt>
- <dd>If the <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute is present, or if the element is in the <a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding declaration state</a>: as the first element in a <code><a href=#the-head-element>head</a></code> element.</dd>
+ <dd>If the <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute is present, or if the element is in the <a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding declaration state</a>: in a <code><a href=#the-head-element>head</a></code> element.</dd>
<dd>If the <code title=attr-meta-http-equiv><a href=#attr-meta-http-equiv>http-equiv</a></code> attribute is present, and the element is not in the <a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding declaration state</a>: in a <code><a href=#the-head-element>head</a></code> element.</dd>
<dd>If the <code title=attr-meta-http-equiv><a href=#attr-meta-http-equiv>http-equiv</a></code> attribute is present, and the element is not in the <a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding declaration state</a>: in a <code><a href=#the-noscript-element>noscript</a></code> element that is a child of a <code><a href=#the-head-element>head</a></code> element.</dd>
<dd>If the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code> attribute is present: where <a href=#metadata-content-0>metadata content</a> is expected.</dd>
@@ -8689,10 +8689,8 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
<p>The <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute may
be specified in <a href=#html5 title=HTML5>HTML documents</a> only, it
- must not be used in <a href=#xhtml5 title=XHTML>XML documents</a>. If the
- <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute is
- specified, the element must be the first element in <a href=#the-head-element-0>the
- <code>head</code> element</a> of the file.</p>
+ must not be used in <a href=#xhtml5 title=XHTML>XML documents</a>. There
+ must not be more than one element with a <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute per document.</p>
<p>The <dfn id=attr-meta-content title=attr-meta-content><code>content</code></dfn>
attribute gives the value of the document metadata or pragma
@@ -8988,11 +8986,8 @@ people expect to have work and what is necessary.
<p>If the document contains a <code><a href=#meta>meta</a></code> element in the
<a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding
- declaration state</a> then that element must be the first
- element in the document's <code><a href=#the-head-element>head</a></code> element, and the
- document must not contain a <code><a href=#meta>meta</a></code> element with the
- <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute
- present.</p>
+ declaration state</a>, then the document must not contain a
+ <code><a href=#meta>meta</a></code> element with the <code title=attr-meta-charset><a href=#attr-meta-charset>charset</a></code> attribute present.</p>
<p>The <a href=#attr-meta-http-equiv-content-type title=attr-meta-http-equiv-content-type>Encoding
declaration state</a> may be used in <a href=#html5 title=HTML5>HTML
@@ -9206,6 +9201,10 @@ people expect to have work and what is necessary.
the use of <a href=#syntax-charref title=syntax-charref>character references</a>
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.
+
</ul><p>If the document does not start with a BOM, and if its encoding is
not explicitly given by <a href=#content-type-0 title=Content-Type>Content-Type
metadata</a>, then the character encoding used must be an
View
21 source
@@ -8986,7 +8986,7 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
<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>
@@ -9038,10 +9038,9 @@ Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ d
<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
@@ -9387,11 +9386,9 @@ people expect to have work and what is necessary.
<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
@@ -9649,6 +9646,10 @@ people expect to have work and what is necessary.
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

0 comments on commit 12e0e54

Please sign in to comment.