| This is not quite right. The HTML spec specifies not only what browsers/user agents are allowed to do, but also what document authors are allowed to do. While the HTML parser does handle errors, to conform to the spec, document authors must not make these errors. Here is an excerpt from the spec[1]: > As described in the conformance requirements section below, this specification describes conformance criteria for a variety of conformance classes. In particular, there are conformance requirements that apply to producers, for example authors and the documents they create, and there are conformance requirements that apply to consumers, for example web browsers. They can be distinguished by what they are requiring: a requirement on a producer states what is allowed, while a requirement on a consumer states how software is to act. Furthermore, a user agent is not required to correct errors, and can simply halt at the first error[2]: > The error handling for parse errors is well-defined (that's the processing rules described throughout this specification), but user agents, while parsing an HTML document, may abort the parser at the first parse error that they encounter for which they do not wish to apply the rules described in this specification. [1] https://html.spec.whatwg.org/multipage/introduction.html#how... [2] https://html.spec.whatwg.org/multipage/parsing.html#parse-er... |