W3C home > Mailing lists > Public > www-style@w3.org > March 2003

Re: Core syntax error handling

From: Etan Wexler <ewexler@stickdog.com>
Date: Thu, 06 Mar 2003 15:27:20 -0800
To: www-style@w3.org, Ian Hickson <ian@hixie.ch>
Cc: David Baron <dbaron@fas.harvard.edu>
Message-id: <BA8D193A.156%ewexler@stickdog.com>

Ian Hickson wrote to <www-style@w3.org> on 4 March 2003 in "Re: Core syntax
error handling" 
(<mid:Pine.LNX.4.50.0303040839340.7881-100000@dhalsim.dreamhost.com>):

> 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.
 <mailto:ewexler@stickdog.com>
Received on Friday, 7 March 2003 02:51:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:20 GMT