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

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

Issue 23691017: [Android WebView] Treat zero values in viewport arguments specially (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Separated two quirks and moved the zero values quirk into the parsing stage 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 2999 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 } 3010 }
3011 3011
3012 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments& arguments) 3012 void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments& arguments)
3013 { 3013 {
3014 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page() || !m_size.width || !m_size.height) 3014 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled() || !page() || !m_size.width || !m_size.height)
3015 return; 3015 return;
3016 3016
3017 ViewportArguments adjustedArguments = arguments; 3017 ViewportArguments adjustedArguments = arguments;
3018 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type == ViewportArguments::ViewportMeta) 3018 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type == ViewportArguments::ViewportMeta)
3019 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk; 3019 adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk;
3020 if (page()->settings().viewportMetaZeroValuesQuirk() && adjustedArguments.ty pe == ViewportArguments::ViewportMeta) {
rune 2013/09/02 20:09:06 Looking at the if-test two lines further up, this
mnaganov (inactive) 2013/09/03 09:07:27 I was proposing to merge those two quirks because
3021 if (adjustedArguments.width == ViewportArguments::ValueDeviceWidth && !s tatic_cast<int>(adjustedArguments.zoom))
3022 adjustedArguments.zoom = 1.0;
rune 2013/09/02 20:09:06 If I understand this correctly, this could also ha
mnaganov (inactive) 2013/09/03 09:07:27 Thanks for the suggestion! Moved.
3023 }
3020 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_ size, page()->settings().layoutFallbackWidth()); 3024 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_ size, page()->settings().layoutFallbackWidth());
3021 3025
3022 if (settingsImpl()->supportDeprecatedTargetDensityDPI()) 3026 if (settingsImpl()->supportDeprecatedTargetDensityDPI())
3023 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView( adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv iewMode()); 3027 m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView( adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScale Factor(), page()->settings().useWideViewport(), page()->settings().loadWithOverv iewMode());
3024 3028
3025 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon straints().layoutSize); 3029 WebSize layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedCon straints().layoutSize);
3026 3030
3027 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay outSize.width != fixedLayoutSize().width) 3031 if (page()->settings().textAutosizingEnabled() && page()->mainFrame() && lay outSize.width != fixedLayoutSize().width)
3028 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers (); 3032 page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers ();
3029 3033
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
4127 } 4131 }
4128 4132
4129 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4133 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4130 { 4134 {
4131 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4135 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4132 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4136 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4133 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4137 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4134 } 4138 }
4135 4139
4136 } // namespace WebKit 4140 } // 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