mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Add :any-link (Level 4), :link and :visited selectors.
All links are considered "unvisited" for now.
This commit is contained in:
parent
651b2f072b
commit
74dfc3b66a
4 changed files with 50 additions and 2 deletions
|
@ -130,6 +130,18 @@ impl ElementLike for Element {
|
|||
|
||||
return value;
|
||||
}
|
||||
|
||||
fn get_link<'a>(&'a self) -> Option<&'a str> {
|
||||
// FIXME: This is HTML only.
|
||||
match self.node.type_id {
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#selector-link
|
||||
ElementNodeTypeId(HTMLAnchorElementTypeId) |
|
||||
ElementNodeTypeId(HTMLAreaElementTypeId) |
|
||||
ElementNodeTypeId(HTMLLinkElementTypeId)
|
||||
=> self.get_attr("href"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'self> Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue