In article ,
"Richard Torrens (News)" wrote:
> In article ,
> Eric Lindsay wrote:
> > >
> > > <A NAME="content"><H2>Contents</H2></A>
> > > is wrong but surely doesn't confuse any browser.
>
> > You get away with it because browser error handling is so
> > very good.
>
> I cannot disagree. However - browser parsing _is_ that good. Maybe the
> validation should accept that.
However, ever since HTML2, the HTML markup language has been declared as
being an SGML derived product. This in turn means that the Doctype
points to a machine readable DTD which actually specifies exactly how
you need to parse the HTML. That is technically what the validator does.
You could write a browser that did the same, except most pages would
break. So all the browsers ignore the DTD, in favour of using their own
internal representation of how a web page is constructed.
In Internet Explorer for Mac 5, Tantek Celik first started using Doctype
sniffing to decide whether a web site was an old site (probably broken),
or a new site that should be written to W3C specifications (indicated by
a Doctype). IE6 for Windows did the same. Unfortunately, people doing
web sites started putting Doctypes in them, mostly because other people
were putting Doctypes in them. And people writing web editors started
adding Doctypes automatically.
> But it's no big issue: the issue is that sites should at least try and
> validate.
I could not agree more. That is why several of my web sites are actually
written in XHTML rather than HTML. This is not something any commercial
site could do. As a result, Macintosh OS X users can view my web sites,
since all standard OS X web browsers can handle XHTML correctly.
However Windows users with Internet Explorer can not view my web sites.
Internet Explorer is totally unable to use XHTML. As a result, you
basically can not use XHTML on the web. So, no-one does.
> > At least with a valid page in Standards mode, you (mostly) know what the
> > web browser is supposed to do with it, according to the specifications.
> > With an invalid page, you have to guess how the browser error handling
> > will cope with it. There is no specification for error handling in
> > browsers.
>
> Apparently there indeed are standards for how browsers should handle
> broken pages.
No, there are not. There are W3C specifications for how to write web
pages, and these have the authority of a standard (according to the RFC
that passed control to W3C). All the major browser makers (including
Microsoft, which were first to use CSS, for example) are members of
W3C. All have agreed to make their web browsers use W3C specifications.
For handling errors, each web browser tries to imitate what previous
versions of browsers (mostly Netscape Navigator and IE3 through 5) did.
Then IE6 tried to imitate IE5. Then IE7 tried to imitate IE6. Then IE8
got a spevial little switch that would let it imitate IE7 imitating IE6,
and so on. And every other browser tried to imitate most of this.
--
http://www.ericlindsay.com >> Stay informed about: W3C Validation -- Amusing Results