mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Cleanup Node::ChildNodes.
This commit is contained in:
parent
91c43ac18d
commit
19e44362e2
1 changed files with 5 additions and 10 deletions
|
@ -1714,16 +1714,11 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-childnodes
|
// http://dom.spec.whatwg.org/#dom-node-childnodes
|
||||||
fn ChildNodes(self) -> Temporary<NodeList> {
|
fn ChildNodes(self) -> Temporary<NodeList> {
|
||||||
match self.child_list.get() {
|
self.child_list.or_init(|| {
|
||||||
None => (),
|
let doc = self.owner_doc().root();
|
||||||
Some(list) => return list,
|
let window = doc.window().root();
|
||||||
}
|
NodeList::new_child_list(*window, self)
|
||||||
|
})
|
||||||
let doc = self.owner_doc().root();
|
|
||||||
let window = doc.window().root();
|
|
||||||
let child_list = NodeList::new_child_list(*window, self);
|
|
||||||
self.child_list.assign(Some(child_list));
|
|
||||||
self.child_list.get().unwrap()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-firstchild
|
// http://dom.spec.whatwg.org/#dom-node-firstchild
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue