| 11 |
<body> |
<body> |
| 12 |
<h1>Description of Errors</h1> |
<h1>Description of Errors</h1> |
| 13 |
|
|
| 14 |
|
<section id="html5-character-encoding"> |
| 15 |
|
<h2>HTML5 Character Encoding Errors</h2> |
| 16 |
|
|
| 17 |
|
<d:item name="character encoding" class="format-charset must" level="m"> |
| 18 |
|
<d:message xml:lang="en">Character encoding <code><var>$0</var></code> |
| 19 |
|
is not allowed for <abbr>HTML</abbr> document.</d:message> |
| 20 |
|
<d:desc xml:lang="en"> |
| 21 |
|
<p>The character encoding used for the document is not allowed |
| 22 |
|
for <abbr>HTML</abbr> document. The document is non‐conforming.</p> |
| 23 |
|
</d:desc> |
| 24 |
|
</d:item> |
| 25 |
|
|
| 26 |
|
<d:item name="character encoding" class="format-charset should" |
| 27 |
|
level="s"> |
| 28 |
|
<d:message xml:lang="en">Character encoding <code><var>$0</var></code> |
| 29 |
|
should not be used for <abbr>HTML</abbr> document.</d:message> |
| 30 |
|
<d:desc xml:lang="en"> |
| 31 |
|
<p>The character encoding used for the document is not recommended |
| 32 |
|
for <abbr>HTML</abbr> document. The document is non‐conforming |
| 33 |
|
unless there is any good reason to use that encoding.</p> |
| 34 |
|
</d:desc> |
| 35 |
|
</d:item> |
| 36 |
|
|
| 37 |
|
<d:item name="character encoding" class="format-charset warning" |
| 38 |
|
level="w"> |
| 39 |
|
<d:message xml:lang="en">Use of UTF-8 is encouraged.</d:message> |
| 40 |
|
<d:desc xml:lang="en"> |
| 41 |
|
<p>Use of UTF-8 as the character encoding of the document is encouraged, |
| 42 |
|
though the use of another character encoding is conforming.</p> |
| 43 |
|
</d:desc> |
| 44 |
|
</d:item> |
| 45 |
|
|
| 46 |
|
<d:item name="no character encoding declaration" class="format-charset error" |
| 47 |
|
level="m"> |
| 48 |
|
<d:message xml:lang="en">There is no character encoding |
| 49 |
|
declaration.</d:message> |
| 50 |
|
<d:desc xml:lang="en"> |
| 51 |
|
<p>The document does not contain a character encoding |
| 52 |
|
declaration. Unless the character encoding is explicitly |
| 53 |
|
specified in upper‐level protocol, e.g. in <abbr>HTTP</abbr>, |
| 54 |
|
or is implied by <abbr>BOM</abbr>, there must be a character |
| 55 |
|
encoding declaration. The document is non‐conforming.</p> |
| 56 |
|
|
| 57 |
|
<p>The long character encoding declaration syntax |
| 58 |
|
<code class="html bad example"><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
| 59 |
|
is obsolete. The new syntax is:</p> |
| 60 |
|
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
| 61 |
|
|
| 62 |
|
<p>Note that the <code>encoding</code> declaration in <abbr>XML</abbr> |
| 63 |
|
declaration has no effect for <abbr>HTML</abbr> document.</p> |
| 64 |
|
</d:desc> |
| 65 |
|
</d:item> |
| 66 |
|
|
| 67 |
|
<d:item name="non ascii superset" class="format-charset error" |
| 68 |
|
level="m"> |
| 69 |
|
<d:message xml:lang="en">No character encoding metadata is found |
| 70 |
|
in upper‐level protocol nor is there <abbr>BOM</abbr>, while |
| 71 |
|
character encoding <code><var>$0</var></code> |
| 72 |
|
is not a superset of <abbr>ASCII</abbr>.</d:message> |
| 73 |
|
<d:desc xml:lang="en"> |
| 74 |
|
<p>The document is not labeled with character encoding name |
| 75 |
|
in upper‐level protocol, e.g. in <abbr>HTTP</abbr>, and |
| 76 |
|
the document is not begin with <abbr>BOM</abbr>. In addition, |
| 77 |
|
the character encoding of the document is not a superset of |
| 78 |
|
<abbr>ASCII</abbr>. The document is non‐conforming.</p> |
| 79 |
|
|
| 80 |
|
<p>Unless there is a <abbr>BOM</abbr>, the character encoding |
| 81 |
|
for the document must be specified in e.g. <abbr>HTTP</abbr>‐level, |
| 82 |
|
as:</p> |
| 83 |
|
<pre class="http example"><code>Content-Type: text/html; charset=<var>charset-name</var></code></pre> |
| 84 |
|
|
| 85 |
|
<p>Existence of <abbr>HTML</abbr> character encoding declaration, i.e. |
| 86 |
|
<code class="html example"><meta charset="<var>charset-name</var>"></code>, |
| 87 |
|
does not allow to omit <code>charset</code> parameter |
| 88 |
|
for <abbr>HTML</abbr> document encoded in non‐<abbr>ASCII</abbr> |
| 89 |
|
compatible encoding.</p> |
| 90 |
|
|
| 91 |
|
<p>Character encodings <code>Shift_JIS</code>, <code>Windows-31J</code>, |
| 92 |
|
and <code>ISO-2022-JP</code> are <em>not</em> a superset of |
| 93 |
|
<abbr>ASCII</abbr> for the purpose of <abbr>HTML</abbr> conformance.</p> |
| 94 |
|
</d:desc> |
| 95 |
|
</d:item> |
| 96 |
|
|
| 97 |
|
<d:item name="charset label detected" class="format-charset warning" |
| 98 |
|
level="w"> |
| 99 |
|
<d:message xml:lang="en">While parsing the document as |
| 100 |
|
<code><var>$0</var></code>, a character encoding declaration specifying |
| 101 |
|
character encoding as <code><var>$1</var></code> is found. The document |
| 102 |
|
is reparsed.</d:message> |
| 103 |
|
<d:desc xml:lang="en"> |
| 104 |
|
<p>While parsing a document in a character encoding, |
| 105 |
|
a character encoding declaration which declares the character |
| 106 |
|
encoding of the document as another character encoding is found. |
| 107 |
|
The occurence of this warning itself does not make the document |
| 108 |
|
non‐conforming. However, the failure of the first attempt to |
| 109 |
|
to detect the character encoding might be the result of non‐conformance |
| 110 |
|
of the document.</p> |
| 111 |
|
|
| 112 |
|
<p>The document will be reparsed from the beginning. Some error |
| 113 |
|
or warning might be reported again.</p> |
| 114 |
|
|
| 115 |
|
<p>These are suggestions to avoid this warning:</p> |
| 116 |
|
<ul> |
| 117 |
|
<li>Specify <code>charset</code> parameter in the <code>Content-Type</code> |
| 118 |
|
field in the <abbr>HTTP</abbr> header, as: |
| 119 |
|
<pre class="HTTP example"><code>Content-Type: text/html; charset="<var>charset-name</var>"</code></pre></li> |
| 120 |
|
<li>Put the character encoding declaration |
| 121 |
|
(<code class="html example"><meta charset="<var>charset-name</var>"></code>) |
| 122 |
|
just after <code class="html example"><head></code> start tag.</li> |
| 123 |
|
<li>Use <code>UTF-8</code>.</li> |
| 124 |
|
</ul> |
| 125 |
|
</d:desc> |
| 126 |
|
</d:item> |
| 127 |
|
</section> |
| 128 |
|
|
| 129 |
<section id="html5-tokenize-error"> |
<section id="html5-tokenize-error"> |
| 130 |
<h2>HTML5 Parse Errors in Tokenization Stage</h2> |
<h2>HTML5 Parse Errors in Tokenization Stage</h2> |
| 131 |
|
|
| 163 |
<d:message xml:lang="en">The <code>&</code> character must |
<d:message xml:lang="en">The <code>&</code> character must |
| 164 |
introduce a reference.</d:message> |
introduce a reference.</d:message> |
| 165 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
| 166 |
<p>An <code>&</code> (<code>U+0026</code> |
<p>An <code>&</code> character which |
|
<code class="charname">AMPERSAND</code>) character which |
|
| 167 |
is not part of any reference appears in the input stream. |
is not part of any reference appears in the input stream. |
| 168 |
The document is non-conforming.</p> |
The document is non‐conforming.</p> |
| 169 |
|
|
| 170 |
<p><strong>Any <code>&</code> character in URI (or IRI) |
<p><em>Any <code>&</code> character in URI (or IRI) |
| 171 |
must be escaped as <code>&amp;</code>.</strong></p> |
must be escaped as <code class="example">&amp;</code>.</em></p> |
| 172 |
|
|
| 173 |
<p>The <code>&</code> character must |
<p>The <code>&</code> character must |
| 174 |
be the first character of a reference: |
be the first character of a reference: |
| 175 |
<dl> |
<dl class="switch"> |
| 176 |
<dt>Named entity reference</dt> |
<dt>Named entity reference</dt> |
| 177 |
<dd><pre class="html example"><code>&<var>entity-name</var>;</code></pre> |
<dd><pre class="html example"><code>&<var>entity-name</var>;</code></pre> |
| 178 |
where <var>entity-name</var> is the name of the |
where <var>entity-name</var> is the name of the |
| 248 |
|
|
| 249 |
<p>The string <code>&#</code> must be the first two characters |
<p>The string <code>&#</code> must be the first two characters |
| 250 |
of a reference: |
of a reference: |
| 251 |
<dl> |
<dl class="switch"> |
| 252 |
<dt>Numeric character reference</dt> |
<dt>Numeric character reference</dt> |
| 253 |
<dd><pre class="html example"><code>&#<var>d</var>;</code></pre> |
<dd><pre class="html example"><code>&#<var>d</var>;</code></pre> |
| 254 |
where <var>d</var> is the decimal representation of |
where <var>d</var> is the decimal representation of |
| 303 |
|
|
| 304 |
<dl class="switch"> |
<dl class="switch"> |
| 305 |
<dt>Comments</dt> |
<dt>Comments</dt> |
| 306 |
<dd>In HTML documents, comments must be introduced by |
<dd>In HTML document, comments must be introduced by |
| 307 |
<code><!--</code> (<code><!</code> <em>immediately</em> followed |
<code class="example"><!--</code> (<code><!</code> |
| 308 |
|
<em>immediately</em> followed |
| 309 |
by <em>two</em> <code>-</code>s) and must be terminated by |
by <em>two</em> <code>-</code>s) and must be terminated by |
| 310 |
<code>--></code>. Strings <code><!</code> not followed |
<code class="example">--></code>. |
| 311 |
|
Strings <code><!</code> not followed |
| 312 |
by <code>--</code> and <code><!-</code> not followed by |
by <code>--</code> and <code><!-</code> not followed by |
| 313 |
<code>-</code> are not valid open delimiters for comments.</dd> |
<code>-</code> are not valid open delimiters for comments.</dd> |
| 314 |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
| 315 |
<dd>Marked sections are not allowed in HTML documents.</dd> |
<dd>Marked sections are not allowed in HTML document.</dd> |
| 316 |
<dt>Markup declarations</dt> |
<dt>Markup declarations</dt> |
| 317 |
<dd>Markup declarations, except <code>DOCTYPE</code> |
<dd>Markup declarations, except for <code>DOCTYPE</code> |
| 318 |
and comment declarations, are not allowed in HTML documents.</dd> |
and comment declarations, are not allowed in HTML document.</dd> |
| 319 |
<dt>String <code><!</code></dt> |
<dt>String <code><!</code></dt> |
| 320 |
<dd>String <code><!</code> must be escaped as |
<dd>String <code><!</code> must be escaped as |
| 321 |
<code>&lt;!</code>.</dd> |
<code class="example">&lt;!</code>.</dd> |
| 322 |
</dl> |
</dl> |
| 323 |
</d:desc> |
</d:desc> |
| 324 |
</d:item> |
</d:item> |
| 393 |
<dt><code><script/></code></dt> |
<dt><code><script/></code></dt> |
| 394 |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
| 395 |
element. Even for an empty <code>script</code> element, |
element. Even for an empty <code>script</code> element, |
| 396 |
there must be an explicit end tag <code></script></code>.</p> |
there must be an explicit end tag |
| 397 |
|
<code class="html example"></script></code>.</p> |
| 398 |
|
|
| 399 |
<p><strong>NOTE</strong>: Though some user agents interpret |
<p><strong>NOTE</strong>: Though some user agents interpret |
| 400 |
polytheistic slash for <code>script</code> element as the |
polytheistic slash for <code>script</code> element as the |
| 411 |
to allow polytheistic slash for these elements.</dd> |
to allow polytheistic slash for these elements.</dd> |
| 412 |
<dt><code><a/></code>, <code><p/></code></dt> |
<dt><code><a/></code>, <code><p/></code></dt> |
| 413 |
<dd>These elements are not always empty and therefore |
<dd>These elements are not always empty and therefore |
| 414 |
polytheistic slash is not allowed.</dd> |
polytheistic slash is not allowed. Use explicit end tag |
| 415 |
|
to represent empty element as: |
| 416 |
|
<pre class="example html"><code><p></p></code></pre> |
| 417 |
|
</dd> |
| 418 |
</dl> |
</dl> |
| 419 |
|
|
| 420 |
<p>Note that, unlike in XML, the polytheistic slash has |
<p>Note that, unlike in XML, the polytheistic slash has |
| 439 |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
| 440 |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
| 441 |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
| 442 |
style sheet.</dd> |
style sheet as: |
| 443 |
|
<pre class="html example"><code><style> |
| 444 |
|
p { |
| 445 |
|
binding: url(binding.xbl); |
| 446 |
|
} |
| 447 |
|
</style></code></pre> |
| 448 |
|
</dd> |
| 449 |
<dt><code><?xml?></code> (XML declaration)</dt> |
<dt><code><?xml?></code> (XML declaration)</dt> |
| 450 |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
| 451 |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
| 453 |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
| 454 |
attribute set to <code>stylesheet</code> (or, |
attribute set to <code>stylesheet</code> (or, |
| 455 |
<code>alternate stylesheet</code> for an alternate style |
<code>alternate stylesheet</code> for an alternate style |
| 456 |
sheet).</dd> |
sheet). |
| 457 |
|
<pre class="example html"><code><link rel=stylesheet href="path/to/stylesheet.css"></code></pre> |
| 458 |
|
</dd> |
| 459 |
<dt><code><?php?></code> or |
<dt><code><?php?></code> or |
| 460 |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
| 461 |
(<abbr>PHP</abbr> code)</dt> |
(<abbr>PHP</abbr> code)</dt> |
| 634 |
<dd>Though the element is void in earlier versions of Safari, |
<dd>Though the element is void in earlier versions of Safari, |
| 635 |
the <code>canvas</code> element is <em>no</em> longer |
the <code>canvas</code> element is <em>no</em> longer |
| 636 |
defined as empty. There must be an end tag |
defined as empty. There must be an end tag |
| 637 |
<code></canvas></code>.</dd> |
<code class="html example"></canvas></code>.</dd> |
| 638 |
</dl> |
</dl> |
| 639 |
|
|
| 640 |
<p>Note that misnesting tags, such as |
<p>Note that misnesting tags, such as |
| 668 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
| 669 |
<p>The document contains a <code>DOCTYPE</code> declaration |
<p>The document contains a <code>DOCTYPE</code> declaration |
| 670 |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
| 671 |
<code><!DOCTYPE HTML></code>). The document is non-conforming.</p> |
<code class="example html"><!DOCTYPE HTML></code>). |
| 672 |
|
The document is non‐conforming.</p> |
| 673 |
|
|
| 674 |
<p>The document might or might not be conformant to |
<p>The document might or might not be conformant to |
| 675 |
some version of HTML. However, conformance to any HTML |
some version of HTML. However, conformance to any HTML |
| 801 |
block-level content, any inline-level content must be |
block-level content, any inline-level content must be |
| 802 |
put in e.g. paragraph element such as <code>p</code>.</p> |
put in e.g. paragraph element such as <code>p</code>.</p> |
| 803 |
<p>For example, an HTML document fragment |
<p>For example, an HTML document fragment |
| 804 |
<code class="bad example"><div><p>Hello!</p> World!</div></code> |
<code class="html bad example"><div><p>Hello!</p> World!</div></code> |
| 805 |
is non-conforming, since a word <q>World!</q> does not belong |
is non-conforming, since a word <q>World!</q> does not belong |
| 806 |
to any paragraph. (If not part of any paragraph, what is |
to any paragraph. (If not part of any paragraph, what is |
| 807 |
it!?) A conforming example would be: |
it!?) A conforming example would be: |
| 808 |
<pre class="example"><code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
<pre class="html example"><code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
| 809 |
</p></dd> |
</p></dd> |
| 810 |
<dt>If the parent element does <em>not</em> allow |
<dt>If the parent element does <em>not</em> allow |
| 811 |
block-level elements as content</dt> |
block-level elements as content</dt> |
| 849 |
|
|
| 850 |
<dl class="switch"> |
<dl class="switch"> |
| 851 |
<dt><code>html</code> element in an XHTML document</dt> |
<dt><code>html</code> element in an XHTML document</dt> |
| 852 |
<dd><p>In an XHTML document, the root <code>html</code> |
<dd><p>In <abbr>XHTML</abbr> document, the root <code>html</code> |
| 853 |
element must have an <code>xmlns</code> attribute |
element must have an <code>xmlns</code> attribute as: |
| 854 |
whose value is set to |
<pre class="xml example"><code><html xmlns="http://www.w3.org/1999/xhtml"></code></pre></p></dd> |
|
<code>http://www.w3.org/1999/xhtml</code>.</p></dd> |
|
| 855 |
<dt><code>rss</code> element</dt> |
<dt><code>rss</code> element</dt> |
| 856 |
<dd><p>The document is written in some version of RSS.</p> |
<dd><p>The document is written in some version of RSS.</p> |
| 857 |
<p>The conformance checker does not support any version |
<p>The conformance checker does not support any version |
| 858 |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
| 859 |
<dt><code>feed</code> element</dt> |
<dt><code>feed</code> element</dt> |
| 860 |
<dd><p>The Atom <code>feed</code> element must be |
<dd><p>The Atom <code>feed</code> element must be |
| 861 |
in the <code>http://www.w3.org/2004/Atom</code> |
in the <code>http://www.w3.org/2005/Atom</code> |
| 862 |
namespace.</p> |
namespace as: |
| 863 |
|
<pre class="xml example"><code><feed xmlns="http://www.w3.org/2005/Atom"></code></pre> |
| 864 |
|
</p> |
| 865 |
<p>The conformance checker does not support Atom 0.3. |
<p>The conformance checker does not support Atom 0.3. |
| 866 |
Use Atom 1.0 for feed documents.</p></dd> |
Use Atom 1.0 for feed documents.</p></dd> |
| 867 |
</dl> |
</dl> |
| 1016 |
|
|
| 1017 |
<dl> |
<dl> |
| 1018 |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
| 1019 |
<dd><p>Only <code>Default-Style</code> and <code>Refresh</code> |
<dd><p>Only values <code>Default-Style</code> and <code>Refresh</code> |
| 1020 |
is allowed.</p> |
are allowed.</p> |
| 1021 |
<p>Value <code>Content-Type</code> is obsolete; for charset |
<p>Value <code>Content-Type</code> is obsolete; for charset |
| 1022 |
declaration, the <code>charset</code> attribute can be used as: |
declaration, the <code>charset</code> attribute can be used as: |
| 1023 |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
| 1037 |
|
|
| 1038 |
<d:item name="enumerated:invalid:http-equiv:content-type" |
<d:item name="enumerated:invalid:http-equiv:content-type" |
| 1039 |
class="attribute-value-error"> |
class="attribute-value-error"> |
| 1040 |
<d:message xml:lang="en">Charset declaration syntax |
<d:message xml:lang="en">Character encoding declaration syntax |
| 1041 |
<code><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
<code class="html bad example"><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
| 1042 |
is obsolete.</d:message> |
is obsolete.</d:message> |
| 1043 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
| 1044 |
<p>Old long charset declaration syntax |
<p>Old long character encoding declaration syntax |
| 1045 |
<code><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
<code class="html bad example"><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
| 1046 |
is in use. The document is non‐conforming.</p> |
is in use. The document is non‐conforming.</p> |
| 1047 |
|
|
| 1048 |
<p>The new charset declaration syntax is: |
<p>The new character encoding declaration syntax is: |
| 1049 |
<pre><code><meta charset="<var>charset-name</var>"></code></pre> |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
| 1050 |
</p> |
</p> |
| 1051 |
</d:desc> |
</d:desc> |
| 1052 |
</d:item> |
</d:item> |
| 1173 |
The document is non-conforming.</p> |
The document is non-conforming.</p> |
| 1174 |
|
|
| 1175 |
<p>For example, the table below is non-conforming: |
<p>For example, the table below is non-conforming: |
| 1176 |
<pre class="html non-conforming example"><code><table> |
<pre class="html bad example"><code><table> |
| 1177 |
<tbody> |
<tbody> |
| 1178 |
<tr><td rowspan=2></td></tr> |
<tr><td rowspan=2></td></tr> |
| 1179 |
</tbody> |
</tbody> |
| 1340 |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
| 1341 |
|
|
| 1342 |
<p>A cache manifest must start with a line whose content is |
<p>A cache manifest must start with a line whose content is |
| 1343 |
<code>CACHE MANIFEST</code> (exactly one space character between |
<code class="manifest example">CACHE MANIFEST</code> |
| 1344 |
|
(exactly one space character between |
| 1345 |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
| 1346 |
</d:desc> |
</d:desc> |
| 1347 |
</d:item> |
</d:item> |