Re: CSS 2: priorities in cascading order

Jason White writes:

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

I agree that a new keyword is the best solution.

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

Specificity is not a probelem. Consider the cascading rules in [1].
The rules are sorted w.r.t. "explicit weight" (i.e. "important" or
not) before origin and then specificity. A new keyword which is placed
over "important" will therefore automatically win over other rules
regardless of their specificity. Also, we will need a rule which
reservers the new keyword for users only.

[1] http://www.w3.org/TR/REC-CSS1#cascading-order

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

No, in many cases the UA will have to approximate values specified in
CSS declarations. The word "required" implies that if the demand can't
be met, something drastic will happen -- e.g. the page will not be
shown. This, in my mind, is incompatible with improving access to
information.

I think "accessibility" is a little better, but not much. How about
"x-important" in the good tradition of T-shirts?

Regards,

-h&kon

H   å   k   o   n      W   i   u   m       L   i   e
howcome@w3.org      http://www.w3.org/people/howcome
World     W      i     d     e       Web  Consortium

Received on Monday, 22 December 1997 07:36:20 UTC