diff options
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r-- | dom/base/nsDocument.cpp | 28 |
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) |