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

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

Issue 2272773002: Use intersection observer to control frame throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Turns out we need the check after all Created 4 years, 2 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 7509dcf7051d0c111c615918360c489eed7e098e..260f68bfba19a1ad02566475ce31d43ef27a4aa7 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -345,6 +345,12 @@ void IntersectionObserver::removeObservation(
m_observations.remove(&observation);
}
+void IntersectionObserver::setInitialState(InitialState initialState) {
ojan 2016/10/31 19:37:09 This will happen to work for ElementVisibilityObse
Sami 2016/11/01 10:44:48 Thanks, I think this will help to avoid some surpr
+ DCHECK_EQ(initialState, InitialState::AUTO);
+ for (auto& observation : observations())
+ observation->setLastThresholdIndex(std::numeric_limits<unsigned>::max());
+}
+
HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords(
ExceptionState& exceptionState) {
HeapVector<Member<IntersectionObserverEntry>> entries;

Powered by Google App Engine
This is Rietveld 408576698