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 a32edd7be70bcdf562207bb7a3100af44988a3d6..8c184459ef05d91311b8174b0ca6055cf101e492 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
@@ -116,8 +116,6 @@ bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry) |
if (geometry.intersectionRect.size().isZero()) |
geometry.intersectionRect = LayoutRect(); |
- if (!m_shouldReportRootBounds) |
- geometry.rootRect = LayoutRect(); |
return true; |
} |
@@ -147,11 +145,13 @@ void IntersectionObservation::computeIntersectionObservations(double timestamp) |
return; |
float newVisibleRatio = intersectionArea / targetArea; |
unsigned newThresholdIndex = observer().firstThresholdGreaterThan(newVisibleRatio); |
+ IntRect snappedRootBounds = pixelSnappedIntRect(geometry.rootRect); |
+ IntRect* rootBoundsPointer = m_shouldReportRootBounds ? &snappedRootBounds : nullptr; |
if (m_lastThresholdIndex != newThresholdIndex) { |
IntersectionObserverEntry* newEntry = new IntersectionObserverEntry( |
timestamp / 1000.0, |
pixelSnappedIntRect(geometry.targetRect), |
- pixelSnappedIntRect(geometry.rootRect), |
+ rootBoundsPointer, |
pixelSnappedIntRect(geometry.intersectionRect), |
targetElement); |
observer().enqueueIntersectionObserverEntry(*newEntry); |