summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc b/chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc
index 586abe8f69a..eef6e1da665 100644
--- a/chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc
+++ b/chromium/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc
@@ -480,11 +480,16 @@ bool IntersectionGeometry::ClipToRoot(const LayoutObject* root,
// done yet.
LocalFrame* local_root_frame = root->GetDocument().GetFrame();
IntRect clip_rect(local_root_frame->RemoteViewportIntersection());
- // Map clip_rect from the coordinate system of the local root frame to
- // the coordinate system of the remote main frame.
- clip_rect.MoveBy(IntPoint(local_root_frame->RemoteViewportOffset()));
- does_intersect &=
- intersection_rect.InclusiveIntersect(PhysicalRect(clip_rect));
+ if (clip_rect.IsEmpty()) {
+ intersection_rect = PhysicalRect();
+ does_intersect = false;
+ } else {
+ // Map clip_rect from the coordinate system of the local root frame to
+ // the coordinate system of the remote main frame.
+ clip_rect.MoveBy(IntPoint(local_root_frame->RemoteViewportOffset()));
+ does_intersect &=
+ intersection_rect.InclusiveIntersect(PhysicalRect(clip_rect));
+ }
}
}