aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
authorddh <dianehosfelt@gmail.com>2016-06-09 00:34:31 +0100
committerMichael Howell <michael@notriddle.com>2016-12-05 17:42:17 +0000
commit479a2c12177bd7b031705b5ca66ab8b246059cd9 (patch)
tree22e48066897dbb7065c2805aa79398374c2b8277 /components/script/dom/element.rs
parent6c3e94805f74e78b091b37fe374af12ad2249528 (diff)
downloadservo-479a2c12177bd7b031705b5ca66ab8b246059cd9.tar.gz
servo-479a2c12177bd7b031705b5ca66ab8b246059cd9.zip
added dom obj counting to decide sequential/parallel layout (#10110)
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index c384001e33a..6df2122e7b3 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -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) {