RE: Can Browsers Attempt to Render Broken XHTML?

> A general principle of robustness: be conservative in what you do, be
> liberal in what you accept from others.
>
> Under this principle, validators and programs that produce code
> should be as conservative as possible; user agents, since they accept
> code, should be as liberal as possible.

Yep, it was the principle that allowed Geoffrey to know I meant "principle"
when I mis-typed it "principal".

This doesn't *necessarily* mean that browsers should render broken XHTML
though; that is one possible policy that would attempt to follow the basic
principle, but there are other times when reporting an error is the best aid
to the robustness of the whole system.

One of the main reasons for the approach taken to the robustness principle
with HTML4.0 and earlier was that it allowed HTML specs to be
forward-compatible with later specs, and experimental extensions. The use of
XML namespaces gives us mechanisms which allows us to do this in a somewhat
more reliable way - at least a browser can tell when you are doing something
it doesn't understand from when you are doing something it does understand
but doing it wrong, so there is less need for that approach with XHTML.

The other reason is that generally it's the best you can do when you have a
possibly non-technical user on the opposite side of the world from a server
whose contact information he can't obtain (because it keeps sending
incorrect data).

Personally what I would like browsers to do when they encounter broken XHTML
is to report the error clearly, explain that what they are showing is a
best-attempt to render and may contain inaccuracies, and then parse as
text/html. The error message would be vital to developers and would help
prevent disasters caused by the buggy code (which might lead to an important
piece of information not rendering). The best-attempt rendering will allow
users to continue with what they are doing as best the can in the
circumstances. To my mind this gets the best of both worlds in such a
scenario.

Automated user-agents have different requirements in such scenarios. In
general I would have them just consider the entire page to have failed.

Received on Friday, 27 June 2003 07:08:05 UTC