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

Conversation

pmdartus
Copy link
Member

@pmdartus pmdartus commented Sep 10, 2017

\cc @HTMLParseErrorWG/core

@pmdartus
Copy link
Member Author

Couple of questions:

  • I added a generic error unexpected-doctype that can be reused in multiple other places: "before head" insertion mode, "in head" insertion mode, "in head noscript" insertion mode, ... Should I update all the error location in this PR, or do you think it's better to update them once we reach those section?

  • I am not a fan of a generic parse-error-unexpected-end-tag error message to handle the end tag case. This message is too way vague. But on the other hand creating a specific error per insertion mode to handle the "Any other end tag" doesn't provide much value either. Thoughts ?

@inikulin
Copy link
Member

inikulin commented Sep 11, 2017

@pmdartus Great work!

Should I update all the error location in this PR, or do you think it's better to update them once we reach those section?

Yes, we'll update them when we'll work on these sections.

unexpected-doctype

I've been thinking about calling it misplaced-doctype, since this error occurs when DOCTYPE is not a document preamble. "unexpected" is way too generic here imho.

I am not a fan of a generic parse-error-unexpected-end-tag error message to handle the end tag case. This message is too way vague. But on the other hand creating a specific error per insertion mode to handle the "Any other end tag" doesn't provide much value either.

I've been thinking about calling it end-tag-without-matching-start-tag and outlining in the description that it occurs for all tags with an exception for "head", "body", "html" (start tags for those are optional and explicitly closing them with an end tag is perfectly valid) and "br" (my guess is that it was done for the historical reasons due to significant amount of markup in the wild that uses </br> instead of <br/>, but it's worth searching https://lists.w3.org/Archives/Public/ or ask WHATWG veterans via GitHub or IRC for the confirmation).

source Outdated
@@ -100249,6 +100249,19 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
</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
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to elaborate what we mean by "incorrectly placed": if DOCTYPE is not a document preamble, i.e. there is content that is not comments or ASCII whitespace before it.

<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.

@inikulin
Copy link
Member

@pmdartus Any update on this? I'm just asking because I'm blocked on this errors at the moment: they will be used in the consequent insertion modes as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants