aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/node.rs
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno.d@partner.samsung.com>2014-02-09 10:39:07 -0400
committerBruno de Oliveira Abinader <bruno.d@partner.samsung.com>2014-02-09 10:39:07 -0400
commit99b3b144d4cd3935ff3f90e0f32caf99a3f93cff (patch)
treec87fcbd374a0507ce1f09293cd460df7a2906731 /src/components/script/dom/node.rs
parent9305a95b68907c91a98a4cdd817f980c9f7f7e1f (diff)
downloadservo-99b3b144d4cd3935ff3f90e0f32caf99a3f93cff.tar.gz
servo-99b3b144d4cd3935ff3f90e0f32caf99a3f93cff.zip
Implement Node.contains
Spec: http://dom.spec.whatwg.org/#dom-node-contains Closes #1647.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r--src/components/script/dom/node.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs
index 6af9bff6331..8857e503b64 100644
--- a/src/components/script/dom/node.rs
+++ b/src/components/script/dom/node.rs
@@ -1538,8 +1538,11 @@ impl Node {
0
}
- pub fn Contains(&self, _other: Option<AbstractNode>) -> bool {
- false
+ pub fn Contains(&self, abstract_self: AbstractNode, maybe_other: Option<AbstractNode>) -> bool {
+ match maybe_other {
+ None => false,
+ Some(other) => abstract_self.is_inclusive_ancestor_of(other)
+ }
}
pub fn LookupPrefix(&self, _prefix: Option<DOMString>) -> Option<DOMString> {