aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-01-18 08:09:43 -0700
committerbors-servo <metajack+bors@gmail.com>2015-01-18 08:09:43 -0700
commitea83ffdb980d290a910e78b96c3f056280487ac7 (patch)
tree99bbd28cc2b98520055285f650f72a10571a760f /components/script/dom/node.rs
parent2a9acdcb73685f2c5c14b51f33b741690b60cb23 (diff)
parent7759358e0978909986216409884b9d1d66afe87f (diff)
downloadservo-ea83ffdb980d290a910e78b96c3f056280487ac7.tar.gz
servo-ea83ffdb980d290a910e78b96c3f056280487ac7.zip
auto merge of #4621 : jimrhoskins/servo/closest, r=jdm
fixes #4603 - Add definition to the Element.webidl and implementation to element.rs. - Create inclusive_ancestors helper in NodeHelpers - Update test expectations
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index bc44aeda8ba..fb336efd85b 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -397,6 +397,7 @@ impl<'a> Iterator<JSRef<'a, Node>> for QuerySelectorIterator<'a> {
pub trait NodeHelpers<'a> {
fn ancestors(self) -> AncestorIterator<'a>;
+ fn inclusive_ancestors(self) -> AncestorIterator<'a>;
fn children(self) -> NodeChildrenIterator<'a>;
fn rev_children(self) -> ReverseChildrenIterator;
fn child_elements(self) -> ChildElementIterator<'a>;
@@ -798,6 +799,12 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
}
}
+ fn inclusive_ancestors(self) -> AncestorIterator<'a> {
+ AncestorIterator {
+ current: Some(self.clone())
+ }
+ }
+
fn owner_doc(self) -> Temporary<Document> {
self.owner_doc.get().unwrap()
}