Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CSS :link selector #8720

Closed
frewsxcv opened this issue Nov 28, 2015 · 2 comments
Closed

Support for CSS :link selector #8720

frewsxcv opened this issue Nov 28, 2015 · 2 comments

Comments

@frewsxcv frewsxcv changed the title Support for CSS :link Support for CSS :link selector Dec 4, 2015
@salty-horse
Copy link
Contributor

@salty-horse salty-horse commented Dec 5, 2015

Seems implemented here: components/script/dom/element.rs:1680

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Dec 5, 2015

:link is misnamed in CSS since it’s exclusive with :visited: it only matches links that are not visited. I’ve named the trait methods according to the pseudo-classes’ meaning rather than their syntax:

  • Selector :link calls trait method fn is_unvisited_link(&self) -> bool
  • Selector :visited calls trait method fn is_visited_link()(&self) -> bool
  • Selector :any-link is equivalent to :matches(:link, :visited), calls trait method fn is_link()(&self) -> bool

https://github.com/servo/rust-selectors/blob/74a3ff5228/src/parser.rs#L620-L622
https://github.com/servo/rust-selectors/blob/74a3ff5228/src/matching.rs#L657-L666

:link is already implemented, but at the moment it is identical to :any-link for reasons explained in #8718 (comment).

Closing this issue in favor of #8718, since it’s really the same thing.

@SimonSapin SimonSapin closed this Dec 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.