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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 705423002: Use expected main frame size from WebViewImpl when creating a new FrameView. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing build break from bad rebase Created 6 years, 1 month 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 | « Source/web/WebViewImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 46b04e047392f71c8e84ee1d9668fa0682a82903..f7041a87186bb522c316bf7d9ae04c7ce60f63ec 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3210,6 +3210,24 @@ void WebViewImpl::setIgnoreViewportTagScaleLimits(bool ignore)
setUserAgentPageScaleConstraints(constraints);
}
+IntSize WebViewImpl::mainFrameSize()
+{
+ if (!pinchVirtualViewportEnabled() || !localFrameRootTemporary())
+ return m_size;
+
+ FrameView* view = localFrameRootTemporary()->frameView();
+
+ if (!view)
+ return m_size;
+
+ int contentAndScrollbarWidth = contentsSize().width();
+
+ if (view && view->verticalScrollbar() && !view->verticalScrollbar()->isOverlayScrollbar())
+ contentAndScrollbarWidth += view->verticalScrollbar()->width();
+
+ return m_pageScaleConstraintsSet.mainFrameSize(contentAndScrollbarWidth);
+}
+
void WebViewImpl::refreshPageScaleFactorAfterLayout()
{
if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()->isLocalFrame() || !page()->deprecatedLocalMainFrame()->view())
@@ -3226,13 +3244,8 @@ void WebViewImpl::refreshPageScaleFactorAfterLayout()
m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(contentsSize(), verticalScrollbarWidth);
}
- if (pinchVirtualViewportEnabled()) {
- int contentAndScrollbarWidth = contentsSize().width();
- if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlayScrollbar())
- contentAndScrollbarWidth += view->verticalScrollbar()->width();
-
- view->resize(m_pageScaleConstraintsSet.mainFrameSize(contentAndScrollbarWidth));
- }
+ if (pinchVirtualViewportEnabled())
+ view->resize(mainFrameSize());
float newPageScaleFactor = pageScaleFactor();
if (m_pageScaleConstraintsSet.needsReset() && m_pageScaleConstraintsSet.finalConstraints().initialScale != -1) {
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698