2 ms·
See the spec document for the rationale. In short: The browser already has a good and safe parser, and knows best how it will treat which elements. An external
by detaro 6y ago
See the spec document for the rationale. In short: The browser already has a good and safe parser, and knows best how it will treat which elements. An external parser written in JS is overhead while likely to be worse than/outdated compared to the browser. (In general security practices, parsers being used for validation being different than the parser used for processing later is somewhat of a smell, because it makes it more likely you can sneak something bad through a special case)