summaryrefslogtreecommitdiffstats
path: root/dom/base/nsDocument.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-23 23:45:46 +0000
committerMoonchild <moonchild@palemoon.org>2020-09-23 23:45:46 +0000
commit9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f (patch)
tree831e0ae1649d6135429def03688bc93ff7c86b03 /dom/base/nsDocument.cpp
parent42f895f27f239e973c9c06241f7a58da7381353c (diff)
parentf624bd1375655dea196cdcb70a9860bc5817df49 (diff)
downloadUXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.gz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.lz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.xz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.zip
Merge branch 'redwood' into releaseRELBASE_20200929RC_20200924
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r--dom/base/nsDocument.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index de793bfab..0b07ef4ec 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1727,6 +1727,10 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
cb.NoteXPCOMChild(mql);
}
}
+
+ if (tmp->mResizeObserverController) {
+ tmp->mResizeObserverController->Traverse(cb);
+ }
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)
@@ -1827,11 +1831,15 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
l != &tmp->mDOMMediaQueryLists; ) {
PRCList *next = PR_NEXT_LINK(l);
MediaQueryList *mql = static_cast<MediaQueryList*>(l);
- mql->RemoveAllListeners();
+ mql->Disconnect();
l = next;
}
tmp->mInUnlinkOrDeletion = false;
+
+ if (tmp->mResizeObserverController) {
+ tmp->mResizeObserverController->Unlink();
+ }
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
nsresult
@@ -12105,6 +12113,24 @@ nsDocument::QuerySelectorAll(const nsAString& aSelector, nsIDOMNodeList **aRetur
return nsINode::QuerySelectorAll(aSelector, aReturn);
}
+void
+nsDocument::AddResizeObserver(ResizeObserver* aResizeObserver)
+{
+ if (!mResizeObserverController) {
+ mResizeObserverController = MakeUnique<ResizeObserverController>(this);
+ }
+
+ mResizeObserverController->AddResizeObserver(aResizeObserver);
+}
+
+void
+nsDocument::ScheduleResizeObserversNotification() const
+{
+ if (mResizeObserverController) {
+ mResizeObserverController->ScheduleNotification();
+ }
+}
+
already_AddRefed<nsIDocument>
nsIDocument::Constructor(const GlobalObject& aGlobal,
ErrorResult& rv)