W3C home > Mailing lists > Public > w3c-wai-hc@w3.org > October to December 1997

Re: CSS 2: priorities in cascading order

From: Charles McCathieNevile <charlesn@sunrise.srl.rmit.edu.au>
Date: Mon, 22 Dec 1997 12:49:44 +1100 (EST)
To: WAI HC Working Group <w3c-wai-hc@w3.org>
Message-ID: <Pine.SUN.3.91.971222120751.16960A-100000@sunrise.srl.rmit.edu.au>
First a brief introduction, as I am new here. I work in the Sunrise 
research lab at RMIT (Melbourne). Our interests include WAI, 
internationalisation, and similar access issues. We also have projects 
working with Indigenous Australians and schools, and we are a W3C member 
organisation.

And now some thoughts.

In my discussions with Jason White, I proposed that re-ordering the rules 
would be a good solution. In practice this allows CSS1 to be better 
interpreted by a CSS2 User Agent. In addition, it allows the author's 
rules to take part in the cascade, which is a significant improvement 
over throwing out the stylesheet. It does not seem too hard to change the 
algorithm in implementations, although I can understand why a designer 
would be annoyed at the rules changing.
In order to make this system work very well, a User agent would allow 
it's defaults to be changed, or a user style sheet to be declared. A 
practical appraoch would be similar to changing text colours in older 
browsers, which allow for colour defaults to be set, then allow for user 
or author colours to take priority, which in my model is asking whther 
the settings are UA defaults or a user style sheet.

 This gives the following priority
user !important
author !important
user
author
UA defaults (including re-set defaults)

The problem which it does not resolve is the specificity. This is where I 
would see a use for a new keyword. My first idea was to introduce two new 
keywords - !class and !id. Use of either of these in a user stylesheet 
declaration would result in that declaration being interpreted as 
specific to any class or id respectively, although it may be a more 
general declaration.

The benefit of these two systems is that they would give CSS1 "forward 
compatibility", allowing CSS1 stylesheets to be as functional as CSS2. 
the changes, by being implemented in the UA's rather than the source 
documents, would all work for CSS1 styled material as well as CSS2.

Charles McCathienevile



On Mon, 22 Dec 1997, Jason White wrote:

> My thinking in this area is moving toward embracing the proposal of
> including an extra key word in CSS 2 (such as !required; as Al has
> suggested). The main reason for this stems from the specificity problem.
> As discussed in an earlier example, the desired effect is that the user's
> requirement should take precedence over all of the author's rules,
> including those which would otherwise have greater specificity. The
> !important key word currently has no impact on specificity. Thus, an extra
> directive could be defined which (1) only has effect when it occurs in a
> user's style sheet; and (2) ensures that the rule to which it applies has
> priority over such of the author's rules as would otherwise have greater
> specificity.
> 
> I would envisage the priority scheme as follows:
> 
> User Required
> Author Important
> User Important
> Author Required Author Normal
> User Normal
> 
> This retains existing priorities, but adds "user required" at the top of
> the hierarchy, as well as changing the specificity rules.
> 
> I would favour a key word such as "!required" rather than
> "!accessibility".
> 
> 
> 
Received on Sunday, 21 December 1997 21:04:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:56:12 UTC