4 ms·
The HTML5 spec has two things: an XML serialization specification, and a detailed non-XML parsing specification that makes the parser safely accept the evil sla
by cardiffspaceman 12y ago
The HTML5 spec has two things: an XML serialization specification, and a detailed non-XML parsing specification that makes the parser safely accept the evil slash on void elements like BR and IMG. Bonus: it also accepts the alternate spelling of the name of the IMG element.
A style guide, of course, could ban using IMAGE as the name of the IMG element or any other infelicity, whether it is legal or merely tolerated.
- userbinator 12y agothe alternate spelling of the name of the IMG element I remember that jumped out at me when I read the HTML5 parsing spec, and I had no success whatsoever finding more information about it (try Googling "<image>"); do you have any links on how it came into existence? Or even better, a site that actually does this?
- fhars 12y agoIt is right there in the spec: <dt>A start tag whose tag name is "image"</dt> <dd> <!-- As of 2005-12, studies showed that around 0.2% of pages used the <image> element. --> <p><a href="#parse-error">Parse error</a>. Change the token's tag name to "img" and reprocess it. (Don't ask.)</p> </dd>
- cardiffspaceman 11y agoFhars has the numbers involved, and you can search the mailing list on this. What I remember is, Ian Hixie was spec editor and was then working at Google. He would do bigtable queries over "all the HTML pages in the world" in some sense, and find out things like that so many million pages had IMAGE tags. So he would float to the list that it should be handled as a matter of robustness. And most of the time those queries would be inspired by someone's suggestion, although I think he had gone ahead and tabulated a frequency table. This way you could judge whether potential new element names would clash with mistakes authors were already making.