summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-24 21:39:13 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-24 21:39:13 +0200
commiteae8d21428acdb3fb842df091ded0eb276bcaaaa (patch)
tree8fcdb943e19ec1ca33bec3b39636311dcddd38f0 /dom/base/Element.cpp
parentd0e748cadabba2b7cbf7407c4bca665315bf00fe (diff)
downloadUXP-eae8d21428acdb3fb842df091ded0eb276bcaaaa.tar
UXP-eae8d21428acdb3fb842df091ded0eb276bcaaaa.tar.gz
UXP-eae8d21428acdb3fb842df091ded0eb276bcaaaa.tar.lz
UXP-eae8d21428acdb3fb842df091ded0eb276bcaaaa.tar.xz
UXP-eae8d21428acdb3fb842df091ded0eb276bcaaaa.zip
moebius#138: Optimize operations on root of deeply-nested frame tree
https://github.com/MoonchildProductions/moebius/pull/138
Diffstat (limited to 'dom/base/Element.cpp')
-rw-r--r--dom/base/Element.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 8b9808aa3..092755590 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1844,6 +1844,24 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
SetParentIsContent(false);
}
+#ifdef DEBUG
+ // If we can get access to the PresContext, then we sanity-check that
+ // we're not leaving behind a pointer to ourselves as the PresContext's
+ // cached provider of the viewport's scrollbar styles.
+ if (document) {
+ nsIPresShell* presShell = document->GetShell();
+ if (presShell) {
+ nsPresContext* presContext = presShell->GetPresContext();
+ if (presContext) {
+ MOZ_ASSERT(this !=
+ presContext->GetViewportScrollbarStylesOverrideNode(),
+ "Leaving behind a raw pointer to this node (as having "
+ "propagated scrollbar styles) - that's dangerous...");
+ }
+ }
+ }
+#endif
+
// Ensure that CSS transitions don't continue on an element at a
// different place in the tree (even if reinserted before next
// animation refresh).