W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Re Validation

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 31 Jul 2009 01:19:55 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0907310106430.6420@hixie.dreamhostps.com>
On Mon, 20 Jul 2009 Darxus at ChaosReigns.com wrote:
>
> Why is it okay for a document to not specify its HTML version?

That's the wrong question -- the more important question is "why should we 
specify the version of HTML that the author knew about when he started 
writing the document?".


> Do all browsers ignore it?

Yes.


> How should a validator handle lack of HTML version info when the next
> standard is released with no DOCTYPE?

A validator should always check against the most recent standard, unless 
the user has explicitly requested some other profile.


> Should validators ignore older HTML version numbers which are listed in 
> DOCTYPES?

They should warn about old DOCTYPEs and show errors for unknown ones.


> Why aren't MIME type version numbers included in HTTP Accept headers?

What good would it do?

On Mon, 20 Jul 2009 Darxus at ChaosReigns.com wrote:
> 
> Say I have some pages on my site that are HTML7, because I know that IE 
> 10 has pretty good support for it.  And I have some other pages that are 
> in HTML9 which became a Recommendation 4 years ago but which which IE 10 
> still doesn't support, but I have been very careful to accommodate IE 10 
> users by various means.  And I want to use a spidering validator on my 
> entire site.  And I want to make sure that the HTML7 stuff is valid 
> HTML7 so I can mostly not worry about it working with IE 10, but the 
> HTML9 pages obviously wouldn't validate as HTML7.

Just tell your spider that you want your pages checked for compatibility 
with IE10.


> It seems to me that in this case having an HTML version number somewhere 
> in the document would be useful.  And that this is a practical example.

The HTML version number has little bearing on whether the browsers support 
it. For example, IE8 supports some things from HTML5 and doesn't support 
everything from HTML4.


On Tue, 21 Jul 2009 Darxus at ChaosReigns.com wrote:
>
> Am I correct in concluding that my best option is to create my own HTML5 
> DTD, and use a DOCTYPE along the lines of:
> 
> <!DOCTYPE html SYSTEM "http://www.chaosreigns.com/DTD/html5.dtd">
> 
> ?

That would be invalid in HTML5.

It's not clear what you're trying to do. I doubt a DOCTYPE or DTD is the 
best way to solve your problem, though, whatever it is.


> Can the HTML5 spec be modified slightly to say that this sort of thing
> complies?
> ( http://dev.w3.org/html5/spec/Overview.html#the-doctype )

No, because it would encourage people to do what you're thinking of doing, 
which is a bad idea. :-)


> Another use that occurred to me is the case where someone has thousands 
> of html files, which they want to automatically validate at once, and 
> some of them have been updated to a more recent standard (and they want 
> to make sure they stay compliant with it), but others have not been 
> dealt with yet.

If for some reason you wanted to check some pages against HTML4 instead of 
HTML5, you could do that today just by noting which pages you want tested 
against the older version, either in some file, or by putting some comment 
in the file, or something. You don't need any help from HTML itself to do 
this. For example:

On Tue, 21 Jul 2009, Tab Atkins Jr. wrote:
> 
> If you absolutely need to embed extra information (such as a validation 
> schema that you will use for your own purposes to validate your own 
> documents), there are a multitude of ways to do so.  You could use a 
> data-* attribute on the <html> element.  You could use Microdata to 
> encode the information onto the document.  You could use a <link> 
> element to point to the schema.

But I don't know why you would ever want to do that.


It seems to me that the best thing would be to use a tool that just tells 
you which browsers a page is compatible with, and whether it follows the 
latest standards. You could then set off the spider on all pages on the 
site, and get back a report that says:

   The following pages don't work in IE12:
     ...

   The following pages have validation problems:
     ...

...etc. No need for the _pages_ to say which browsers they want to be 
compatible with; you presumably always want to be compatible with as many 
browsers as possible. If you actually care about compliance to older 
versions of HTML, then:

On Mon, 20 Jul 2009, Aryeh Gregor wrote:
> 
> So have the validator say "This is valid HTML7" or "This is valid HTML9" 
> or "This is valid HTML7, HTML8, and HTML9" or whatever is applicable.  
> It can check all the standards at once.  Why does it need to check only 
> one?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 30 July 2009 18:19:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC