summaryrefslogtreecommitdiff
path: root/dom/base/nsNodeUtils.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-04 19:48:30 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:18 -0500
commitcc533eaee5b800a534b93484598779debcdf5591 (patch)
treef4613faeda690275556065ad825c1c249e155afe /dom/base/nsNodeUtils.cpp
parent59c26110c1124844b5c6820573a8cb4807f1151a (diff)
downloaduxp-cc533eaee5b800a534b93484598779debcdf5591.tar.gz
Bug 1377993 - Make node slots less memory hungry in common cases.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/nsNodeUtils.cpp')
-rw-r--r--dom/base/nsNodeUtils.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/dom/base/nsNodeUtils.cpp b/dom/base/nsNodeUtils.cpp
index 75d408151f..c38f08a3d8 100644
--- a/dom/base/nsNodeUtils.cpp
+++ b/dom/base/nsNodeUtils.cpp
@@ -301,9 +301,12 @@ nsNodeUtils::LastRelease(nsINode* aNode)
Element* elem = aNode->AsElement();
FragmentOrElement::nsDOMSlots* domSlots =
static_cast<FragmentOrElement::nsDOMSlots*>(slots);
- for (auto iter = domSlots->mRegisteredIntersectionObservers.Iter(); !iter.Done(); iter.Next()) {
- DOMIntersectionObserver* observer = iter.Key();
- observer->UnlinkTarget(*elem);
+ if (domSlots->mExtendedSlots) {
+ for (auto iter = domSlots->mExtendedSlots->mRegisteredIntersectionObservers.Iter();
+ !iter.Done(); iter.Next()) {
+ DOMIntersectionObserver* observer = iter.Key();
+ observer->UnlinkTarget(*elem);
+ }
}
}