mirror of
https://github.com/servo/servo.git
synced 2025-10-15 07:50:20 +01:00
Implemented Document.importNode
Spec: http://dom.spec.whatwg.org/#dom-document-importnode
This commit is contained in:
parent
f34a64049a
commit
8a457a2caa
4 changed files with 24 additions and 3 deletions
|
@ -728,7 +728,7 @@ fn gather_abstract_nodes(cur: &JS<Node>, refs: &mut ~[JS<Node>], postorder: bool
|
|||
}
|
||||
|
||||
/// Specifies whether children must be recursively cloned or not.
|
||||
enum CloneChildrenFlag {
|
||||
pub enum CloneChildrenFlag {
|
||||
CloneChildren,
|
||||
DoNotCloneChildren
|
||||
}
|
||||
|
@ -1287,8 +1287,8 @@ impl Node {
|
|||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#concept-node-clone
|
||||
fn clone(node: &JS<Node>, maybe_doc: Option<&JS<Document>>, clone_children: CloneChildrenFlag)
|
||||
-> JS<Node> {
|
||||
pub fn clone(node: &JS<Node>, maybe_doc: Option<&JS<Document>>,
|
||||
clone_children: CloneChildrenFlag) -> JS<Node> {
|
||||
fn clone_recursively(node: &JS<Node>, copy: &mut JS<Node>, doc: &JS<Document>) {
|
||||
for ref child in node.get().children() {
|
||||
let mut cloned = Node::clone(child, Some(doc), DoNotCloneChildren);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue