Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial errors for before html insert mode section #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -100157,6 +100157,15 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
Such <span data-x="code point">code points</span> are parsed as-is and usually, where parsing
rules don't apply any additional restrictions, make their way into the DOM.</p>

<tr>
<td><dfn data-x="parse-error-non-conforming-doctype">non-conforming-doctype</dfn>
<td><p>This error occurs if the parser encounters the <span
data-x="syntax-doctype">DOCTYPE</span> correctly placed as a document preamble and other than
<code data-x="">&lt;!DOCTYPE html></code> or <code data-x="">&lt;!DOCTYPE html SYSTEM
"about:legacy-compat"></code>. For <a href="#quirks-mode-doctypes">some non-conforming
DOCTYPEs</a> the parser sets the <code>Document</code> to <span>quirks mode</span> or
<span>limited-quirks mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-non-void-html-element-start-tag-with-trailing-solidus">non-void-html-element-start-tag-with-trailing-solidus</dfn>
<td>
Expand Down Expand Up @@ -100239,6 +100248,19 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
data-x="">id'bar'</code>" that has an empty value.</p>
</div>

<tr>
<td><dfn data-x="parse-error-unexpected-doctype">unexpected-doctype</dfn>
<td>
<p>This error occurs if the parser encounters an incorrectly placed <span
data-x="syntax-doctype">DOCTYPE</span>. In this case the parser ignores the <span
data-x="syntax-doctype">DOCTYPE</span> token.</p>

<tr>
<td><dfn data-x="parse-error-unexpected-end-tag">unexpected-end-tag</dfn>
<td>
<p>This error occurs if the parser encounters an unexpected end tag. In this case the parser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignores the end tag.</p>

<tr>
<td><dfn data-x="parse-error-unexpected-character-in-unquoted-attribute-value">unexpected-character-in-unquoted-attribute-value</dfn>
<td>
Expand All @@ -100262,6 +100284,15 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
data-x="">foo</code>" attribute to "<code data-x="">b'ar'</code>".</p>
</div>

<tr>
<td><dfn data-x="parse-error-missing-doctype">missing-doctype</dfn>
<td>
<p>This error occurs if the parser encounters any content other than <span
data-x="syntax-comments">comments</span> or <span>ASCII whitespace</span> before <span
data-x="syntax-doctype">DOCTYPE</span> at the beginning of the document, i.e. DOCTYPE is not
a document preamble. In this case the parser sets the <code>Document</code> to <span>quirks
mode</span>.</p>

<tr>
<td><dfn data-x="parse-error-unexpected-equals-sign-before-attribute-name">unexpected-equals-sign-before-attribute-name</dfn>
<td>
Expand Down Expand Up @@ -105037,7 +105068,9 @@ document.body.appendChild(text);
<p>If the DOCTYPE token's name is not a <span>case-sensitive</span> match for the string "<code
data-x="">html</code>", or the token's public identifier is not missing, or the token's system
identifier is neither missing nor a <span>case-sensitive</span> match for the string
"<code>about:legacy-compat</code>", then there is a <span>parse error</span>.</p>
"<code>about:legacy-compat</code>", then this is a <span
data-x="parse-error-non-conforming-doctype">non-conforming-doctype</span> <span>parse
error</span>.</p>

<p>Append a <code>DocumentType</code> node to the <code>Document</code> node, with the <code
data-x="">name</code> attribute set to the name given in the DOCTYPE token, or the empty string
Expand Down Expand Up @@ -105147,8 +105180,9 @@ document.body.appendChild(text);
<dd>

<p>If the document is <em>not</em> <span>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, then this is a <span>parse
error</span>; set the <code>Document</code> to <span>quirks mode</span>.</p>
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, then this is a <span
data-x="parse-error-missing-doctype">missing-doctype</span> <span>parse error</span>; set the
<code>Document</code> to <span>quirks mode</span>.</p>

<p>In any case, switch the <span>insertion mode</span> to "<span data-x="insertion mode: before
html">before html</span>", then reprocess the token.</p>
Expand All @@ -105168,7 +105202,8 @@ document.body.appendChild(text);

<dt>A DOCTYPE token</dt>
<dd>
<p><span>Parse error</span>. Ignore the token.</p>
<p>This is an <span data-x="parse-error-unexpected-doctype">unexpected-doctype</span>
<span>parse error</span>. Ignore the token.</p>
</dd>

<dt>A comment token</dt>
Expand Down Expand Up @@ -105235,7 +105270,8 @@ document.body.appendChild(text);

<dt>Any other end tag</dt>
<dd>
<p><span>Parse error</span>. Ignore the token.</p>
<p>This is an <span data-x="parse-error-unexpected-end-tag">unexpected-end-tag</span>
<span>parse error</span>. Ignore the token.</p>
</dd>

<dt>Anything else</dt>
Expand Down