W3C home > Mailing lists > Public > www-style@w3.org > September 1999

Re: "Inheriting" from a less-specific selector

From: Braden N. McDaniel <braden@shadow.net>
Date: Wed, 1 Sep 1999 03:20:05 -0400
Message-ID: <008701bef44a$71442080$2e3a11cf@boneone>
To: "Ian Hickson" <py8ieh@bath.ac.uk>
Cc: <www-style@w3.org>, "Bert Bos" <Bert.Bos@sophia.inria.fr>
----- Original Message -----
From: Ian Hickson <py8ieh@bath.ac.uk>
To: Braden N. McDaniel <braden@endoframe.com>
Cc: <www-style@w3.org>; Bert Bos <Bert.Bos@sophia.inria.fr>
Sent: Saturday, August 28, 1999 10:48 AM
Subject: Re: "Inheriting" from a less-specific selector

> On Thu, 26 Aug 1999, Braden N. McDaniel wrote:
> > CSS1 has the problem that while inheritance was the effective initial
> > value for many properties, there was no way for style sheet authors to
> > specify it. So once it had been overridden, there was no way to
> > reclaim the inheritance behavior lower in the cascade. CSS2,
> > fortunately, fixed this.
> >
> > With the pseudo-classes ":active", ":hover", and ":focus", CSS2
> > introduces the notion that, by "default", these pseudo-classes inherit
> > their property values from the next-least-specific selector for an
> > element.
> CSS1 has this 'problem' too, and there is no need to invoke pseudo
> classes to demonstrate it: this is the whole idea of the cascade.
> For example:
>    P EM { color: red }
>    STRONG EM { color: green }
>    <P> <STRONG> <EM> green </EM> </STRONG> </P>
> How can you make an EM in a STRONG be the same color as an EM _not_ in a
> STRONG, without knowing what the colour of an EM not in a strong would
> normally be? You can't. (You could override the later rule by using
> !important, and you could change the order, but that is 'cheating'.)

Ah, right you are. I don't buy, though, that this is the "whole idea of the

> > For the "cascade" concept to work where the state of the cascade is not
> > known in advance, it is imperitive that style sheet authors always be
> > able to restore the cascade to a defined state.
> Not IMHO. So long as users and UAs write stylesheets that are self-
> consistent and responsible (see David's piece, quoted earlier today),

Are you suggesting that it is reasonable for context selectors to be "off
limits" for default and user stylesheets?

> then
> there is no need for authors to be totally in control of the cascade.

But the fundamental folly of the assumption that browser designers will
ensure that they use friendly default stylesheets is soundly demonstrated by
the current crop of UA default stylesheets. Ultimately, any significant
number of user style sheets created will be through some future browser's
GUI for doing so--what reason is there to expect anything other than the
same level of robustness for the stylesheet that GUI generates?

Braden N. McDaniel
Received on Wednesday, 1 September 1999 03:39:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:51 UTC