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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 23038013: [Android WebView] Avoid expanding layout width to match the old WebView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed aelias' comments Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after
2991 // isn't set at the end of a layout. 2991 // isn't set at the end of a layout.
2992 if (view->needsLayout()) 2992 if (view->needsLayout())
2993 view->layout(); 2993 view->layout();
2994 } 2994 }
2995 2995
2996 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments& arguments) 2996 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments& arguments)
2997 { 2997 {
2998 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page() || !m_size.width || !m_size.height) 2998 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page() || !m_size.width || !m_size.height)
2999 return; 2999 return;
3000 3000
3001 m_pageScaleConstraintsSet.updatePageDefinedConstraints(arguments, m_size, pa ge()->settings().layoutFallbackWidth()); 3001 ViewportArguments adjustedArguments = arguments;
3002 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type == ViewportArguments::ViewportMeta)
3003 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk;
3004 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_ size, page()->settings().layoutFallbackWidth());
3002 3005
3003 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) 3006 if (settingsImpl()->supportDeprecatedTargetDensityDPI())
3004 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView( arguments, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor() , page()->settings().useWideViewport(), page()->settings().loadWithOverviewMode( )); 3007 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView( adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv iewMode());
3005 3008
3006 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon straints().layoutSize); 3009 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon straints().layoutSize);
3007 3010
3008 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay outSize.width != fixedLayoutSize().width) 3011 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay outSize.width != fixedLayoutSize().width)
3009 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers (); 3012 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers ();
3010 3013
3011 setFixedLayoutSize(layoutSize); 3014 setFixedLayoutSize(layoutSize);
3012 } 3015 }
3013 3016
3014 IntSize WebViewImpl::contentsSize() const 3017 IntSize WebViewImpl::contentsSize() const
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4116 } 4119 }
4117 4120
4118 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4121 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4119 { 4122 {
4120 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4123 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4121 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4124 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4122 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4125 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4123 } 4126 }
4124 4127
4125 } // namespace WebKit 4128 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698