mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move Node::Children to a better place.
This commit is contained in:
parent
81ef420e3f
commit
22a6485708
1 changed files with 14 additions and 14 deletions
|
@ -873,6 +873,20 @@ impl Node {
|
||||||
self.first_child.is_some()
|
self.first_child.is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://dom.spec.whatwg.org/#dom-node-childnodes
|
||||||
|
pub fn ChildNodes(&mut self, abstract_self: &JS<Node>) -> JS<NodeList> {
|
||||||
|
match self.child_list {
|
||||||
|
None => {
|
||||||
|
let doc = self.owner_doc();
|
||||||
|
let doc = doc.get();
|
||||||
|
let list = NodeList::new_child_list(&doc.window, abstract_self);
|
||||||
|
self.child_list = Some(list.clone());
|
||||||
|
list
|
||||||
|
}
|
||||||
|
Some(ref list) => list.clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-firstchild
|
// http://dom.spec.whatwg.org/#dom-node-firstchild
|
||||||
pub fn GetFirstChild(&self) -> Option<JS<Node>> {
|
pub fn GetFirstChild(&self) -> Option<JS<Node>> {
|
||||||
self.first_child.clone()
|
self.first_child.clone()
|
||||||
|
@ -942,20 +956,6 @@ impl Node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-childnodes
|
|
||||||
pub fn ChildNodes(&mut self, abstract_self: &JS<Node>) -> JS<NodeList> {
|
|
||||||
match self.child_list {
|
|
||||||
None => {
|
|
||||||
let doc = self.owner_doc();
|
|
||||||
let doc = doc.get();
|
|
||||||
let list = NodeList::new_child_list(&doc.window, abstract_self);
|
|
||||||
self.child_list = Some(list.clone());
|
|
||||||
list
|
|
||||||
}
|
|
||||||
Some(ref list) => list.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#concept-node-adopt
|
// http://dom.spec.whatwg.org/#concept-node-adopt
|
||||||
fn adopt(node: &mut JS<Node>, document: &JS<Document>) {
|
fn adopt(node: &mut JS<Node>, document: &JS<Document>) {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue