[UPHPU] Validation

Tyler Gee geekout at gmail.com
Mon Jun 5 17:22:15 MDT 2006


>
> Good question:
>
> http://validator.w3.org/docs/why.html

I am surprised that answer page does not say anything about speed,
which is an important issue concerning validation.  Basically, a page
marked with an xhtml strict doctype is assumed to be xhtml strict,
which means that when the browser is parsing a page, if it finds a
<div> tag it *knows* there will be a </div> tag somewhere that will
end it and so it can start rendering based off that assumption.  If
you are just running HTML, the browser finds a <div> tag, scans ahead
in the document until if finds the </div> tag; if found, it will then
go back to the start of the <div> and start rendering, if not found,
it will make some guesses about how to render.  So if you say you are
xhtml strict and you actually are, you can cut out a whole processing
step in the browser, hence faster pages.

The real danger lies in if you say you are xhtml strict but you are
not, because then it assumes it will find the </div> tag, but when it
doesn't it will realize you are not strict, load up the xhtml
transitional parser and start the page over from scratch.  So, the
rule of thumb is that you either want to be totally strict and
compliant or not at all.  Being half-way strict actually hurts you.

Plus, properly validated pages are viewer independent, which means you
can write one properly validated page and display it in any browser or
a PDA or on a mobile phone or whereever you want, just depending on
the style sheet.  If you are not properly validated you will have
issues.

And I also think the validation badge is tacky and useless.

-- 
~Tyler


More information about the UPHPU mailing list