1

I'm making a custom stylesheet for a particular web site in Firefox 4. In it, I'm trying to prefix red 'x's to links that I've visited. Now, when I say making, I mean it used to work a while ago, and at some point, these 'x's stopped appearing (though the rest of the stylesheet works just fine).

Now, a:before (and a::before, per CSS3) works fine. a:visited works fine. Neither a:visited:before nor a:visited::before works at all (well, almost).

During my play-testing, I left in a::before, and still had my a:visited::before declaration to use red 'x's. For non-visited links, the a::before content was the same text color, but for visited links, the ::before content was the 'right' color (red).

Here is a pastebin of the CSS at one point: http://pastebin.com/6Tzy1Q87

And here is a screencap of what that CSS resulted in: https://i.stack.imgur.com/rtw9L.png

Notice that the a::before simply specifies the content to a checkmark. The a:visited::before should change the weight, color, and content, but only changes the color.

I heard about a recent security 'feature' regarding Firefox and page history, but as I understood it, that would affect the regular a:visited selector as well.

1 Answers1

3

Selectors including :visited are only allowed to change colors in Firefox 4, yes. That applies whether or not ::before is involved. See http://dbaron.org/mozilla/visited-privacy

I'd be curious to see what CSS you had that allowed you to change something other than colors using :visited.

Boris Zbarsky
  • 34,758
  • 5
  • 52
  • 55
  • I couldn't change anything other than color, unfortunately. What is also interesting, though, is that I have `a::before`, then `a:visited::before`, and finally `a:hover::before`. `a::before` is set to an 'invisible' color (the parent element's background color), `:visited` is set to red, and `:hover` is set to black. `:hover` only actually changes unvisited links' `::before` to black; visited links' `::before` stay red when hovered. – Domenic Barbuzzi May 01 '11 at 04:41
  • So like this? ` ` This seems to work fine for me. – Boris Zbarsky May 01 '11 at 12:30
  • –I made a sample page of on my own host and you're right, it does work. I'm making a custom sheet that's imported through and addon for an extremely poor, convoluted page, so I'll have to do a bit of investigating in the DOM. Still don't like the rest of this 'security' feature, or, at least, not being able to enable CSS compliance. – Domenic Barbuzzi May 02 '11 at 03:04
  • Well, the point of this feature is to not let any site you visit find out what other sites you've visited. It's a privacy feature not a security one. As for compliance, the CSS2.1 candidate recommendation section 5.11.2 says "UAs may therefore treat all links as unvisited links, or implement other measures to preserve the user's privacy while rendering visited and unvisited links differently." – Boris Zbarsky May 02 '11 at 03:19