summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-04-25 01:01:08 +0200
committerGitHub <noreply@github.com>2018-04-25 01:01:08 +0200
commita203f449bbc01f97564b7c5e2272b06a9569d7b4 (patch)
tree7193ae9ea7a77fcbd2c73ce0a9622b9fa836a013 /dom/base/Element.cpp
parentacd4eee44eb04fe01b0063818b492390f463ccec (diff)
parenteae8d21428acdb3fb842df091ded0eb276bcaaaa (diff)
downloadUXP-a203f449bbc01f97564b7c5e2272b06a9569d7b4.tar
UXP-a203f449bbc01f97564b7c5e2272b06a9569d7b4.tar.gz
UXP-a203f449bbc01f97564b7c5e2272b06a9569d7b4.tar.lz
UXP-a203f449bbc01f97564b7c5e2272b06a9569d7b4.tar.xz
UXP-a203f449bbc01f97564b7c5e2272b06a9569d7b4.zip
Merge pull request #262 from janekptacijarabaci/js_dom_overflow_1
moebius#138: Optimize operations on root of deeply-nested frame tree
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).