Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp

Issue 1613543002: Use DOMHighResTimeStamp for notification time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: syntax error in test Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
index efe97c99ee3066dda6863f074657f1b085ef15d1..db45b73b3fb1a96be81f14d806336ea217c1001b 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -16,6 +16,8 @@
#include "core/dom/NodeIntersectionObserverData.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutView.h"
+#include "core/timing/DOMWindowPerformance.h"
+#include "core/timing/Performance.h"
#include "platform/Timer.h"
#include "wtf/MainThread.h"
#include <algorithm>
@@ -237,10 +239,17 @@ void IntersectionObserver::unobserve(Element* target, ExceptionState&)
observation->disconnect();
}
-void IntersectionObserver::computeIntersectionObservations(double timestamp)
+void IntersectionObserver::computeIntersectionObservations()
{
if (!m_root)
return;
+ Document* callbackDocument = toDocument(m_callback->executionContext());
+ if (!callbackDocument)
+ return;
+ LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow();
+ if (!callbackDOMWindow)
+ return;
+ DOMHighResTimeStamp timestamp = DOMWindowPerformance::performance(*callbackDOMWindow)->now();
for (auto& observation : m_observations)
observation->computeIntersectionObservations(timestamp);
}

Powered by Google App Engine
This is Rietveld 408576698