diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2016-01-22 03:24:28 -0500 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-01-24 13:05:47 -0500 |
commit | 9e3af70941c74eed41f47ff13d0fc7cfd2300403 (patch) | |
tree | 0b34e60d1dcb7aa9eedd034baca30fe9324ba726 /components/script/dom/nodelist.rs | |
parent | e93a460db4902195ec64e6fe67817f9e3a7c1da9 (diff) | |
download | servo-9e3af70941c74eed41f47ff13d0fc7cfd2300403.tar.gz servo-9e3af70941c74eed41f47ff13d0fc7cfd2300403.zip |
Implement RadioNodeList
Diffstat (limited to 'components/script/dom/nodelist.rs')
-rw-r--r-- | components/script/dom/nodelist.rs | 13 |
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() } |