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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2860433002: Update WebView/FrameView size from LayoutView::UpdateAfterLayout (Closed)
Patch Set: s/IsLocalRoot/IsMainFrame/ Created 3 years, 7 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 | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a256b4dd04c7a5056dd0a8dc22dcc572ab2e6f3 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1821,7 +1821,7 @@ void WebViewImpl::UpdateICBAndResizeViewport() {
if (MainFrameImpl()->GetFrameView()) {
MainFrameImpl()->GetFrameView()->SetInitialViewportSize(icb_size);
if (!MainFrameImpl()->GetFrameView()->NeedsLayout())
- ResizeFrameView(MainFrameImpl());
+ resize_viewport_anchor_->ResizeFrameView(MainFrameSize());
}
}
@@ -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(
@@ -3648,14 +3646,6 @@ void WebViewImpl::DidCommitLoad(bool is_new_navigation,
EndActiveFlingAnimation();
}
-void WebViewImpl::ResizeFrameView(WebLocalFrameImpl* webframe) {
- FrameView* view = webframe->GetFrame()->View();
- if (webframe == MainFrame())
- resize_viewport_anchor_->ResizeFrameView(MainFrameSize());
- else
- view->Resize(webframe->GetFrameView()->Size());
-}
-
void WebViewImpl::ResizeAfterLayout(WebLocalFrameImpl* webframe) {
LocalFrame* frame = webframe->GetFrame();
if (!client_ || !client_->CanUpdateLayout() || !frame->IsMainFrame())
@@ -3678,22 +3668,14 @@ void WebViewImpl::ResizeAfterLayout(WebLocalFrameImpl* webframe) {
if (GetPageScaleConstraintsSet().ConstraintsDirty())
RefreshPageScaleFactorAfterLayout();
- ResizeFrameView(webframe);
+ resize_viewport_anchor_->ResizeFrameView(MainFrameSize());
}
void WebViewImpl::LayoutUpdated(WebLocalFrameImpl* webframe) {
LocalFrame* frame = webframe->GetFrame();
- if (!client_ || !client_->CanUpdateLayout() || !frame->IsMainFrame())
+ if (!client_ || !frame->IsMainFrame())
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();
- if (view->NeedsLayout())
- view->UpdateLayout();
-
UpdatePageOverlays();
fullscreen_controller_->DidUpdateLayout();
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698