diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-06-11 03:03:07 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-06-13 20:36:27 +0900 |
commit | 28f8d16c87f7da49a3743585f3fb389027be04be (patch) | |
tree | 93429d0f58e2e3910cd279779ea2b279c073c204 /src/components/script/dom/node.rs | |
parent | 897e39dcf35ff27bc41ccb7990c5d82bb2adf15c (diff) | |
download | servo-28f8d16c87f7da49a3743585f3fb389027be04be.tar.gz servo-28f8d16c87f7da49a3743585f3fb389027be04be.zip |
Fix the assertion failure with inserting node contains child which has id into the document
https://github.com/mozilla/servo/issues/2630
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r-- | src/components/script/dom/node.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 7b095bc9c57..2e3e02d381b 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -1137,10 +1137,13 @@ impl Node { // Step 8. for node in nodes.mut_iter() { parent.add_child(node, child); - if parent.is_in_doc() { - node.flags.deref().borrow_mut().insert(IsInDoc); - } else { - node.flags.deref().borrow_mut().remove(IsInDoc); + let is_in_doc = parent.is_in_doc(); + for mut kid in node.traverse_preorder() { + if is_in_doc { + kid.flags.deref().borrow_mut().insert(IsInDoc); + } else { + kid.flags.deref().borrow_mut().remove(IsInDoc); + } } } |