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

Unified Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 1820043002: Update nested OOPIF's screen rects when parent is repositioned in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko comments addressed Created 4 years, 9 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 | « no previous file | content/browser/frame_host/frame_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/cross_process_frame_connector.cc
diff --git a/content/browser/frame_host/cross_process_frame_connector.cc b/content/browser/frame_host/cross_process_frame_connector.cc
index 649f4a2b8c61856c9dd165fa843fcd04e8e8c2c0..c5ac363d62764c4d79ad17db75e51cf4bebfdfe0 100644
--- a/content/browser/frame_host/cross_process_frame_connector.cc
+++ b/content/browser/frame_host/cross_process_frame_connector.cc
@@ -247,9 +247,26 @@ void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) {
}
void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) {
+ gfx::Rect old_rect = child_frame_rect_;
child_frame_rect_ = frame_rect;
- if (view_)
+ if (view_) {
view_->SetBounds(frame_rect);
+
+ // Out-of-process iframes nested underneath this one implicitly have their
+ // view rects changed when their ancestor is repositioned, and therefore
+ // need to have their screen rects updated.
+ FrameTreeNode* proxy_node =
+ frame_proxy_in_parent_renderer_->frame_tree_node();
+ if (old_rect.x() != child_frame_rect_.x() ||
+ old_rect.y() != child_frame_rect_.y()) {
+ for (FrameTreeNode* node :
+ proxy_node->frame_tree()->SubtreeNodes(proxy_node)) {
+ if (node != proxy_node &&
+ node->current_frame_host()->GetRenderWidgetHost())
+ node->current_frame_host()->GetRenderWidgetHost()->SendScreenRects();
+ }
+ }
+ }
}
RenderWidgetHostViewBase*
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698