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

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.

Stuart.

[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
http://www.netreach.com/

Received on Wednesday, 31 July 2002 08:01:38 UTC