| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index 56afe214d957c65ababa6f2a5a42eb885f51b9e1..719af5351d078d986d121dc60718012aac181043 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -75,6 +75,7 @@
|
| #include "core/dom/ExceptionCode.h"
|
| #include "core/dom/ExecutionContextTask.h"
|
| #include "core/dom/FrameRequestCallback.h"
|
| +#include "core/dom/IntersectionObserverController.h"
|
| #include "core/dom/LayoutTreeBuilderTraversal.h"
|
| #include "core/dom/MainThreadTaskRunner.h"
|
| #include "core/dom/Microtask.h"
|
| @@ -608,6 +609,11 @@ void Document::dispose()
|
| if (svgExtensions())
|
| accessSVGExtensions().pauseAnimations();
|
|
|
| + if (m_intersectionObserverController) {
|
| + m_intersectionObserverController->dispose();
|
| + m_intersectionObserverController.clear();
|
| + }
|
| +
|
| m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
|
| DocumentLifecycleNotifier::notifyDocumentWasDisposed();
|
|
|
| @@ -4582,11 +4588,7 @@ WeakPtrWillBeRawPtr<Document> Document::contextDocument()
|
| if (m_contextDocument)
|
| return m_contextDocument;
|
| if (m_frame) {
|
| -#if ENABLE(OILPAN)
|
| - return this;
|
| -#else
|
| - return m_weakFactory.createWeakPtr();
|
| -#endif
|
| + return createWeakPtr();
|
| }
|
| return nullptr;
|
| }
|
| @@ -5062,6 +5064,22 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl)
|
| m_haveExplicitlyDisabledDNSPrefetch = true;
|
| }
|
|
|
| +WeakPtrWillBeRawPtr<Document> Document::createWeakPtr()
|
| +{
|
| +#if ENABLE(OILPAN)
|
| + return this;
|
| +#else
|
| + return m_weakFactory.createWeakPtr();
|
| +#endif
|
| +}
|
| +
|
| +IntersectionObserverController& Document::ensureIntersectionObserverController()
|
| +{
|
| + if (!m_intersectionObserverController)
|
| + m_intersectionObserverController = new IntersectionObserverController();
|
| + return *m_intersectionObserverController;
|
| +}
|
| +
|
| void Document::reportBlockedScriptExecutionToInspector(const String& directiveText)
|
| {
|
| InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText);
|
| @@ -5119,6 +5137,8 @@ void Document::tasksWereResumed()
|
| m_scriptedAnimationController->resume();
|
|
|
| MutationObserver::resumeSuspendedObservers();
|
| + if (m_intersectionObserverController)
|
| + m_intersectionObserverController->resumeSuspendedIntersectionObservers();
|
| if (m_domWindow)
|
| DOMWindowPerformance::performance(*m_domWindow)->resumeSuspendedObservers();
|
| }
|
| @@ -5865,6 +5885,7 @@ DEFINE_TRACE(Document)
|
| visitor->trace(m_compositorPendingAnimations);
|
| visitor->trace(m_contextDocument);
|
| visitor->trace(m_canvasFontCache);
|
| + visitor->trace(m_intersectionObserverController);
|
| WillBeHeapSupplementable<Document>::trace(visitor);
|
| #endif
|
| TreeScope::trace(visitor);
|
|
|