From 87bc4226d76490ddf3ad620e283ab83753a68b83 Mon Sep 17 00:00:00 2001 From: Ivan Nikulin Date: Wed, 6 Sep 2017 11:18:48 +0100 Subject: [PATCH 1/2] Add initial insertion mode errors (#19) * Add initial insertion mode errors * Fix review nits --- source | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/source b/source index 7ba07983431..2d411368591 100644 --- a/source +++ b/source @@ -100157,6 +100157,15 @@ dictionary StorageEventInit : EventInit { Such code points are parsed as-is and usually, where parsing rules don't apply any additional restrictions, make their way into the DOM.

+ + non-conforming-doctype +

This error occurs if the parser encounters the DOCTYPE correctly placed as a document preamble and other than + <!DOCTYPE html> or <!DOCTYPE html SYSTEM + "about:legacy-compat">. For some non-conforming + DOCTYPEs the parser sets the Document to quirks mode or + limited-quirks mode.

+ non-void-html-element-start-tag-with-trailing-solidus @@ -100262,6 +100271,15 @@ dictionary StorageEventInit : EventInit { data-x="">foo" attribute to "b'ar'".

+ + missing-doctype + +

This error occurs if the parser encounters any content other than comments or ASCII whitespace before DOCTYPE at the beginning of the document, i.e. DOCTYPE is not + a document preamble. In this case the parser sets the Document to quirks + mode.

+ unexpected-equals-sign-before-attribute-name @@ -105037,7 +105055,9 @@ document.body.appendChild(text);

If the DOCTYPE token's name is not a case-sensitive match for the string "html", or the token's public identifier is not missing, or the token's system identifier is neither missing nor a case-sensitive match for the string - "about:legacy-compat", then there is a parse error.

+ "about:legacy-compat", then this is a non-conforming-doctype parse + error.

Append a DocumentType node to the Document node, with the name attribute set to the name given in the DOCTYPE token, or the empty string @@ -105147,8 +105167,9 @@ document.body.appendChild(text);

If the document is not an iframe srcdoc document, then this is a parse - error; set the Document to quirks mode.

+ data-x="attr-iframe-srcdoc">srcdoc document, then this is a missing-doctype parse error; set the + Document to quirks mode.

In any case, switch the insertion mode to "before html", then reprocess the token.

From 24017a7e4073c11298498d92ea4864f21a8095e3 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Date: Sun, 10 Sep 2017 10:41:32 -0700 Subject: [PATCH 2/2] Add initial errors for before html insert mode section --- source | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source b/source index 2d411368591..55d343a4c51 100644 --- a/source +++ b/source @@ -100248,6 +100248,19 @@ dictionary StorageEventInit : EventInit { data-x="">id'bar'" that has an empty value.

+ + unexpected-doctype + +

This error occurs if the parser encounters an incorrectly placed DOCTYPE. In this case the parser ignores the DOCTYPE token.

+ + + unexpected-end-tag + +

This error occurs if the parser encounters an unexpected end tag. In this case the parser + ignores the end tag.

+ unexpected-character-in-unquoted-attribute-value @@ -105189,7 +105202,8 @@ document.body.appendChild(text);
A DOCTYPE token
-

Parse error. Ignore the token.

+

This is an unexpected-doctype + parse error. Ignore the token.

A comment token
@@ -105256,7 +105270,8 @@ document.body.appendChild(text);
Any other end tag
-

Parse error. Ignore the token.

+

This is an unexpected-end-tag + parse error. Ignore the token.

Anything else