@@ -99858,6 +99858,32 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
99858
99858
<th>Code
99859
99859
<th>Description
99860
99860
<tbody>
99861
+ <tr>
99862
+ <td><dfn data-x="parse-error-abandoned-head-element-child">abandoned-head-element-child</dfn>
99863
+ <td><p>This error occurs if the parser encounters a <span data-x="syntax-start-tag">start
99864
+ tag</span> for an element that is allowed by the parsing rules to be a <code>head</code>
99865
+ element's child, but placed between the <code>head</code> element's
99866
+ <span data-x="syntax-end-tag">end tag</span> and the <code>body</code> element's start tag or
99867
+ any content that opens the <code>body</code> element if it's start tag is <span
99868
+ data-x="syntax-tag-omission">omitted</span>. The parser treats such elements as child elements
99869
+ of the <code>head</code> element.</p>
99870
+
99871
+ <div class="example">
99872
+ <p>For example, consider the following markup:</p>
99873
+
99874
+ <pre><!DOCTYPE html>
99875
+ <html>
99876
+ <head></head>
99877
+ <title>The Answer</title>
99878
+ <script src="foo.js"></script>
99879
+ <body></body>
99880
+ </html></pre>
99881
+
99882
+ <p>This will be parsed into:</p>
99883
+
99884
+ <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>
99885
+ </div>
99886
+
99861
99887
<tr>
99862
99888
<td><dfn data-x="parse-error-abrupt-closing-of-empty-comment">abrupt-closing-of-empty-comment</dfn>
99863
99889
<td><p>This error occurs if the parser encounters an empty <span
@@ -99902,6 +99928,14 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
99902
99928
that is greater than the valid Unicode range. The parser resolves such a character reference to
99903
99929
a U+FFFD REPLACEMENT CHARACTER.</p>
99904
99930
99931
+ <tr>
99932
+ <td><dfn data-x="parse-error-closing-of-element-with-open-child-elements">closing-of-element-with-open-child-elements</dfn>
99933
+ <td><p>This error occurs if the parser encounters an <span data-x="syntax-end-tag">end
99934
+ tag</span> for an element that has open child elements for which end tag can not be <span
99935
+ data-x="syntax-tag-omission">omitted</span> (e.g., <code
99936
+ data-x=""><template><div></template></code>). In this case the parser closes such
99937
+ child elements implicitly.</p>
99938
+
99905
99939
<tr>
99906
99940
<td><dfn data-x="parse-error-control-character-in-input-stream">control-character-in-input-stream</dfn>
99907
99941
<td><p>This error occurs if the <span>input stream</span> contains a <span
@@ -99918,11 +99952,31 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
99918
99952
references as-is except C1 control references that are replaced according to the <span>numeric
99919
99953
character reference end state</span>.</p>
99920
99954
99955
+ <tr>
99956
+ <td><dfn data-x="parse-error-disallowed-content-in-noscript-in-head">disallowed-content-in-noscript-in-head</dfn>
99957
+ <td><p>This error occurs if the parser encounters any content other than <span>ASCII
99958
+ whitespace</span>, <span data-x="syntax-comments">comments</span>, a <code>basefont</code>
99959
+ element, a <code>bgsound</code> element, a <code>link</code> element, a <code>meta</code>
99960
+ element, a <code>noframes</code> element, or a <code>style</code> element in a
99961
+ <code>noscript</code> element in the <code>head</code>. In this case, the parser implicitly
99962
+ closes the <code>noscript</code> element and processes the content as if it was placed after
99963
+ the <code>noscript</code> element in the markup.</p>
99964
+
99921
99965
<tr>
99922
99966
<td><dfn data-x="parse-error-duplicate-attribute">duplicate-attribute</dfn>
99923
99967
<td><p>This error occurs if the parser encounters an <span
99924
99968
data-x="syntax-attributes">attribute</span> in a tag that already has an attribute with the
99925
- same name. The parser ignores all such duplicate occurrences of the attribute.
99969
+ same name. The parser ignores all such duplicate occurrences of the attribute.</p>
99970
+
99971
+ <tr>
99972
+ <td><dfn data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</dfn>
99973
+ <td><p>This error occurs if the parser encounters a <span data-x="syntax-start-tag">start
99974
+ tag</span> whose tag name is "head" inside or after the existing <code>head</code> element.
99975
+ The parser ignores such start tags.</p>
99976
+
99977
+ <p class="note">Some content opens the <code>head</code> element implicitly. Therefore, a start
99978
+ tag for the <code>head</code> that appear after such content will trigger this error, even
99979
+ though there were no start tags for <code>head</code> present in markup before.</p>
99926
99980
99927
99981
<tr>
99928
99982
<td><dfn data-x="parse-error-end-tag-with-attributes">end-tag-with-attributes</dfn>
@@ -99937,6 +99991,16 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
99937
99991
code point (e.g., <code data-x=""></div/></code>). Such a tag is treated as a regular end
99938
99992
tag.</p>
99939
99993
99994
+ <tr>
99995
+ <td><dfn data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</dfn>
99996
+ <td><p>This error occurs if the parser encounters an <span data-x="syntax-end-tag">end
99997
+ tag</span> whose tag name is not "br" or "p" and that doesn't match any open element. The
99998
+ parser ignores such end tags.</p>
99999
+
100000
+ <p class="note">The parser can implicitly create open elements even if the markup doesn't
100001
+ contain <span data-x="syntax-start-tag">start tags</span> for them (e.g., for an
100002
+ <code>html</code> element).</p>
100003
+
99940
100004
<tr>
99941
100005
<td><dfn data-x="parse-error-eof-before-tag-name">eof-before-tag-name</dfn>
99942
100006
<td><p>This error occurs if the parser encounters the end of the <span>input stream</span>
@@ -100037,6 +100101,13 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100037
100101
alpha</span>, a wide range of code points (including <span>ASCII digits</span>) is allowed in
100038
100102
subsequent positions.</p>
100039
100103
100104
+ <tr>
100105
+ <td><dfn data-x="parse-error-misplaced-doctype">misplaced-doctype</dfn>
100106
+ <td><p>This error occurs if the parser encounters a <span
100107
+ data-x="syntax-doctype">DOCTYPE</span> that is not a document preamble, i.e. it is preceded
100108
+ with a content other than <span data-x="syntax-comments">comments</span> or <span>ASCII
100109
+ whitespace</span>. The parser ignores such DOCTYPEs.</p>
100110
+
100040
100111
<tr>
100041
100112
<td><dfn data-x="parse-error-missing-attribute-value">missing-attribute-value</dfn>
100042
100113
<td><p>This error occurs if the parser encounters a U+003E (>) <span>code point</span> where an
@@ -100154,6 +100225,12 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100154
100225
--></code>). Such a comment will be closed by the first occuring "<code data-x="">--></code>"
100155
100226
<span>code point</span> sequence and everything that follows will be treated as markup.</p>
100156
100227
100228
+ <tr>
100229
+ <td><dfn data-x="parse-error-nested-noscript-in-head">nested-noscript-in-head</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 "noscript" in a <code>noscript</code> element in the
100232
+ <code>head</code>. The parser ignores such start tags.</p>
100233
+
100157
100234
<tr>
100158
100235
<td><dfn data-x="parse-error-non-conforming-doctype">non-conforming-doctype</dfn>
100159
100236
<td><p>This error occurs if the parser encounters the <span
@@ -100205,6 +100282,14 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
100205
100282
point</span>. The parser resolves such character references to a U+FFFD REPLACEMENT
100206
100283
CHARACTER.</p>
100207
100284
100285
+ <tr>
100286
+ <td><dfn data-x="parse-error-open-elements-left-after-eof">open-elements-left-after-eof</dfn>
100287
+ <td><p>This error occurs if the parser encounters the end of the <span>input stream</span>,
100288
+ whereas there are open elements for which <span data-x="syntax-end-tag">end tag</span> can not
100289
+ be <span data-x="syntax-tag-omission">omitted</span> (e.g., <code
100290
+ data-x=""><!DOCTYPE html><div></code>). In this case the parser closes such elements
100291
+ implicitly.</p>
100292
+
100208
100293
<tr>
100209
100294
<td><dfn data-x="parse-error-surrogate-character-reference">surrogate-character-reference</dfn>
100210
100295
<td><p>This error occurs if the parser encounters a numeric <span
@@ -105305,7 +105390,8 @@ document.body.appendChild(text);
105305
105390
105306
105391
<dt>A DOCTYPE token</dt>
105307
105392
<dd>
105308
- <p><span>Parse error</span>. Ignore the token.</p>
105393
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105394
+ error</span>. Ignore the token.</p>
105309
105395
</dd>
105310
105396
105311
105397
<dt>A start tag whose tag name is "html"</dt>
@@ -105337,7 +105423,9 @@ document.body.appendChild(text);
105337
105423
<dt>Any other end tag</dt>
105338
105424
<dd>
105339
105425
105340
- <p><span>Parse error</span>. Ignore the token.</p>
105426
+ <p>This is an <span
105427
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105428
+ <span>parse error</span>. Ignore the token.</p>
105341
105429
105342
105430
</dd>
105343
105431
@@ -105384,7 +105472,8 @@ document.body.appendChild(text);
105384
105472
105385
105473
<dt>A DOCTYPE token</dt>
105386
105474
<dd>
105387
- <p><span>Parse error</span>. Ignore the token.</p>
105475
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105476
+ error</span>. Ignore the token.</p>
105388
105477
</dd>
105389
105478
105390
105479
<dt>A start tag whose tag name is "html"</dt>
@@ -105548,7 +105637,9 @@ document.body.appendChild(text);
105548
105637
<dd>
105549
105638
105550
105639
<p>If there is no <code>template</code> element on the <span>stack of open elements</span>, then
105551
- this is a <span>parse error</span>; ignore the token.</p>
105640
+ this is an <span
105641
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105642
+ <span>parse error</span>; ignore the token.</p>
105552
105643
105553
105644
<p>Otherwise, run these steps:</p>
105554
105645
@@ -105557,6 +105648,8 @@ document.body.appendChild(text);
105557
105648
<li><p><span>Generate all implied end tags thoroughly</span>.</p></li>
105558
105649
105559
105650
<li><p>If the <span>current node</span> is not a <code>template</code> element, then this is a
105651
+ <span
105652
+ data-x="parse-error-closing-of-element-with-open-child-elements">closing-of-element-with-open-child-elements</span>
105560
105653
<span>parse error</span>.</p></li>
105561
105654
105562
105655
<li><p>Pop elements from the <span>stack of open elements</span> until a <code>template</code>
@@ -105574,9 +105667,17 @@ document.body.appendChild(text);
105574
105667
</dd>
105575
105668
105576
105669
<dt>A start tag whose tag name is "head"</dt>
105670
+ <dd>
105671
+ <p>This is a <span
105672
+ data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</span>
105673
+ <span>parse error</span>. Ignore the token.</p>
105674
+ </dd>
105675
+
105577
105676
<dt>Any other end tag</dt>
105578
105677
<dd>
105579
- <p><span>Parse error</span>. Ignore the token.</p>
105678
+ <p>This is an <span
105679
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105680
+ <span>parse error</span>. Ignore the token.</p>
105580
105681
</dd>
105581
105682
105582
105683
<dt>Anything else</dt>
@@ -105609,7 +105710,8 @@ document.body.appendChild(text);
105609
105710
105610
105711
<dt>A DOCTYPE token</dt>
105611
105712
<dd>
105612
- <p><span>Parse error</span>. Ignore the token.</p>
105713
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105714
+ error</span>. Ignore the token.</p>
105613
105715
</dd>
105614
105716
105615
105717
<dt>A start tag whose tag name is "html"</dt>
@@ -105620,6 +105722,10 @@ document.body.appendChild(text);
105620
105722
105621
105723
</dd>
105622
105724
105725
+ <dt>A start tag whose tag name is "noscript"</dt>
105726
+ <dd>This is a <span data-x="parse-error-nested-noscript-in-head">nested-noscript-in-head</span>
105727
+ <span>parse error</span>. Ignore the token.</dd>
105728
+
105623
105729
<dt>An end tag whose tag name is "noscript"</dt>
105624
105730
<dd>
105625
105731
@@ -105635,8 +105741,8 @@ document.body.appendChild(text);
105635
105741
<dt>A character token that is one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C
105636
105742
FORM FEED (FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
105637
105743
<dt>A comment token</dt>
105638
- <dt>A start tag whose tag name is one of: "basefont", "bgsound", "link ", "meta ", "noframes ",
105639
- "style"</dt>
105744
+ <dt>A start tag whose tag name is one of: "basefont", "bgsound", "head ", "link ", "meta ",
105745
+ "noframes", " style"</dt>
105640
105746
<dd>
105641
105747
105642
105748
<p>Process the token <span>using the rules for</span> the "<span data-x="insertion mode: in
@@ -105649,18 +105755,23 @@ document.body.appendChild(text);
105649
105755
<p>Act as described in the "anything else" entry below.</p>
105650
105756
</dd>
105651
105757
105652
- <dt>A start tag whose tag name is one of: "head", "noscript"</dt>
105653
105758
<dt>Any other end tag</dt>
105654
105759
<dd>
105655
- <p><span>Parse error</span>. Ignore the token.</p>
105760
+ <p>This is an <span
105761
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105762
+ <span>parse error</span>. Ignore the token.</p>
105656
105763
</dd>
105657
105764
105658
105765
<dt>Anything else</dt>
105659
105766
<dd>
105660
105767
105661
- <!-- can't get here with an EOF and a fragment case -->
105768
+ <!-- can't get here with a fragment case -->
105662
105769
105663
- <p><span>Parse error</span>.</p>
105770
+ <p>If the token is an end-of-file token then this is an <span
105771
+ data-x="parse-error-open-elements-left-after-eof">open-elements-left-after-eof</span>
105772
+ <span>parse error</span>, otherwise this is a <span
105773
+ data-x="parse-error-disallowed-content-in-noscript-in-head">disallowed-content-in-noscript-in-head</span>
105774
+ <span>parse error</span>.</p>
105664
105775
105665
105776
<!-- fake </noscript> -->
105666
105777
<p>Pop the <span>current node</span> (which will be a <code>noscript</code> element) from the
@@ -105700,7 +105811,8 @@ document.body.appendChild(text);
105700
105811
105701
105812
<dt>A DOCTYPE token</dt>
105702
105813
<dd>
105703
- <p><span>Parse error</span>. Ignore the token.</p>
105814
+ <p>This is a <span data-x="parse-error-misplaced-doctype">misplaced-doctype</span> <span>parse
105815
+ error</span>. Ignore the token.</p>
105704
105816
</dd>
105705
105817
105706
105818
<dt>A start tag whose tag name is "html"</dt>
@@ -105737,7 +105849,9 @@ document.body.appendChild(text);
105737
105849
"noframes", "script", "style", "template", "title"</dt>
105738
105850
<dd>
105739
105851
105740
- <p><span>Parse error</span>.</p>
105852
+ <p>This is an <span
105853
+ data-x="parse-error-abandoned-head-element-child">abandoned-head-element-child</span>
105854
+ <span>parse error</span>.</p>
105741
105855
105742
105856
<p>Push the node pointed to by the <span><code data-x="">head</code> element pointer</span> onto
105743
105857
the <span>stack of open elements</span>.</p>
@@ -105766,9 +105880,17 @@ document.body.appendChild(text);
105766
105880
</dd>
105767
105881
105768
105882
<dt>A start tag whose tag name is "head"</dt>
105883
+ <dd>
105884
+ <p>This is a <span
105885
+ data-x="parse-error-misplaced-start-tag-for-head-element">misplaced-start-tag-for-head-element</span>
105886
+ <span>parse error</span>. Ignore the token.</p>
105887
+ </dd>
105888
+
105769
105889
<dt>Any other end tag</dt>
105770
105890
<dd>
105771
- <p><span>Parse error</span>. Ignore the token.</p>
105891
+ <p>This is an <span
105892
+ data-x="parse-error-end-tag-without-matching-open-element">end-tag-without-matching-open-element</span>
105893
+ <span>parse error</span>. Ignore the token.</p>
105772
105894
</dd>
105773
105895
105774
105896
<dt>Anything else</dt>
0 commit comments