OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |