There are so many odd edge cases in HTML, a good one I found was with forms. If you open a but don't have a closing tag, the browser will close the form block "visually" at the end of the forms immediate parent, as you would expect. All styles are applied to it, or children via selectors, up to that automatically inserted end point. It's how browsers handles most unclosed block tags. However, the forms "functionality…
Why didn't they go the grammar nazi route? Define a spec and if the page doesn't conform, draw an error message. It's really annoying to have this kind of undefined behaviour that might end up being relied upon.
In the mid-2000s, HTML syntax was finally codified. There is now no undefined behaviour: all inputs have a defined output, however surprising may be, because a lot of it was being relied upon.