Re: Core syntax error handling

On Tue, 4 Mar 2003, Etan Wexler wrote:
>>> Calling random or malformed junk CSS is a problem.
>> Why?
> Um, because junk is not CSS.

That's a circular argument.

> The term "CSS" should mean something useful. This is more a social than
> a technical issue; that does not lessen its importance.

Defining the error handling of all token streams doesn't make random
streams _valid_ CSS. If you like, we can say that invalid CSS stylesheets
are not CSS. That doesn't affect whether the error handling rules should
be defined or not.

>>> Perpetuating this junk by requiring user agents to accept it is a
>>> problem.
>> Why?
> The reason that first comes to mind is that human beings will, for the
> forseeable future, need to edit CSS in basic text editors. Requiring
> computer programs to follow a syntax and a set of error recovery rules is
> feasible. Requiring human beings to follow the same rules when confronted
> with a bewildering mess of errors is pure folly.

That doesn't follow either. The authors would have to deal with errors
written by their colleagues whether the spec defined the error handling or
whether UAs had to reverse engineer the error handling algorithms from
each other, as they have with HTML.

>> I don't see how this is any better than either the "parse or die" approach
>> or the well defined "here's what to do with any set of tokens" approach.
> [...]
> The style sheet shall be applied up to, but not including, the first
> statement which has an error. This approach will provide a visual (or aural
> or tactile) clue to the user or developer about where the error might be in
> the style sheet.

Actually, it wouldn't. CSS isn't like a markup language -- if you lose the
last ten lines of a stylesheet, you might not notice it before looking at
the fifteenth document, or you might notice it right at the top of the
first. The structure of stylesheets has very little to do with the
structure of the rendering.

> The approach outlined here is more informative to the erroneous style
> sheet designer than is an all-or-nothing approach. In addition, the
> approach outlined here is very likely to prompt a fix by the style sheet
> designer, certainly more likely than a junk-parsing approach.

The UA's job is to render the document so that the user gets what the
author intended. I'm all for authors writing valid stylesheets, but if
they don't, then why penalise the reader?

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.                         `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 4 March 2003 11:48:21 UTC