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 6a48968a73f395f11d48dd8613817d147d396a1a..b1142b5d4cec5ce6c2ee2da8e7692db70985d9b4 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -1893,7 +1893,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(); |
PerformResize(); |
+ IntRect new_rect = frame_view->FrameRect(); |
+ frame_view->MarkViewportConstrainedObjectsForLayout( |
+ old_rect.Width() != new_rect.Width(), |
+ old_rect.Height() != new_rect.Height()); |
} |
fullscreen_controller_->UpdateSize(); |
@@ -3154,14 +3160,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( |
@@ -3650,14 +3648,11 @@ void WebViewImpl::DidCommitLoad(bool is_new_navigation, |
} |
void WebViewImpl::PostLayoutResize(WebLocalFrameImpl* webframe) { |
- FrameView* view = webframe->GetFrame()->View(); |
if (webframe == MainFrame()) |
resize_viewport_anchor_->ResizeFrameView(MainFrameSize()); |
- else |
- view->Resize(webframe->GetFrameView()->Size()); |
} |
-void WebViewImpl::LayoutUpdated(WebLocalFrameImpl* webframe) { |
+void WebViewImpl::ResizeAfterLayout(WebLocalFrameImpl* webframe) { |
LocalFrame* frame = webframe->GetFrame(); |
if (!client_ || !client_->CanUpdateLayout() || !frame->IsMainFrame()) |
return; |
@@ -3679,12 +3674,16 @@ void WebViewImpl::LayoutUpdated(WebLocalFrameImpl* webframe) { |
if (GetPageScaleConstraintsSet().ConstraintsDirty()) |
RefreshPageScaleFactorAfterLayout(); |
- FrameView* view = webframe->GetFrame()->View(); |
- |
PostLayoutResize(webframe); |
+} |
+void WebViewImpl::LayoutUpdated(WebLocalFrameImpl* webframe) { |
+ LocalFrame* frame = webframe->GetFrame(); |
+ if (!client_ || !frame->IsLocalRoot()) |
+ return; |
// Relayout immediately to avoid violating the rule that needsLayout() |
// isn't set at the end of a layout. |
+ FrameView* view = webframe->GetFrame()->View(); |
if (view->NeedsLayout()) |
view->UpdateLayout(); |