Closed Bug 765448 Opened 12 years ago Closed 12 years ago

Setting background-color in an 'a:visited' rule doesn't work

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mjh563, Unassigned)

References

Details

Attachments

(1 file)

Attached file testcase
The attached testcase sets the color of a ':visited' link to red and the background color to yellow. However, only the text color is applied.

Fails: Firefox 14, Chrome

Works as expected: Firefox 3.6.28, Opera 12
Attachment #633771 - Attachment mime type: text/plain → text/html
This is expected behavior due to http://dbaron.org/mozilla/visited-privacy

In particular, you're using a solid color for a:visited and a transparent background for unvisited links.  The relevant part of the document linked above is:

   If the relevant link is visited, it returns a color whose R (red), G (green), and B
   (blue) components come from the second style context (the style-if-visited) but whose A
   (alpha) component comes from the first.

And the unvisited style has an alpha of 0, so you get a transparent background.

Which is to say, you should be explicitly specifying backgrounds for unvisited links if you want links to have backgrounds...
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
OK, thanks. I wasn't aware of that particular aspect of the :visited history leak fix. As you say, it works if the unvisited link has an explicit (non-transparent) background color set.
Yeah... unfortunately, different alpha values for the two colors are subject to timing attacks, hence the restriction here.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: