Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
index 32bfe0a1f7bd6404309540f6d3822ce589191ca1..f2fae5f22f242ec082dd7087f743a8b3a2692e3b 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -1897,7 +1897,13 @@ void WebViewImpl::ResizeViewWhileAnchored(float browser_controls_height, |
// Avoids unnecessary invalidations while various bits of state in |
// TextAutosizer are updated. |
TextAutosizer::DeferUpdatePageInfo defer_update_page_info(GetPage()); |
+ FrameView* frame_view = MainFrameImpl()->GetFrameView(); |
+ IntRect old_rect = frame_view->FrameRect(); |
UpdateICBAndResizeViewport(); |
+ IntRect new_rect = frame_view->FrameRect(); |
+ frame_view->MarkViewportConstrainedObjectsForLayout( |
+ old_rect.Width() != new_rect.Width(), |
+ old_rect.Height() != new_rect.Height()); |
} |
fullscreen_controller_->UpdateSize(); |
@@ -3153,14 +3159,6 @@ void WebViewImpl::RefreshPageScaleFactorAfterLayout() { |
SetPageScaleFactor(new_page_scale_factor); |
UpdateLayerTreeViewport(); |
- |
- // Changes to page-scale during layout may require an additional frame. |
- // We can't update the lifecycle here because we may be in the middle of |
- // layout in the caller of this method. |
- // TODO(chrishtr): clean all this up. All layout should happen in one |
- // lifecycle run (crbug.com/578239). |
- if (MainFrameImpl()->GetFrameView()->NeedsLayout()) |
- MainFrameImpl()->FrameWidget()->ScheduleAnimation(); |
} |
void WebViewImpl::UpdatePageDefinedViewportConstraints( |
@@ -3649,11 +3647,8 @@ void WebViewImpl::DidCommitLoad(bool is_new_navigation, |
} |
void WebViewImpl::ResizeFrameView(WebLocalFrameImpl* webframe) { |
bokan
2017/05/10 21:30:07
It seems UpdateICBAndResizeViewport is the only ca
szager1
2017/05/11 12:50:54
It's also called from ResizeAfterLayout
bokan
2017/05/11 16:51:08
Ah, right, failed at codesearch...
Regardless, we
szager1
2017/05/11 20:12:00
Done.
|
- FrameView* view = webframe->GetFrame()->View(); |
if (webframe == MainFrame()) |
resize_viewport_anchor_->ResizeFrameView(MainFrameSize()); |
- else |
- view->Resize(webframe->GetFrameView()->Size()); |
} |
void WebViewImpl::ResizeAfterLayout(WebLocalFrameImpl* webframe) { |
@@ -3683,11 +3678,8 @@ void WebViewImpl::ResizeAfterLayout(WebLocalFrameImpl* webframe) { |
void WebViewImpl::LayoutUpdated(WebLocalFrameImpl* webframe) { |
LocalFrame* frame = webframe->GetFrame(); |
- if (!client_ || !client_->CanUpdateLayout() || !frame->IsMainFrame()) |
+ if (!client_ || !frame->IsLocalRoot()) |
bokan
2017/05/10 21:30:07
Can you remind me and point me to the place we had
szager1
2017/05/11 12:50:55
I think it was over IM, I don't have any record of
bokan
2017/05/11 16:51:08
Yah, I don't remember the context of that conversa
|
return; |
- |
- ResizeAfterLayout(webframe); |
- |
// Relayout immediately to avoid violating the rule that needsLayout() |
// isn't set at the end of a layout. |
FrameView* view = frame->View(); |