SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Oct 2009
    Location
    London, UK
    Posts
    382
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unhappy visited pseudo class... problems in Chrome and Safari

    I am making a checklist, that ticks off links that have been clicked. It works by changing the background-position of a gif when the link is 'visited'. I have also changed the color of the text to check that it works.

    Everything works fine in FF, in Chrome and Safari the color will change, but the image will not.

    Funny that, cos if I change the position of the background-image in the hover state, it works fine...

    I've noticed a similar thing occurring on Matthew James Taylor's blog: http://matthewjamestaylor.com/blog/e...-visited-links, again works fine in FF, but no joy in Safari or Opera.

    My test page can be seen here: http://www.theclassifiedsband.co.uk/...ery/links.html

    and my css here:
    http://theclassifiedsband.co.uk/cssm.../css/links.css

    At the moment all the anchors are linked to hash, so clicking one of them essentially makes them all visited.

    If anyone could shed any light on this I would be very grateful.

    Best,
    Mike

  2. #2
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ? try w/o sprites. do you get the same result when you have a different image for :visited?




    ? i believe it has something to do with WebKit's calculated values for these:

    background-attachment: scroll;
    background-clip: border-box;
    background-origin: padding-box;

    try some different -webkit settings for them in your ul#tick li a:visited selector.

  3. #3
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also found this:

    A design issue exists in WebKit’s handling of the CSS :visited pseudo-class. A maliciously crafted website may be able to determine which sites a user has visited. This update limits the ability of web pages to style pages based on whether links are visited.
    so it seems it's a "feature" not a bug.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,374
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Yes noonnope is correct - it's a security issue.
    Quote Originally Posted by Dave Hyatt (Apple developer)
    We no longer honor background images on visited links. Firefox is also removing support for this capability. Honoring background images on visited links allows for timing attacks that let your set of visited sites be snooped.

    Mozilla released similar information earlier in the year which caught everyone a bit by surprise (especially as it was released on April the 1st ) .

    We also had a dicsussion in the forums about it.

  5. #5
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,365
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I haven't had time to test this but how about using the "visited" background for the A tag then setting alternatives for :link :active :hover and :focus?

    Code:
    ul#tick a { background: url(bgvisited.png);}
    ul#tick a:link { background: url(bglink.png);}
    ul#tick a:hover { background: url(bghover.png);}
    ul#tick a:active { background: url(bgactive.png);}
    ul#tick a:focus { background: url(bgfocus.png);}

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,374
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Good try but no Safari doesn't let that work

    It won't allow things like this either:

    a:visited span {background:url(img.png)}

  7. #7
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to summarize: as long as you have a :visited in a selector and a background setting in its rules, WebKit will probably catch it and will not allow the use.

  8. #8
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,034
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I remember that discussion. I still believe the better solution was to have the browser load the visited image whether it was needed or not. This would defeat the privacy invasion while retaining the option for designers. Offending sites would be crippled though by the image request load, but serves them right.

    At the very least, background-position should be allowed since it doesn't incur an image load.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •