mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
added dom obj counting to decide sequential/parallel layout (#10110)
This commit is contained in:
parent
6c3e94805f
commit
479a2c1217
5 changed files with 67 additions and 32 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue