added dom obj counting to decide sequential/parallel layout (#10110)

This commit is contained in:
ddh 2016-06-09 00:34:31 +01:00 committed by Michael Howell
parent 6c3e94805f
commit 479a2c1217
5 changed files with 67 additions and 32 deletions

View file

@ -2151,10 +2151,12 @@ impl VirtualMethods for Element {
return;
}
let doc = document_from_node(self);
if let Some(ref value) = *self.id_attribute.borrow() {
let doc = document_from_node(self);
doc.register_named_element(self, value.clone());
}
// This is used for layout optimization.
doc.increment_dom_count();
}
fn unbind_from_tree(&self, context: &UnbindContext) {
@ -2164,10 +2166,12 @@ impl VirtualMethods for Element {
return;
}
let doc = document_from_node(self);
if let Some(ref value) = *self.id_attribute.borrow() {
let doc = document_from_node(self);
doc.unregister_named_element(self, value.clone());
}
// This is used for layout optimization.
doc.decrement_dom_count();
}
fn children_changed(&self, mutation: &ChildrenMutation) {