diff options
author | Moonchild <moonchild@palemoon.org> | 2020-09-16 19:39:33 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-21 11:04:31 +0000 |
commit | 075fa012868017c9cb49f1b92960bf02f4bf27ca (patch) | |
tree | bce03e7900f790b896f889c24a51814a4ade828d /dom/base/nsDocument.cpp | |
parent | 32e0d2ca2369d4ee0658affde0e96bdf0f84455a (diff) | |
download | UXP-075fa012868017c9cb49f1b92960bf02f4bf27ca.tar UXP-075fa012868017c9cb49f1b92960bf02f4bf27ca.tar.gz UXP-075fa012868017c9cb49f1b92960bf02f4bf27ca.tar.lz UXP-075fa012868017c9cb49f1b92960bf02f4bf27ca.tar.xz UXP-075fa012868017c9cb49f1b92960bf02f4bf27ca.zip |
Issue #1643 - Part 4: Hook up all the plumbing.
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r-- | dom/base/nsDocument.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index de793bfab..48d23e325 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) @@ -1832,6 +1836,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) } 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) |