OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/frame/RemoteFrameView.h" | 5 #include "core/frame/RemoteFrameView.h" |
6 | 6 |
7 #include "core/dom/IntersectionObserverEntry.h" | 7 #include "core/dom/IntersectionObserverEntry.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/frame/RemoteFrame.h" | 10 #include "core/frame/RemoteFrame.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 RemoteFrameView* view = new RemoteFrameView(remote_frame); | 40 RemoteFrameView* view = new RemoteFrameView(remote_frame); |
41 view->Show(); | 41 view->Show(); |
42 return view; | 42 return view; |
43 } | 43 } |
44 | 44 |
45 void RemoteFrameView::UpdateRemoteViewportIntersection() { | 45 void RemoteFrameView::UpdateRemoteViewportIntersection() { |
46 if (!remote_frame_->OwnerLayoutObject()) | 46 if (!remote_frame_->OwnerLayoutObject()) |
47 return; | 47 return; |
48 | 48 |
49 FrameView* local_root_view = | 49 FrameView* local_root_view = |
50 ToLocalFrame(remote_frame_->Tree().Parent())->LocalFrameRoot()->View(); | 50 ToLocalFrame(remote_frame_->Tree().Parent())->LocalFrameRoot().View(); |
51 if (!local_root_view) | 51 if (!local_root_view) |
52 return; | 52 return; |
53 | 53 |
54 // Start with rect in remote frame's coordinate space. Then | 54 // Start with rect in remote frame's coordinate space. Then |
55 // mapToVisualRectInAncestorSpace will move it to the local root's coordinate | 55 // mapToVisualRectInAncestorSpace will move it to the local root's coordinate |
56 // space and account for any clip from containing elements such as a | 56 // space and account for any clip from containing elements such as a |
57 // scrollable div. Passing nullptr as an argument to | 57 // scrollable div. Passing nullptr as an argument to |
58 // mapToVisualRectInAncestorSpace causes it to be clipped to the viewport, | 58 // mapToVisualRectInAncestorSpace causes it to be clipped to the viewport, |
59 // even if there are RemoteFrame ancestors in the frame tree. | 59 // even if there are RemoteFrame ancestors in the frame tree. |
60 LayoutRect rect(0, 0, frame_rect_.Width(), frame_rect_.Height()); | 60 LayoutRect rect(0, 0, frame_rect_.Width(), frame_rect_.Height()); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 return parent_rect; | 149 return parent_rect; |
150 } | 150 } |
151 | 151 |
152 DEFINE_TRACE(RemoteFrameView) { | 152 DEFINE_TRACE(RemoteFrameView) { |
153 visitor->Trace(remote_frame_); | 153 visitor->Trace(remote_frame_); |
154 visitor->Trace(parent_); | 154 visitor->Trace(parent_); |
155 } | 155 } |
156 | 156 |
157 } // namespace blink | 157 } // namespace blink |
OLD | NEW |