mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Reorder changes in add_child to be correct.
This commit is contained in:
parent
fc76107a92
commit
0157ff3ca3
1 changed files with 2 additions and 2 deletions
|
@ -558,8 +558,6 @@ impl AbstractNode {
|
||||||
let before_node = before.mut_node();
|
let before_node = before.mut_node();
|
||||||
// XXX Should assert that parent is self.
|
// XXX Should assert that parent is self.
|
||||||
assert!(before_node.parent_node.is_some());
|
assert!(before_node.parent_node.is_some());
|
||||||
before_node.set_prev_sibling(Some(new_child.clone()));
|
|
||||||
new_child_node.set_next_sibling(Some(before.clone()));
|
|
||||||
match before_node.prev_sibling {
|
match before_node.prev_sibling {
|
||||||
None => {
|
None => {
|
||||||
// XXX Should assert that before is the first child of
|
// XXX Should assert that before is the first child of
|
||||||
|
@ -572,6 +570,8 @@ impl AbstractNode {
|
||||||
new_child_node.set_prev_sibling(Some(prev_sibling.clone()));
|
new_child_node.set_prev_sibling(Some(prev_sibling.clone()));
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
before_node.set_prev_sibling(Some(new_child.clone()));
|
||||||
|
new_child_node.set_next_sibling(Some(before.clone()));
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
match this_node.last_child {
|
match this_node.last_child {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue