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

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

Issue 61593006: Zoom instead of autosizing for desktop sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test. 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
« no previous file with comments | « Source/web/PageScaleConstraintsSet.h ('k') | Source/web/WebViewImpl.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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (description.maxWidth.isAuto() || description.maxWidth.type() == Exte ndToZoom || description.maxWidth == Length(100, ViewportPercentageWidth)) { 193 if (description.maxWidth.isAuto() || description.maxWidth.type() == Exte ndToZoom || description.maxWidth == Length(100, ViewportPercentageWidth)) {
194 adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor; 194 adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor;
195 adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayout SizeWidth, viewSize); 195 adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayout SizeWidth, viewSize);
196 } 196 }
197 } 197 }
198 198
199 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); 199 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth);
200 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); 200 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight);
201 } 201 }
202 202
203 void PageScaleConstraintsSet::applyDeviceScaleAdjustment(const ViewportDescripti on& viewportDescription, float deviceScaleAdjustment)
204 {
205 // If possible, reduce the layout width instead of applying text autosizing.
206 // But don't reduce below the minimum fallback width and don't reduce if exp licitly specified by the page author.
207 if (!viewportDescription.isSpecifiedByAuthor()) {
johnme 2013/11/11 15:49:38 Actually, I think we should also reduce the viewpo
kenneth.r.christiansen 2013/11/19 16:32:52 I am not sure that is a good idea. People who add
208 FloatSize& layoutSize = m_pageDefinedConstraints.layoutSize;
209 layoutSize.setWidth(std::max(viewportDescription.minWidth.value(), layou tSize.width() / deviceScaleAdjustment));
johnme 2013/11/11 15:49:38 I'm a bit concerned that this patch is going to ha
210 }
211 }
212
203 } // namespace WebCore 213 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/web/PageScaleConstraintsSet.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698