aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/nodelist.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/nodelist.rs')
-rw-r--r--components/script/dom/nodelist.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs
index 6747ee5a948..5987b1b26f0 100644
--- a/components/script/dom/nodelist.rs
+++ b/components/script/dom/nodelist.rs
@@ -28,7 +28,7 @@ pub struct NodeList {
impl NodeList {
#[allow(unrooted_must_root)]
- fn new_inherited(list_type: NodeListType) -> NodeList {
+ pub fn new_inherited(list_type: NodeListType) -> NodeList {
NodeList {
reflector_: Reflector::new(),
list_type: list_type,
@@ -36,8 +36,7 @@ impl NodeList {
}
#[allow(unrooted_must_root)]
- pub fn new(window: &Window,
- list_type: NodeListType) -> Root<NodeList> {
+ pub fn new(window: &Window, list_type: NodeListType) -> Root<NodeList> {
reflect_dom_object(box NodeList::new_inherited(list_type),
GlobalRef::Window(window), NodeListBinding::Wrap)
}
@@ -93,6 +92,10 @@ impl NodeList {
panic!("called as_children_list() on a simple node list")
}
}
+
+ pub fn get_list_type(&self) -> &NodeListType {
+ &self.list_type
+ }
}
#[derive(JSTraceable, HeapSizeOf)]
@@ -114,6 +117,10 @@ impl ChildrenList {
}
}
+ pub fn get_parent_node(&self) -> &Node {
+ &*self.node
+ }
+
pub fn len(&self) -> u32 {
self.node.children_count()
}