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

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

Issue 1988633002: Schedule a frame from IntersectionObserver::observe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Oilpan doesn't like stack-allocated callback Created 4 years, 7 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 3aa1f7a61faeb1db5ac1fca3d07815e4beede129..47d0bc30dae330814b1d7176eac6d78dc28c8078 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -15,6 +15,7 @@
#include "core/dom/IntersectionObserverEntry.h"
#include "core/dom/IntersectionObserverInit.h"
#include "core/dom/NodeIntersectionObserverData.h"
+#include "core/frame/FrameView.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutView.h"
#include "core/timing/DOMWindowPerformance.h"
@@ -183,6 +184,10 @@ void IntersectionObserver::observe(Element* target)
IntersectionObservation* observation = new IntersectionObservation(*this, *target, shouldReportRootBounds);
target->ensureIntersectionObserverData().addObservation(*observation);
m_observations.add(observation);
+ if (!rootFrame)
+ return;
+ if (FrameView* rootFrameView = rootFrame->view())
+ rootFrameView->scheduleAnimation();
}
void IntersectionObserver::unobserve(Element* target)

Powered by Google App Engine
This is Rietveld 408576698