2 ms·
Is HTML that way because of it being HTML, or have browsers just decided to brute force their way into handling the slop so that people won't blame the browser
by dylan604 2mo ago
Is HTML that way because of it being HTML, or have browsers just decided to brute force their way into handling the slop so that people won't blame the browser for not doing it correctly?
- alt227 2mo agoIn my experience a lot of the "best practice" warnings are reductive. A couple examples from this list are not requiring a type parameter on certain tags, or style tags being valid under html and body tags but not div tags. These types of things would take extra coding in a browser to check for certain singular tags not requiring things that all others do. Therefore it is simpler to leave these checks out and leave sloppy syntax checking as it does no harm at all to the rendered markup. You may be right in some situations, but the nature of HTML having everything applied to all tags and then selectively reduced definitely helps make it a more resilient and accommodating language.
- shevy-java 2mo agoTotally agreed.
- ndiddy 2mo agoWell it's obviously a better experience for someone who's not the page author if the browser tries to render an invalid page rather than throwing up its hands and showing an error. That way you can at least try to read the page rather than not being able to and having to track down the author and try to get him to fix his site. The "strict parsing" fans tried to force correctness with XHTML, but it was a failure and didn't see much use. The main problem with "handling the slop" used to be that different browsers would render invalid HTML differently, so poorly written sites could look very different depending on the browser you used. Modern HTML standardizes how browsers handle invalid HTML so this isn't a problem anymore. See https://html.spec.whatwg.org/multipage/parsing.html https://html.spec.whatwg.org/multipage/parsing.html
- sublinear 2mo agoBlaming the browser was the god's honest truth until fairly recently. You might be surprised to hear that IE didn't officially die until 2022. Safari and Firefox are still about 15% of users on desktop, and the situation is even worse on mobile. It doesn't really matter if it parses correctly when the browser vendor has their own opinions about rendering and behavior. W3C specs aren't always airtight and I assume that malicious compliance is free leverage for everyone at the table that isn't Google. All that is going to mean the users and devs suffer a bit. Even the most diligent and talented of web devs must eventually take bites of this shit sandwich along with everyone else. A lot of the complaints in sibling threads are from people who just don't understand how bureaucratic the web is. Goes to show how quickly everything can snowball into politics. It's worth thinking about when you look at the rest of the world too.