Bugzilla – Bug 98
Clarify requirements for character encoding declarations
Last modified: 2008-03-20 16:10:25 CET
Index: source =================================================================== --- source (revision 1266) +++ source (revision 1267) @@ -5832,9 +5832,9 @@ <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">Content-Type state</span>: as the first element 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">Content-Type 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">Content-Type 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-charset">charset</code> attribute is present, or if the element is in the <span title="attr-meta-http-equiv-content-type">Encoding declaraton state</span>: as the first element 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 declaraton 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 declaraton 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> @@ -6150,19 +6150,19 @@ <dl> - <dt><dfn title="attr-meta-http-equiv-content-type">Encoding declaration</dfn> + <dt><dfn title="attr-meta-http-equiv-content-type">Encoding declaration state</dfn> <dd> - <p>The <span - title="attr-meta-http-equiv-content-type">Content-Type - state's</span> requirements are all handled by the parsing section - of the specification. The state is just an alternative form of - setting the <code title="meta-charset">charset</code> attribute: - it is <a href="#charset">a character encoding declaration</a>.</p> + <p>The <span title="attr-meta-http-equiv-content-type">Encoding + declaration state's</span> user agent requirements are all handled + by the parsing section of the specification. The state is just an + alternative form of setting the <code + title="meta-charset">charset</code> attribute: it is <a + href="#charset">a character encoding declaration</a>.</p> <p>For <code>meta</code> elements in the <span - title="attr-meta-http-equiv-content-type">Content-Type + title="attr-meta-http-equiv-content-type">Encoding declaraton state</span>, the <code title="attr-meta-content">content</code> attribute must have a value consisting of the literal string "<code title="">text/html;</code>", optionally followed by a @@ -6172,15 +6172,15 @@ declaration</a>.</p> <p>If the document contains a <code>meta</code> element in the - <span title="attr-meta-http-equiv-content-type">Content-Type - 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> - - <p>The <span - title="attr-meta-http-equiv-content-type">Content-Type - state</span> may be used in <span title="HTML5">HTML + <span title="attr-meta-http-equiv-content-type">Encoding + declaraton 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> + + <p>The <span title="attr-meta-http-equiv-content-type">Encoding + declaraton 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> @@ -6364,6 +6364,8 @@ the name of a character encoding. This is called a character encoding declaration.</p> + <!-- XXX maybe the rest should move to "writing html" section --> + <p>The following restrictions apply to character encoding declarations:</p> @@ -6382,8 +6384,6 @@ </ul> - <!-- XXX next three paragraphs maybe should move to "writing html" section --> - <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 a superset @@ -6393,7 +6393,10 @@ any character sets we want to support do things outside that range? -->, 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.</p> + with a <code title="attr-meta-charset">charset</code> attribute or a + <code>meta</code> element in the <span + title="attr-meta-http-equiv-content-type">Encoding declaraton + state</span>.</p> <p>Authors should not use JIS_X0212-1990, x-JIS0208, and encodings based on EBCDIC. Authors should not use UTF-32. Authors must not use