Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's not true.

The browser doesn't validate the content and neither knows nor cares if it would. It does something called doctype sniffing to choose whether it goes into one of a few different modes based entirely on the declaration (or lack of the same) at the top of the document.

"However, it is important to realize that the Quirks mode vs. Standards mode is predominantly about CSS layout and parsing—not HTML parsing. Some people misleadingly refer to the Standards mode as “strict parsing mode”, which is misunderstood to imply that browsers enforced HTML syntax rules and that a browser could be used to assess the correctness of markup. This is not the case. The browsers do tag soup fix-ups even when the Standards mode layout is in effect. (In 2000 before Netscape 6 was released, Mozilla actually had parser modes that enforced HTML syntax rules. These modes were incompatible with existing Web content and were abandoned.)"

Quoted from (and far more details) here: http://hsivonen.iki.fi/doctype/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: