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

Unified Diff: third_party/WebKit/Source/core/frame/RemoteFrameView.cpp

Issue 2873083002: Propagate viewport intersection across OOPIFs at the correct time (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteFrameView.h ('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/frame/RemoteFrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
index 5255fd0d9ceaba22fd1c1aa5d0d284ea20fdab4d..6062dc2f74756cfa73ccba114dde7f55a23bbc09 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
@@ -50,21 +50,24 @@ void RemoteFrameView::UpdateRemoteViewportIntersection() {
// even if there are RemoteFrame ancestors in the frame tree.
LayoutRect rect(0, 0, FrameRect().Width(), FrameRect().Height());
rect.Move(remote_frame_->OwnerLayoutObject()->ContentBoxOffset());
- if (!remote_frame_->OwnerLayoutObject()->MapToVisualRectInAncestorSpace(
- nullptr, rect))
- return;
- IntRect root_visible_rect = local_root_view->VisibleContentRect();
- IntRect viewport_intersection(rect);
- viewport_intersection.Intersect(root_visible_rect);
- viewport_intersection.Move(-local_root_view->ScrollOffsetInt());
-
- // Translate the intersection rect from the root frame's coordinate space
- // to the remote frame's coordinate space.
- viewport_intersection = ConvertFromRootFrame(viewport_intersection);
+ IntRect viewport_intersection;
+ if (remote_frame_->OwnerLayoutObject()->MapToVisualRectInAncestorSpace(
+ nullptr, rect)) {
+ IntRect root_visible_rect = local_root_view->VisibleContentRect();
+ IntRect intersected_rect(rect);
+ intersected_rect.Intersect(root_visible_rect);
+ intersected_rect.Move(-local_root_view->ScrollOffsetInt());
+
+ // Translate the intersection rect from the root frame's coordinate space
+ // to the remote frame's coordinate space.
+ viewport_intersection = ConvertFromRootFrame(intersected_rect);
+ }
+
if (viewport_intersection != last_viewport_intersection_) {
remote_frame_->Client()->UpdateRemoteViewportIntersection(
viewport_intersection);
}
+
last_viewport_intersection_ = viewport_intersection;
}
@@ -108,8 +111,6 @@ void RemoteFrameView::FrameRectsChanged() {
new_rect = Parent()->ConvertToRootFrame(
ToFrameView(Parent())->ContentsToFrame(new_rect));
remote_frame_->Client()->FrameRectsChanged(new_rect);
-
- UpdateRemoteViewportIntersection();
}
void RemoteFrameView::Hide() {
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteFrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698