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

Re: Core syntax error handling

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 6 Mar 2003 18:23:32 -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.0303061802150.22524-100000@dhalsim.dreamhost.com>

On Thu, 6 Mar 2003, Etan Wexler wrote:
>>>
>>> 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.

I understand the point you were trying to make. My point, though, was that
it isn't as simple as you make out:

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

Take a sample stylesheet, such as:

   http://microsoft.com/library/shared/common/css/n6.css

Imagine that this line had an error (coincidentally, it does):

|      [...]
|      border-left:solid 1 #CCCCCC; border-top:solid 1 #CCCCCC;
|      [...]

Note how all the rules after that one are unlikely to exist on every page,
and that they are only minor style changes and therefore unlikely to be
spotted straight away if they were dropped.

It would be distinctly unobvious what was causing those rules to be
dropped if you later noticed a tiny font size difference.


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

I am not convinced that losing the rules beyond the error, vs the one rule
that is broken, is likely to reduce the number of occurances much.

Note also that even your proposal, as I understand it, would still have
_some_ cases (those given in CSS1?) that would not cause complete abortion
of parsing, such as missing units or invalid values. So you end up with a
mixed bag of error handling.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 7 March 2003 03:48:14 GMT

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