Now that HTML5 has a standard algorithm for rendering pages, will it still be useful to check markup?

HTML5 defines a standard algorithm for rendering web pages, and this algorithm determines how error handling should be performed. In general, each browser should display invalid markup in the same way or should work just like tags that they cannot handle.

At the moment, I still see verification as a means of ensuring that markup works hypothetically in the same way in older browsers. Excluding these (because I hope they won’t be forever), since any markup should have a certain behavior, no matter how awful it looks, does "valid HTML" really make any sense? It seems to me that an input is valid if it has a specific output, in which case this means that any HTML5 is valid. Is it useful to check the markup, given that this will not affect compatibility?

How did linepogl rephrase it in a comment, now that invalid HTML has been standardized, has it become valid?

+8
html5
source share
4 answers

I assume that validators will remain a useful tool for HTML in the same way that lint , and its descendants will remain useful tools for common programming languages, That is, even if the compiler (browser) behaves in a predictable way according to the language standard (which in any case is too optimistic), it is still useful to perform a more thorough check for the presence of doubtful constructs in your code.

+2
source share

To express this in terms of car analogies:

In the UK, we usually know the consequences of our actions if we violate the speed limit while driving. We will receive a penalty and 3 points of confirmation of our license. But just because we know that the consequences do not mean that this would be less of a crime.

The same goes for HTML. The error handling behavior is standardized because it is common, but this does not allow the use of illegal syntax. Legal syntax is more efficient for browsers and infinitely simpler to maintain, therefore, despite the fact that the result of invalid markup is predictable, it is much better for everyone if we adhere to the rules.

... stay in school kids! </ preach>

+1
source share

It is easier to get inadvertent behavior in invalid HTML, so staying as close to valid HTML as possible will make it easier to understand.

In addition, most developer tools will expect more or less correct HTML, because handling extreme cases is complex and time-consuming. You will have fewer problems if your pages are up to standard.

Browsers are forced to perform invalid HTML processing due to outdated. But developer tools are not necessary, as these tools usually help you create new pages.

0
source share

This may be an accessibility requirement to provide valid HTML.

Invalid HTML can be problematic to maintain. Corrections to a functionally verified but invalid document may exhibit unexpected behavior and be difficult to understand until an initial error is detected.

I do not think that the HTML5 specification can cover all possible invalid scenarios in order to guarantee reliable compatibility between browsers.

0
source share

All Articles