@@ -100115,6 +100115,32 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100115
100115
<th>Code
100116
100116
<th>Description
100117
100117
<tbody>
100118
+ <tr>
100119
+ <td><dfn data-x="parse-error-abandoned-head-element-child">abandoned-head-element-child</dfn>
100120
+ <td><p>This error occurs if the parser encounters a <span data-x="syntax-start-tag">start
100121
+ tag</span> for an element that is allowed by the parsing rules to be a <code>head</code>
100122
+ element's child, but placed between the <code>head</code> element's
100123
+ <span data-x="syntax-end-tag">end tag</span> and the <code>body</code> element's start tag or
100124
+ any content that opens the <code>body</code> element if it's start tag is <span
100125
+ data-x="syntax-tag-omission">omitted</span>. The parser treats such elements as child elements
100126
+ of the <code>head</code> element.</p>
100127
+
100128
+ <div class="example">
100129
+ <p>For example, consider the following markup:</p>
100130
+
100131
+ <pre><!DOCTYPE html>
100132
+ <html>
100133
+ <head></head>
100134
+ <title>The Answer</title>
100135
+ <script src="foo.js"></script>
100136
+ <body></body>
100137
+ </html></pre>
100138
+
100139
+ <p>This will be parsed into:</p>
100140
+
100141
+ <ul class="domTree"><li class="t10">DOCTYPE: <code>html</code></li><li class="t1"><code>html</code><ul><li class="t1"><code>head</code><ul><li class="t1"><code>title</code><ul><li class="t3"><code>#text</code>: <span data-x="">The Answer</span></li></ul></li><li class="t1"><code>script</code> <span class="t2"><code class="attribute name" data-x="attr-id">src</code>="<code class="attribute value" data-x="">foo.js</code>"</span></li></ul><li class="t1"><code>body</code></li></ul></li></ul>
100142
+ </div>
100143
+
100118
100144
<tr>
100119
100145
<td><dfn data-x="parse-error-abrupt-closing-of-empty-comment">abrupt-closing-of-empty-comment</dfn>
100120
100146
<td><p>This error occurs if the parser encounters an empty <span
@@ -100159,6 +100185,14 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100159
100185
that is greater than the valid Unicode range. The parser resolves such a character reference to
100160
100186
a U+FFFD REPLACEMENT CHARACTER.</p>
100161
100187
100188
+ <tr>
100189
+ <td><dfn data-x="parse-error-closing-of-element-with-open-child-elements">closing-of-element-with-open-child-elements</dfn>
100190
+ <td><p>This error occurs if the parser encounters an <span data-x="syntax-end-tag">end
100191
+ tag</span> for an element that has open child elements for which end tag can not be <span
100192
+ data-x="syntax-tag-omission">omitted</span> (e.g., <code
100193
+ data-x=""><template><div></template></code>). In this case the parser closes such
100194
+ child elements implicitly.</p>
100195
+
100162
100196
<tr>
100163
100197
<td><dfn data-x="parse-error-control-character-in-input-stream">control-character-in-input-stream</dfn>
100164
100198
<td><p>This error occurs if the <span>input stream</span> contains a <span
@@ -100175,11 +100209,31 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100175
100209
references as-is except C1 control references that are replaced according to the <span>numeric
100176
100210
character reference end state</span>.</p>
100177
100211
100212
+ <tr>
100213
+ <td><dfn data-x="parse-error-disallowed-content-in-noscript-in-head">disallowed-content-in-noscript-in-head</dfn>
100214
+ <td><p>This error occurs if the parser encounters any content other than <span>ASCII
100215
+ whitespace</span>, <span data-x="syntax-comments">comments</span>, a <code>basefont</code>
100216
+ element, a <code>bgsound</code> element, a <code>link</code> element, a <code>meta</code>
100217
+ element, a <code>noframes</code> element, or a <code>style</code> element in a
100218
+ <code>noscript</code> element in the <code>head</code>. In this case, the parser implicitly
100219
+ closes the <code>noscript</code> element and processes the content as if it was placed after
100220
+ the <code>noscript</code> element in the markup.</p>
100221
+
100178
100222
<tr>
100179
100223
<td><dfn data-x="parse-error-duplicate-attribute">duplicate-attribute</dfn>
100180
100224
<td><p>This error occurs if the parser encounters an <span
100181
100225
data-x="syntax-attributes">attribute</span> in a tag that already has an attribute with the
100182
- same name. The parser ignores all such duplicate occurrences of the attribute.
100226
+ same name. The parser ignores all such duplicate occurrences of the attribute.</p>
100227
+
100228
+ <tr>
100229
+ <td><dfn data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</dfn>
100230
+ <td><p>This error occurs if the parser encounters a <span data-x="syntax-start-tag">start
100231
+ tag</span> whose tag name is "head" inside or after the existing <code>head</code> element.
100232
+ The parser ignores such start tags.</p>
100233
+
100234
+ <p class="note">Some content opens the <code>head</code> element implicitly. Therefore, a start
100235
+ tag for the <code>head</code> that appear after such content will trigger this error, even
100236
+ though there were no start tags for <code>head</code> present in markup before.</p>
100183
100237
100184
100238
<tr>
100185
100239
<td><dfn data-x="parse-error-end-tag-with-attributes">end-tag-with-attributes</dfn>
@@ -100194,6 +100248,16 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100194
100248
code point (e.g., <code data-x=""></div/></code>). Such a tag is treated as a regular end
100195
100249
tag.</p>
100196
100250
100251
+ <tr>
100252
+ <td><dfn data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</dfn>
100253
+ <td><p>This error occurs if the parser encounters an <span data-x="syntax-end-tag">end
100254
+ tag</span> whose tag name is not "br" or "p" and that doesn't match any open element. The
100255
+ parser ignores such end tags.</p>
100256
+
100257
+ <p class="note">The parser can implicitly create open elements even if the markup doesn't
100258
+ contain <span data-x="syntax-start-tag">start tags</span> for them (e.g., for an
100259
+ <code>html</code> element).</p>
100260
+
100197
100261
<tr>
100198
100262
<td><dfn data-x="parse-error-eof-before-tag-name">eof-before-tag-name</dfn>
100199
100263
<td><p>This error occurs if the parser encounters the end of the <span>input stream</span>
@@ -100294,6 +100358,13 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100294
100358
alpha</span>, a wide range of code points (including <span>ASCII digits</span>) is allowed in
100295
100359
subsequent positions.</p>
100296
100360
100361
+ <tr>
100362
+ <td><dfn data-x="parse-error-misplaced-doctype">misplaced-doctype</dfn>
100363
+ <td><p>This error occurs if the parser encounters a <span
100364
+ data-x="syntax-doctype">DOCTYPE</span> that is not a document preamble, i.e. it is preceded
100365
+ with a content other than <span data-x="syntax-comments">comments</span> or <span>ASCII
100366
+ whitespace</span>. The parser ignores such DOCTYPEs.</p>
100367
+
100297
100368
<tr>
100298
100369
<td><dfn data-x="parse-error-missing-attribute-value">missing-attribute-value</dfn>
100299
100370
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> where an
@@ -100411,6 +100482,12 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100411
100482
--></code>). Such a comment will be closed by the first occuring "<code data-x="">--></code>"
100412
100483
<span>code point</span> sequence and everything that follows will be treated as markup.</p>
100413
100484
100485
+ <tr>
100486
+ <td><dfn data-x="parse-error-nested-noscript-in-head">nested-noscript-in-head</dfn>
100487
+ <td><p>This error occurs if the parser encounters a <span data-x="syntax-start-tag">start
100488
+ tag</span> whose tag name is "noscript" in a <code>noscript</code> element in the
100489
+ <code>head</code>. The parser ignores such start tags.</p>
100490
+
100414
100491
<tr>
100415
100492
<td><dfn data-x="parse-error-non-conforming-doctype">non-conforming-doctype</dfn>
100416
100493
<td><p>This error occurs if the parser encounters the <span
@@ -100462,6 +100539,14 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100462
100539
point</span>. The parser resolves such character references to a U+FFFD REPLACEMENT
100463
100540
CHARACTER.</p>
100464
100541
100542
+ <tr>
100543
+ <td><dfn data-x="parse-error-open-elements-left-after-eof">open-elements-left-after-eof</dfn>
100544
+ <td><p>This error occurs if the parser encounters the end of the <span>input stream</span>,
100545
+ whereas there are open elements for which <span data-x="syntax-end-tag">end tag</span> can not
100546
+ be <span data-x="syntax-tag-omission">omitted</span> (e.g., <code
100547
+ data-x=""><!DOCTYPE html><div></code>). In this case the parser closes such elements
100548
+ implicitly.</p>
100549
+
100465
100550
<tr>
100466
100551
<td><dfn data-x="parse-error-surrogate-character-reference">surrogate-character-reference</dfn>
100467
100552
<td><p>This error occurs if the parser encounters a numeric <span
@@ -105552,7 +105637,8 @@ document.body.appendChild(text);
105552
105637
105553
105638
<dt>A DOCTYPE token</dt>
105554
105639
<dd>
105555
- <p><span>Parse error</span>. Ignore the token.</p>
105640
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105641
+ error</span>. Ignore the token.</p>
105556
105642
</dd>
105557
105643
105558
105644
<dt>A start tag whose tag name is "html"</dt>
@@ -105584,7 +105670,9 @@ document.body.appendChild(text);
105584
105670
<dt>Any other end tag</dt>
105585
105671
<dd>
105586
105672
105587
- <p><span>Parse error</span>. Ignore the token.</p>
105673
+ <p>This is an <span
105674
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105675
+ <span>parse error</span>. Ignore the token.</p>
105588
105676
105589
105677
</dd>
105590
105678
@@ -105631,7 +105719,8 @@ document.body.appendChild(text);
105631
105719
105632
105720
<dt>A DOCTYPE token</dt>
105633
105721
<dd>
105634
- <p><span>Parse error</span>. Ignore the token.</p>
105722
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105723
+ error</span>. Ignore the token.</p>
105635
105724
</dd>
105636
105725
105637
105726
<dt>A start tag whose tag name is "html"</dt>
@@ -105795,7 +105884,9 @@ document.body.appendChild(text);
105795
105884
<dd>
105796
105885
105797
105886
<p>If there is no <code>template</code> element on the <span>stack of open elements</span>, then
105798
- this is a <span>parse error</span>; ignore the token.</p>
105887
+ this is an <span
105888
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105889
+ <span>parse error</span>; ignore the token.</p>
105799
105890
105800
105891
<p>Otherwise, run these steps:</p>
105801
105892
@@ -105804,6 +105895,8 @@ document.body.appendChild(text);
105804
105895
<li><p><span>Generate all implied end tags thoroughly</span>.</p></li>
105805
105896
105806
105897
<li><p>If the <span>current node</span> is not a <code>template</code> element, then this is a
105898
+ <span
105899
+ data-x="parse-error-closing-of-element-with-open-child-elements">closing-of-element-with-open-child-elements</span>
105807
105900
<span>parse error</span>.</p></li>
105808
105901
105809
105902
<li><p>Pop elements from the <span>stack of open elements</span> until a <code>template</code>
@@ -105821,9 +105914,17 @@ document.body.appendChild(text);
105821
105914
</dd>
105822
105915
105823
105916
<dt>A start tag whose tag name is "head"</dt>
105917
+ <dd>
105918
+ <p>This is a <span
105919
+ data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</span>
105920
+ <span>parse error</span>. Ignore the token.</p>
105921
+ </dd>
105922
+
105824
105923
<dt>Any other end tag</dt>
105825
105924
<dd>
105826
- <p><span>Parse error</span>. Ignore the token.</p>
105925
+ <p>This is an <span
105926
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105927
+ <span>parse error</span>. Ignore the token.</p>
105827
105928
</dd>
105828
105929
105829
105930
<dt>Anything else</dt>
@@ -105856,7 +105957,8 @@ document.body.appendChild(text);
105856
105957
105857
105958
<dt>A DOCTYPE token</dt>
105858
105959
<dd>
105859
- <p><span>Parse error</span>. Ignore the token.</p>
105960
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105961
+ error</span>. Ignore the token.</p>
105860
105962
</dd>
105861
105963
105862
105964
<dt>A start tag whose tag name is "html"</dt>
@@ -105867,6 +105969,10 @@ document.body.appendChild(text);
105867
105969
105868
105970
</dd>
105869
105971
105972
+ <dt>A start tag whose tag name is "noscript"</dt>
105973
+ <dd>This is a <span data-x="parse-error-nested-noscript-in-head">nested-noscript-in-head</span>
105974
+ <span>parse error</span>. Ignore the token.</dd>
105975
+
105870
105976
<dt>An end tag whose tag name is "noscript"</dt>
105871
105977
<dd>
105872
105978
@@ -105882,8 +105988,8 @@ document.body.appendChild(text);
105882
105988
<dt>A character token that is one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C
105883
105989
FORM FEED (FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
105884
105990
<dt>A comment token</dt>
105885
- <dt>A start tag whose tag name is one of: "basefont", "bgsound", "link ", "meta ", "noframes ",
105886
- "style"</dt>
105991
+ <dt>A start tag whose tag name is one of: "basefont", "bgsound", "head ", "link ", "meta ",
105992
+ "noframes", " style"</dt>
105887
105993
<dd>
105888
105994
105889
105995
<p>Process the token <span>using the rules for</span> the "<span data-x="insertion mode: in
@@ -105896,18 +106002,23 @@ document.body.appendChild(text);
105896
106002
<p>Act as described in the "anything else" entry below.</p>
105897
106003
</dd>
105898
106004
105899
- <dt>A start tag whose tag name is one of: "head", "noscript"</dt>
105900
106005
<dt>Any other end tag</dt>
105901
106006
<dd>
105902
- <p><span>Parse error</span>. Ignore the token.</p>
106007
+ <p>This is an <span
106008
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
106009
+ <span>parse error</span>. Ignore the token.</p>
105903
106010
</dd>
105904
106011
105905
106012
<dt>Anything else</dt>
105906
106013
<dd>
105907
106014
105908
- <!-- can't get here with an EOF and a fragment case -->
106015
+ <!-- can't get here with a fragment case -->
105909
106016
105910
- <p><span>Parse error</span>.</p>
106017
+ <p>If the token is an end-of-file token then this is an <span
106018
+ data-x="parse-error-open-elements-left-after-eof">open-elements-left-after-eof</span>
106019
+ <span>parse error</span>, otherwise this is a <span
106020
+ data-x="parse-error-disallowed-content-in-noscript-in-head">disallowed-content-in-noscript-in-head</span>
106021
+ <span>parse error</span>.</p>
105911
106022
105912
106023
<!-- fake </noscript> -->
105913
106024
<p>Pop the <span>current node</span> (which will be a <code>noscript</code> element) from the
@@ -105947,7 +106058,8 @@ document.body.appendChild(text);
105947
106058
105948
106059
<dt>A DOCTYPE token</dt>
105949
106060
<dd>
105950
- <p><span>Parse error</span>. Ignore the token.</p>
106061
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
106062
+ error</span>. Ignore the token.</p>
105951
106063
</dd>
105952
106064
105953
106065
<dt>A start tag whose tag name is "html"</dt>
@@ -105984,7 +106096,9 @@ document.body.appendChild(text);
105984
106096
"noframes", "script", "style", "template", "title"</dt>
105985
106097
<dd>
105986
106098
105987
- <p><span>Parse error</span>.</p>
106099
+ <p>This is an <span
106100
+ data-x="parse-error-abandoned-head-element-child">abandoned-head-element-child</span>
106101
+ <span>parse error</span>.</p>
105988
106102
105989
106103
<p>Push the node pointed to by the <span><code data-x="">head</code> element pointer</span> onto
105990
106104
the <span>stack of open elements</span>.</p>
@@ -106013,9 +106127,17 @@ document.body.appendChild(text);
106013
106127
</dd>
106014
106128
106015
106129
<dt>A start tag whose tag name is "head"</dt>
106130
+ <dd>
106131
+ <p>This is a <span
106132
+ data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</span>
106133
+ <span>parse error</span>. Ignore the token.</p>
106134
+ </dd>
106135
+
106016
106136
<dt>Any other end tag</dt>
106017
106137
<dd>
106018
- <p><span>Parse error</span>. Ignore the token.</p>
106138
+ <p>This is an <span
106139
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
106140
+ <span>parse error</span>. Ignore the token.</p>
106019
106141
</dd>
106020
106142
106021
106143
<dt>Anything else</dt>
0 commit comments