Re: Core syntax error handling

Ian Hickson wrote to <> on 4 March 2003 in "Re: Core syntax
error handling" 

> 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.

I would like that very much.

> 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.

If user agents implement strict error handling, authors will be far less
likely to continue generating errors and far more likely to fix existing
errors. The consequence is that other people will be far more likely to
receive valid style sheets.

>> 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 point is not where something goes wrong, but what goes wrong and how.

Suppose that I set a background color for headings in a rule set that
follows a core syntax error. If I notice that the headings don't actually
render with the specified background color, I know which rule set the user
agent is ignoring, and I can look for that rule set in the style sheet.

> 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?

This is, I think, the strongest argument. My counterargument is not that we
should penalize readers, but that strict error handling would make the
occurrence of such penalties rare.

Etan Wexler, Range Rovin' with the cinema stars.

Received on Friday, 7 March 2003 02:51:40 UTC