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

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

Issue 2645283008: IntersectionObserver: Always send an initial notification. (Closed)
Patch Set: 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/IntersectionObservation.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
index 2d55282406f2ccc17586036c1e09d555105236ff..5cf0e3411041a753dcc129354c79ae9949837122 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -63,6 +63,11 @@ void IntersectionObservation::computeIntersectionObservations(
newVisibleRatio = 0;
newThresholdIndex = 0;
}
+
+ // See HACK warning in IntersectionObservation.h
+ newThresholdIndex++;
+ RELEASE_ASSERT(newThresholdIndex < kMaxThresholdIndex);
+
if (m_lastThresholdIndex != newThresholdIndex) {
IntRect snappedRootBounds = geometry.rootIntRect();
IntRect* rootBoundsPointer =

Powered by Google App Engine
This is Rietveld 408576698