Bug 39420 - REGRESSION: :visited pseudo class doesn't work for links with custom background
Summary: REGRESSION: :visited pseudo class doesn't work for links with custom background
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.6
: P2 Normal
Assignee: Dave Hyatt
URL: http://iamsteve.me
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-05-20 04:55 PDT by Steve
Modified: 2010-05-21 14:17 PDT (History)
6 users (show)

See Also:


Attachments
a visited link (35.78 KB, image/png)
2010-05-20 14:55 PDT, Steve
no flags Details
reduced test case (only works from a local file) (1.01 KB, text/html)
2010-05-20 16:38 PDT, Alexey Proskuryakov
no flags Details
Patch (71.56 KB, patch)
2010-05-21 00:32 PDT, Dave Hyatt
hyatt: review-
Details | Formatted Diff | Diff
Patch (78.44 KB, patch)
2010-05-21 00:57 PDT, Dave Hyatt
no flags Details | Formatted Diff | Diff
New patch that should build on Chromium (80.92 KB, patch)
2010-05-21 01:22 PDT, Dave Hyatt
no flags Details | Formatted Diff | Diff
Address Dan's comments from IRC and make more Chromium build fixes (81.64 KB, patch)
2010-05-21 02:20 PDT, Dave Hyatt
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2010-05-20 04:55:05 PDT
as the title suggests, and my website is using the pseudo class to show which page you are on. it works fine within the latest version of safari it just doesn't seem to be in the latest webkit nightly
Comment 1 Alexey Proskuryakov 2010-05-20 14:38:33 PDT
Could you please clarify what exactly doesn't work? I don't see any difference in look or behavior (other than different text antialiasing in top left box).
Comment 2 Steve 2010-05-20 14:55:49 PDT
Created attachment 56636 [details]
a visited link
Comment 3 Steve 2010-05-20 14:57:58 PDT
i've amended the title i put the wrong pseudo class, i meant the visited one, sorry for the confusion.

i've uploaded a picture to show, on each page of my website it has a unique body id and for that body id each page has a visited state for the navigation to show the user which page they are on. it doesn't show up webkit, maybe it's my coding but it works fine in safari

sorry again for the confusion hope this clears it up
Comment 4 Alexey Proskuryakov 2010-05-20 16:38:30 PDT
Created attachment 56646 [details]
reduced test case (only works from a local file)
Comment 5 Alexey Proskuryakov 2010-05-20 16:38:51 PDT
<rdar://problem/8011575>
Comment 6 Dave Hyatt 2010-05-20 17:28:32 PDT
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.
Comment 7 Dave Hyatt 2010-05-20 17:29:06 PDT
http://dbaron.org/mozilla/visited-privacy has the details of the new algorithm used by both Firefox nightlies and WebKit nightlies.
Comment 8 Dave Hyatt 2010-05-20 17:31:00 PDT
Specifically see the Risks section in that document.
Comment 9 Dave Hyatt 2010-05-20 17:44:43 PDT
The fact that normal colors don't work is a bug though.  Let me look into it.
Comment 10 Steve 2010-05-20 22:31:35 PDT
thanks for clearing this up, so i guess i'm better off removing the visited class. will there be something safer/similar implemented it's just on the side of usability for the user, not a huge issue, but it's a little helper?
Comment 11 Steve 2010-05-20 22:36:12 PDT
read the article you suggested, so ignore my question.
Comment 12 Dave Hyatt 2010-05-21 00:32:47 PDT
Created attachment 56679 [details]
Patch
Comment 13 WebKit Review Bot 2010-05-21 00:34:24 PDT
Attachment 56679 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/ChangeLog:10:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 1 in 54 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Dave Hyatt 2010-05-21 00:35:09 PDT
Comment on attachment 56679 [details]
Patch

Nvm, I see a few typos.
Comment 15 Dave Hyatt 2010-05-21 00:57:45 PDT
Created attachment 56680 [details]
Patch
Comment 16 WebKit Review Bot 2010-05-21 01:06:58 PDT
Attachment 56679 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/2294417
Comment 17 Dave Hyatt 2010-05-21 01:22:27 PDT
Created attachment 56681 [details]
New patch that should build on Chromium
Comment 18 WebKit Review Bot 2010-05-21 01:46:22 PDT
Attachment 56680 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/2279412
Comment 19 WebKit Review Bot 2010-05-21 02:10:46 PDT
Attachment 56681 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/2314379
Comment 20 Dave Hyatt 2010-05-21 02:20:21 PDT
Created attachment 56685 [details]
Address Dan's comments from IRC and make more Chromium build fixes
Comment 21 Alexey Proskuryakov 2010-05-21 09:50:08 PDT
> We no longer honor background images on visited links.

I'm curious whether the site should work anyway - it uses the same image for every state, but with offset and clipping.
Comment 22 Steve 2010-05-21 10:23:03 PDT
it's css sprites, it works in all browsers - it saves for having to use javascript and such things and allows for better page load times and less requests made, it's a widely used technique from what i know.
Comment 23 Dave Hyatt 2010-05-21 11:46:53 PDT
Pretty sure you're still vulnerable to timing attacks if you are willing to render different portions of the same image.  If the image can be repositioned, you can affect the rendering time by keeping it from painting using clips.
Comment 24 Steve 2010-05-21 12:27:08 PDT
(In reply to comment #23)
> Pretty sure you're still vulnerable to timing attacks if you are willing to render different portions of the same image.  If the image can be repositioned, you can affect the rendering time by keeping it from painting using clips.

i never knew this existed so i'm glad i reported it and i'll be making some changes so i don't get caught out
Comment 25 Dave Hyatt 2010-05-21 13:57:54 PDT
Fix landed in r59956.
Comment 26 WebKit Review Bot 2010-05-21 14:17:37 PDT
http://trac.webkit.org/changeset/59956 might have broken Qt Linux Release
The following changes are on the blame list:
http://trac.webkit.org/changeset/59955
http://trac.webkit.org/changeset/59956