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

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

Issue 55073002: [Android WebView] Add a quirk to clobber initial scale in certain cases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed checking against device-width Created 7 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 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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 2998
2999 ViewportDescription adjustedDescription = description; 2999 ViewportDescription adjustedDescription = description;
3000 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { 3000 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) {
3001 if (adjustedDescription.maxWidth.type() == ExtendToZoom) 3001 if (adjustedDescription.maxWidth.type() == ExtendToZoom)
3002 adjustedDescription.maxWidth = Length(); // auto 3002 adjustedDescription.maxWidth = Length(); // auto
3003 adjustedDescription.minWidth = adjustedDescription.maxWidth; 3003 adjustedDescription.minWidth = adjustedDescription.maxWidth;
3004 adjustedDescription.minHeight = adjustedDescription.maxHeight; 3004 adjustedDescription.minHeight = adjustedDescription.maxHeight;
3005 } 3005 }
3006 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 3006 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
3007 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); 3007 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size);
3008
3009 if (settingsImpl()->clobberUserAgentInitialScaleQuirk()
3010 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1
3011 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) {
3012 if (!description.maxWidth.isFixed()
3013 || (description.maxWidth == Length(100, ViewportPercentageWidth) && m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale == 1.0f))
3014 setInitialPageScaleOverride(-1);
3015 }
3008 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode()); 3016 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode());
3009 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 3017 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
3010 if (oldInitialScale != newInitialScale && newInitialScale != -1) { 3018 if (oldInitialScale != newInitialScale && newInitialScale != -1) {
3011 m_pageScaleConstraintsSet.setNeedsReset(true); 3019 m_pageScaleConstraintsSet.setNeedsReset(true);
3012 if (mainFrameImpl() && mainFrameImpl()->frameView()) 3020 if (mainFrameImpl() && mainFrameImpl()->frameView())
3013 mainFrameImpl()->frameView()->setNeedsLayout(); 3021 mainFrameImpl()->frameView()->setNeedsLayout();
3014 } 3022 }
3015 3023
3016 updateMainFrameLayoutSize(); 3024 updateMainFrameLayoutSize();
3017 } 3025 }
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4177 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4185 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4178 4186
4179 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4187 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4180 return false; 4188 return false;
4181 4189
4182 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4190 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4183 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4191 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4184 } 4192 }
4185 4193
4186 } // namespace WebKit 4194 } // 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