diff options
author | chrishtr <chrishtr@chromium.org> | 2016-01-20 18:30:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-21 02:31:26 +0000 |
commit | 3d35ba88209b8b99c43505abdc796330fd04a6bf (patch) | |
tree | 7bba720bd3d8f11cd84732f439cecefacb6c5394 /third_party/WebKit/Source/web/WebViewImpl.cpp | |
parent | 86e1eb8755f80ec1d1e20757d3e7bfa6b1f999c1 (diff) | |
download | chromium_src-3d35ba88209b8b99c43505abdc796330fd04a6bf.zip chromium_src-3d35ba88209b8b99c43505abdc796330fd04a6bf.tar.gz chromium_src-3d35ba88209b8b99c43505abdc796330fd04a6bf.tar.bz2 |
Don't schedule additional frames inside WebViewImpl::resize().
Previously, we would schedule additional frames in some cases. This should no
longer be necessary now that we are always synchronously updating all lifecycle
phases after changing layout size of the main frame
(https://codereview.chromium.org/1585793002).
BUG=545039
TBR=tommycli
Review URL: https://codereview.chromium.org/1590433007
Cr-Commit-Position: refs/heads/master@{#370584}
Diffstat (limited to 'third_party/WebKit/Source/web/WebViewImpl.cpp')
-rw-r--r-- | third_party/WebKit/Source/web/WebViewImpl.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 1742482..016169a 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp @@ -3338,6 +3338,13 @@ void WebViewImpl::refreshPageScaleFactorAfterLayout() setPageScaleFactor(newPageScaleFactor); 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()->frameView()->needsLayout()) + scheduleAnimation(); } void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription& description) @@ -3401,12 +3408,13 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription mainFrameImpl()->frameView()->setNeedsLayout(); } - updateMainFrameLayoutSize(); if (LocalFrame* frame = page()->deprecatedLocalMainFrame()) { if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) textAutosizer->updatePageInfoInAllFrames(); } + + updateMainFrameLayoutSize(); } void WebViewImpl::updateMainFrameLayoutSize() @@ -3427,12 +3435,6 @@ void WebViewImpl::updateMainFrameLayoutSize() layoutSize.height = 0; view->setLayoutSize(layoutSize); - - // Resizing marks the frame as needsLayout. Inform clients so that they - // will perform the layout. Widgets held by WebPluginContainerImpl do not otherwise - // see this resize layout invalidation. - if (client()) - client()->didUpdateLayoutSize(layoutSize); } IntSize WebViewImpl::contentsSize() const @@ -3467,7 +3469,6 @@ void WebViewImpl::disableViewport() { settings()->setViewportEnabled(false); pageScaleConstraintsSet().clearPageDefinedConstraints(); - updateMainFrameLayoutSize(); } float WebViewImpl::defaultMinimumPageScaleFactor() const |