aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2013-11-07 15:05:15 +0000
committerSimon Sapin <simon.sapin@exyr.org>2013-11-07 15:06:17 +0000
commit74dfc3b66ad3a1384fc838eb94e78e719738dc4d (patch)
treebcb679102309e1769b42670f9f98b59a84333a43 /src/components/script
parent651b2f072ba7393d6dc7e8710ec67f2e9a898b94 (diff)
downloadservo-74dfc3b66ad3a1384fc838eb94e78e719738dc4d.tar.gz
servo-74dfc3b66ad3a1384fc838eb94e78e719738dc4d.zip
Add :any-link (Level 4), :link and :visited selectors.
All links are considered "unvisited" for now.
Diffstat (limited to 'src/components/script')
-rw-r--r--src/components/script/dom/element.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index 24644e514af..1901278b40d 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -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 {