Closed christianhujer closed 4 years ago
This also happens on auto-closed <script/>
.
Hey @christianhujer 👋. Thanks for reporting this one. Unfortunately none of these 2 tags are intended to be self-closing, even tho most of the browsers will understand it I think that’s syntactically incorrect.
To be clear I’m not 100% sure about this but the list of void elements in the HTML5 spec does not include in frame or script. Do you have a reference that states that iframes and scripts are void ?
https://html.spec.whatwg.org/multipage/syntax.html#void-elements
What you are missing is that "not self-closing" relates to the HTML syntax of HTML documents. The HTML specification allows for two syntaxes of HTML documents, the HTML syntax and the XML Syntax (usually referred to as XHTML). As I clearly stated in the bug report, this is an XHTML file, which is HTML using the XML syntax. The element isn't self-closing, the tag denoting the element is the XML EmptyElementTag syntax, it is closed explicitly by the />
at its end.
(The typical file suffix, as seen from the error message, is .xhtml
, and the Internet Media Type (fka MIME TYpe) is application/xhtml+xml
.)
For more information:
[44]
And from the chapter that you've referred to:
This section only describes the rules for resources labeled with an HTML MIME type. Rules for XML resources are discussed in the section below entitled "The XML syntax".
Yes. You're right on this one. To start we're focusing on the HTML syntax for HTML. Maybe later we can work on the XML syntax.
Given the following well-formed and valid XHTML 5.2 file
Milo wrongly reports