diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-07 14:32:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-07 14:32:20 -0800 |
commit | 0fe94a6724a42da8f02a60d1efe18fdfc96885ae (patch) | |
tree | c839a22953dbaca9fa0cbb02bb1ceb6563086457 /components/script/dom/element.rs | |
parent | 8dfaed218377dbac6935b54f1599d7a9245d6122 (diff) | |
parent | f8121ae60d691397d4173af2ac39fcf736bc84dd (diff) | |
download | servo-0fe94a6724a42da8f02a60d1efe18fdfc96885ae.tar.gz servo-0fe94a6724a42da8f02a60d1efe18fdfc96885ae.zip |
Auto merge of #12862 - servo:layout-new, r=emilio
added dom obj counting to decide sequential/parallel layout (#10110)
This is a rebased version of #11713
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #10110 (github issue number if applicable).
- [X] There are no tests for these changes because it's an optimization with no visible behavioral changes
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12862)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 8 |
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) { |