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

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

Issue 2556243003: IntersectionObserver: compute correct intersection ratio for 0x0 elements (Closed)
Patch Set: Script sorting Created 4 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ae1556fc10ddca7a031867902c3f74dde19c9c3..40edeb5ac586fcb50fdb3dd10c16b5757d3d0508 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -53,6 +53,7 @@ void IntersectionObservation::computeIntersectionObservations(
float newVisibleRatio = 0;
if (geometry.targetRect().isEmpty()) {
newThresholdIndex = geometry.doesIntersect() ? 1 : 0;
+ newVisibleRatio = geometry.doesIntersect() ? 1 : 0;
szager1 2016/12/09 17:30:07 You also need to delete the preceding line, and in
Sami 2016/12/09 17:51:16 Good catch. Rewrote this as we discussed offline.
} else if (!geometry.doesIntersect()) {
newThresholdIndex = 0;
} else {
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698