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

Side by Side Diff: Source/core/page/PageScaleConstraintsSet.cpp

Issue 23459006: [Android WebView] Fix WideViewport use case after r157293 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a test for useWideViewport=false + <meta name='viewport' content='height=1000'> 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
« no previous file with comments | « no previous file | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 m_pageDefinedConstraints.initialScale = 1.0f; 129 m_pageDefinedConstraints.initialScale = 1.0f;
130 } 130 }
131 131
132 float targetDensityDPIFactor = computeDeprecatedTargetDensityDPIFactor(argum ents, deviceScaleFactor); 132 float targetDensityDPIFactor = computeDeprecatedTargetDensityDPIFactor(argum ents, deviceScaleFactor);
133 if (m_pageDefinedConstraints.initialScale != -1) 133 if (m_pageDefinedConstraints.initialScale != -1)
134 m_pageDefinedConstraints.initialScale *= targetDensityDPIFactor; 134 m_pageDefinedConstraints.initialScale *= targetDensityDPIFactor;
135 m_pageDefinedConstraints.minimumScale *= targetDensityDPIFactor; 135 m_pageDefinedConstraints.minimumScale *= targetDensityDPIFactor;
136 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor; 136 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor;
137 137
138 float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width(); 138 float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width();
139 if (useWideViewport && arguments.maxWidth.type() == ExtendToZoom && argument s.zoom != 1.0f) 139 if (useWideViewport && (arguments.maxWidth.isAuto() || arguments.maxWidth.ty pe() == ExtendToZoom) && arguments.zoom != 1.0f)
140 adjustedLayoutSizeWidth = layoutFallbackWidth; 140 adjustedLayoutSizeWidth = layoutFallbackWidth;
141 else { 141 else {
142 if (!useWideViewport) 142 if (!useWideViewport)
143 adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, initialScale); 143 adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, initialScale);
144 if (!useWideViewport || arguments.maxWidth.type() == ExtendToZoom || arg uments.maxWidth.isViewportPercentage()) 144 if (!useWideViewport || (arguments.maxWidth.isAuto() || arguments.maxWid th.type() == ExtendToZoom) || arguments.maxWidth.isViewportPercentage())
145 adjustedLayoutSizeWidth /= targetDensityDPIFactor; 145 adjustedLayoutSizeWidth /= targetDensityDPIFactor;
146 } 146 }
147 147
148 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0); 148 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0);
149 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width(); 149 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width();
150 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); 150 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth);
151 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); 151 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight);
152 } 152 }
153 153
154 } // namespace WebCore 154 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698