1. Go to data:text/html,<style>a { color: red } a:not(:link) { color: green }</style><a name="foo">should be green</a> In Chrome and Firefox, the text is green. In Safari 8.0.3 on Yosemite, it is red. (I haven't tested other versions/OSes.)
Looks like :not(:visited) also does not match <a name="foo">. Try with this URL: data:text/html,<style>a { color: red } a:not(:visited) { color: green }</style><a name="foo">should be green</a>
We removed support for :link and :visited inside :not() when we extended :not() to Level 4.
I should probably explain why a bit :) Previously, we could find out statically if a selector applies to :link or :visited. Since we added support for nested selector lists, it is no longer possible to know the "link-state" of a selector until it is matched. Because of the privacy risks involved with dynamic resolution, we decided against it. If you have good use cases for it, we can look into adding support back. But that's gonna be weeks of work.
I don't have a use case for this at the moment. I just noticed it while working on filing bug 142737. I'd be OK with closing this.
(In reply to comment #4) > I don't have a use case for this at the moment. I just noticed it while > working on filing bug 142737. I'd be OK with closing this. Let's keep the bug report open, it is a valid bug, just not very high priority right now.
I changed the test cases into below: Comment 0 - JSFiddle - https://jsfiddle.net/hbm41689/show Comment 1 - JSFiddle - https://jsfiddle.net/v7z84sp3/show In both above, all browsers (Chrome Canary 106, Firefox Nightly 104 and Safari 15.6 on macOS 12.5 show the text as "GREEN". Since all browsers are matching each other, I think this can be marked as "RESOLVED WONTFIX" or "RESOLVED CONFIGURATION CHANGED" etc., if I am testing incorrectly or web-spec dictates something else then please retest accordingly. Thanks!