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

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: 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 if (adjustedLayoutSizeWidth != m_pageDefinedConstraints.layoutSize.width()) { 177 if (adjustedLayoutSizeWidth != m_pageDefinedConstraints.layoutSize.width()) {
178 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0); 178 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0);
179 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefine dConstraints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width(); 179 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefine dConstraints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width();
180 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); 180 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth);
181 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); 181 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight);
182 } 182 }
183 } 183 }
184 184
185 void PageScaleConstraintsSet::applyDeviceScaleAdjustment(const ViewportDescripti on& viewportDescription, float deviceScaleAdjustment, float minimumWidth)
186 {
187 // If possible, reduce the layout width instead of applying text autosizing.
188 // But don't reduce below the minimum fallback width and don't reduce if exp licitly specified by the page author.
189 float width = m_pageDefinedConstraints.layoutSize.width();
190 if (width > minimumWidth && !viewportDescription.isSpecifiedByAuthor() && de viceScaleAdjustment > 1.0f)
aelias_OOO_until_Jul13 2013/11/07 02:05:25 Can we delete the condition "deviceScaleAdjustment
skobes 2013/11/07 17:55:27 Done.
191 m_pageDefinedConstraints.layoutSize.setWidth(std::max(minimumWidth, widt h / deviceScaleAdjustment));
192 }
193
185 } // namespace WebCore 194 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698