mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Fix the assertion failure with inserting node contains child which has id into the document
https://github.com/mozilla/servo/issues/2630
This commit is contained in:
parent
897e39dcf3
commit
28f8d16c87
2 changed files with 19 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue