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

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

Issue 2645283008: IntersectionObserver: Always send an initial notification. (Closed)
Patch Set: Fix unit test Created 3 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 408fc2c21c8c4fa315a352cb12f394a5fbf0b496..779e0a33ee2e35c852bc3c5e199561fbdf7750b4 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -173,8 +173,7 @@ IntersectionObserver::IntersectionObserver(
m_rightMargin(Fixed),
m_bottomMargin(Fixed),
m_leftMargin(Fixed),
- m_rootIsImplicit(root ? 0 : 1),
- m_initialState(InitialState::kHidden) {
+ m_rootIsImplicit(root ? 0 : 1) {
switch (rootMargin.size()) {
case 0:
break;
@@ -272,11 +271,6 @@ void IntersectionObserver::observe(Element* target,
"element is not a descendant of root."));
}
- if (m_initialState == InitialState::kAuto) {
- for (auto& observation : m_observations)
- observation->setLastThresholdIndex(std::numeric_limits<unsigned>::max());
- }
-
if (FrameView* frameView = targetFrame->view())
frameView->scheduleAnimation();
}
@@ -314,11 +308,6 @@ void IntersectionObserver::disconnect(ExceptionState& exceptionState) {
m_observations.clear();
}
-void IntersectionObserver::setInitialState(InitialState initialState) {
- DCHECK(m_observations.isEmpty());
- m_initialState = initialState;
-}
-
HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords(
ExceptionState& exceptionState) {
HeapVector<Member<IntersectionObserverEntry>> entries;

Powered by Google App Engine
This is Rietveld 408576698