Bug 142734
| Summary: | :not(:link) and :not(:visited) don't match <a name="foo"> | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adam Roben (:aroben) <aroben> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ahmad.saleem792, ap, benjamin, bfulgham, rniwa, simon.fraser, zalan |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | data:text/html,<style>a { color: red } a:not(:link) { color: green }</style><a name="foo">should be green</a> | ||
Adam Roben (:aroben)
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.)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adam Roben (:aroben)
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>
Benjamin Poulain
We removed support for :link and :visited inside :not() when we extended :not() to Level 4.
Benjamin Poulain
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.
Adam Roben (:aroben)
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.
Benjamin Poulain
(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.
Ahmad Saleem
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!