W3C home > Mailing lists > Public > www-style@w3.org > July 2002

Re: a:hover and a:active and named anchors

From: Stuart Ballard <sballard@netreach.com>
Date: Wed, 31 Jul 2002 08:01:32 -0400
Message-ID: <3D47D19C.5070407@netreach.com>
To: www-style@w3.org

Coises wrote:
> [Tue, 30 Jul 2002 15:01:16 -0400] Stuart Ballard:
> (I believe most current browsers behave as if they had the rules:
>      *       {dynamic: none}
>      a[href] {dynamic: all}
> in their user agent default style sheets, but --- of course --- don't
> recognize the "dynamic" property in user and author style sheets.)

Nice, except for one small problem...

a {dynamic: hover; background-color: blue}
a:hover {dynamic: not hover; background-color: red}

That sets up an infinite loop whenever you hover over a link - the hover 
turns on, so the background goes red, but then also the hover gets 
disabled, so hover no longer matches and the background goes blue again, 
but then hover matches again, so...

(The general principle that's being violated here was stated by Hixie, I 
believe[1], as "selectors can't depend on values of CSS properties". I'm 
confused as to how the interaction of "user-focus" and ":focus" can be 
rationalized in these terms - surely it's vulnerable to the same problem 
as the 'dynamic' property proposed above - but the general principle 
makes sense. Perhaps what's really needed is a different general 
principle "properties that affect whether pseudoclasses apply or not 
will be ignored when applied to a selector that contains a pseudoclass")

Now, it might be possible to use some new at-rule to get this behavior, 
since there's no predefined limitations on what at-rules can do that I 
know of. But then the syntax is harder to specify, because you either 
have to include by reference the whole selector and property syntax into 
an at-rule syntax, or reinvent a limited version for this at-rule.


[1] Hixie, feel free to jump in and correct me if I'm wrong...

Stuart Ballard, Programmer
NetReach - Internet Solutions
(215) 283-2300, ext. 126
Received on Wednesday, 31 July 2002 08:01:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:02 UTC