Skip to content

Commit

Permalink
script: Fix busted document fragment appending code
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Oct 31, 2014
1 parent a94e13f commit b245a24
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/script/dom/node.rs
Expand Up @@ -1381,18 +1381,20 @@ impl Node {
// Step 4.
// Step 5: DocumentFragment, mutation records.
// Step 6: DocumentFragment.
for c in node.children() {
Node::remove(c, node, Suppressed);
let mut kids = Vec::new();
for kid in node.children() {
kids.push(kid.clone());
Node::remove(kid, node, Suppressed);
}

// Step 7: mutation records.
// Step 8.
for node in node.children() {
do_insert(node, parent, child);
for kid in kids.iter() {
do_insert((*kid).clone(), parent, child);
}

for node in node.children() {
fire_observer_if_necessary(node, suppress_observers);
for kid in kids.into_iter() {
fire_observer_if_necessary(kid, suppress_observers);
}
}
_ => {
Expand Down

5 comments on commit b245a24

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at pcwalton@b245a24

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pcwalton/servo/script-microoptzns = b245a24 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pcwalton/servo/script-microoptzns = b245a24 merged ok, testing candidate = 69f8b46

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 69f8b46

Please sign in to comment.