summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-25 01:44:14 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-04-25 01:44:14 +0200
commitfe8155c118c4d536c048957156a1473a8595ab8d (patch)
treebd7863368d6072ed3ac75126f80a09b11346c3c7 /dom/base/Element.cpp
parentfcfd61829a1edd8519e3965f201f575d70a84239 (diff)
parenta203f449bbc01f97564b7c5e2272b06a9569d7b4 (diff)
downloadUXP-fe8155c118c4d536c048957156a1473a8595ab8d.tar
UXP-fe8155c118c4d536c048957156a1473a8595ab8d.tar.gz
UXP-fe8155c118c4d536c048957156a1473a8595ab8d.tar.lz
UXP-fe8155c118c4d536c048957156a1473a8595ab8d.tar.xz
UXP-fe8155c118c4d536c048957156a1473a8595ab8d.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP
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).