mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement RadioNodeList
This commit is contained in:
parent
e93a460db4
commit
9e3af70941
6 changed files with 175 additions and 11 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue