diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-04 19:48:30 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:18 -0500 |
commit | cc533eaee5b800a534b93484598779debcdf5591 (patch) | |
tree | f4613faeda690275556065ad825c1c249e155afe /dom/base/nsNodeUtils.cpp | |
parent | 59c26110c1124844b5c6820573a8cb4807f1151a (diff) | |
download | uxp-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.cpp | 9 |
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); + } } } |