summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-12-22 02:15:50 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-12-22 02:15:50 +0100
commitc9d920e9c630fd8b99b863e034742fd3b38e12d3 (patch)
treea2f3f8a11aa10bca612c9648b9219abc89d73e5a /dom/base/Element.cpp
parentba81aaf073bbf9b2e832324d1710faa4c61799ba (diff)
downloadUXP-c9d920e9c630fd8b99b863e034742fd3b38e12d3.tar
UXP-c9d920e9c630fd8b99b863e034742fd3b38e12d3.tar.gz
UXP-c9d920e9c630fd8b99b863e034742fd3b38e12d3.tar.lz
UXP-c9d920e9c630fd8b99b863e034742fd3b38e12d3.tar.xz
UXP-c9d920e9c630fd8b99b863e034742fd3b38e12d3.zip
Revise lifetime management of IntersectionObservers.
Tag #249
Diffstat (limited to 'dom/base/Element.cpp')
-rw-r--r--dom/base/Element.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 3760dc43f..67759fdb2 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -3947,7 +3947,7 @@ Element::ClearDataset()
slots->mDataset = nullptr;
}
-nsDataHashtable<nsPtrHashKey<DOMIntersectionObserver>, int32_t>*
+nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>, int32_t>*
Element::RegisteredIntersectionObservers()
{
nsDOMSlots* slots = DOMSlots();
@@ -3962,7 +3962,7 @@ enum nsPreviousIntersectionThreshold {
void
Element::RegisterIntersectionObserver(DOMIntersectionObserver* aObserver)
{
- nsDataHashtable<nsPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
+ nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
RegisteredIntersectionObservers();
if (observers->Contains(aObserver)) {
return;
@@ -3979,7 +3979,7 @@ Element::RegisterIntersectionObserver(DOMIntersectionObserver* aObserver)
void
Element::UnregisterIntersectionObserver(DOMIntersectionObserver* aObserver)
{
- nsDataHashtable<nsPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
+ nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
RegisteredIntersectionObservers();
observers->Remove(aObserver);
}
@@ -3987,7 +3987,7 @@ Element::UnregisterIntersectionObserver(DOMIntersectionObserver* aObserver)
bool
Element::UpdateIntersectionObservation(DOMIntersectionObserver* aObserver, int32_t aThreshold)
{
- nsDataHashtable<nsPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
+ nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>, int32_t>* observers =
RegisteredIntersectionObservers();
if (!observers->Contains(aObserver)) {
return false;