Closed Bug 44100 Opened 20 years ago Closed 20 years ago

Cascading Rules for Link Pseudo Classes not observed.


(Core :: CSS Parsing and Computation, defect, P3)

Windows 98





(Reporter: val, Assigned: pierre)


From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD  (Win98; I)
BuildID:    2000061311

Quoting from CSS2:

A:link    { color: red }    /* unvisited links */
A:visited { color: blue }   /* visited links   */
A:hover   { color: yellow } /* user hovers     */
A:active  { color: lime }   /* active links    */

Note that the A:hover must be placed after the A:link and A:visited rules, since 
otherwise the cascading rules will hide the 'color' property of the A:hover 
rule. Similarly, because A:active is placed after A:hover, the active color 
(lime) will apply when the user both activates and hovers over the A element. 

I find that, no matter in what order I list the above styles, the result is the 

Reproducible: Always
Steps to Reproduce:
1.Create a simple case based on the CSS2 example:

A:link    { color: red }
A:visited { color: blue }
A:hover   { color: yellow }
A:active  { color: lime }
<a href="#">text</a>

Observe that hovering makes the text yellow.
Now try placing the A:hover rule before A:link rule. 

Actual Results:  Observe that hovering still makes the text yellow, showing that 
cascading rules have not hidden the Hover style, as described in CSS2.

Expected Results:  Hover color hidden by either Link or Visited color.
This works for me...

When I use the following:

A:hover   { color: yellow }
A:link    { color: red }
A:visited { color: blue }
A:active  { color: lime }
<a href="#">Hover should not change the color because of cascade order...</a>

the link does not turn yellow when I hover over it (it is red unless I make it 
active, in which case it turns lime). If I put the A:active rule above the 
a:link rule then it will not turn lime. The cascade is correct.

Reporter, please re-check your testcase and post a comment if you still believe 
it is a bug. Thanks.
Closed: 20 years ago
Resolution: --- → WORKSFORME
Pleased to say, you are quite right.

(Bug 44114 fooled me - ie. page won't reload after jumping to anchor unless one 
goes 'back' first. Which is why, on 'reloading' a new version with the rules 
reordered, the result appeared to be the same.) 
Source code problem. Marking verified.
You need to log in before you can comment on or make changes to this bug.