Chromium Code Reviews| 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 b2bc577dee70f3ddae7748c33a02e5a006dee058..a76e9589a4839e18f3a8065f14e80cc45825f154 100644 |
| --- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp |
| @@ -59,21 +59,24 @@ void RemoteFrameView::UpdateRemoteViewportIntersection() { |
| // even if there are RemoteFrame ancestors in the frame tree. |
| LayoutRect rect(0, 0, frame_rect_.Width(), frame_rect_.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; |
|
szager1
2017/05/04 19:26:06
Should this be initialized to last_viewport_inters
kenrb
2017/05/04 19:47:10
I don't think so. It should be zero-initialized, b
|
| + 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; |
| } |
| @@ -112,8 +115,6 @@ void RemoteFrameView::FrameRectsChanged() { |
| if (parent_) |
| new_rect = parent_->ConvertToRootFrame(parent_->ContentsToFrame(new_rect)); |
| remote_frame_->Client()->FrameRectsChanged(new_rect); |
| - |
| - UpdateRemoteViewportIntersection(); |
| } |
| void RemoteFrameView::Hide() { |