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

Re: Core syntax error handling

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 4 Mar 2003 08:48:34 -0800 (PST)
To: Etan Wexler <ewexler@stickdog.com>
Cc: "www-style@w3.org" <www-style@w3.org>, David Baron <dbaron@fas.harvard.edu>
Message-ID: <Pine.LNX.4.50.0303040839340.7881-100000@dhalsim.dreamhost.com>

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"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 4 March 2003 11:48:21 GMT

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