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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 if (m_pageDefinedConstraints.maximumScale != -1) | 212 if (m_pageDefinedConstraints.maximumScale != -1) |
213 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor; | 213 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor; |
214 if (wideViewportQuirkEnabled && | 214 if (wideViewportQuirkEnabled && |
215 (!useWideViewport || description.maxWidth.type() == DeviceWidth)) { | 215 (!useWideViewport || description.maxWidth.type() == DeviceWidth)) { |
216 adjustedLayoutSizeWidth /= targetDensityDPIFactor; | 216 adjustedLayoutSizeWidth /= targetDensityDPIFactor; |
217 adjustedLayoutSizeHeight /= targetDensityDPIFactor; | 217 adjustedLayoutSizeHeight /= targetDensityDPIFactor; |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 if (wideViewportQuirkEnabled) { | 221 if (wideViewportQuirkEnabled) { |
222 if (useWideViewport && (description.maxWidth.isAuto() || | 222 if (useWideViewport && |
223 description.maxWidth.type() == ExtendToZoom) && | 223 (description.maxWidth.isAuto() || |
| 224 description.maxWidth.type() == ExtendToZoom) && |
224 description.zoom != 1.0f) { | 225 description.zoom != 1.0f) { |
225 if (layoutFallbackWidth) | 226 if (layoutFallbackWidth) |
226 adjustedLayoutSizeWidth = layoutFallbackWidth; | 227 adjustedLayoutSizeWidth = layoutFallbackWidth; |
227 adjustedLayoutSizeHeight = computeHeightByAspectRatio( | 228 adjustedLayoutSizeHeight = computeHeightByAspectRatio( |
228 adjustedLayoutSizeWidth, FloatSize(m_icbSize)); | 229 adjustedLayoutSizeWidth, FloatSize(m_icbSize)); |
229 } else if (!useWideViewport) { | 230 } else if (!useWideViewport) { |
230 const float nonWideScale = | 231 const float nonWideScale = |
231 description.zoom < 1 && description.maxWidth.type() != DeviceWidth && | 232 description.zoom < 1 && description.maxWidth.type() != DeviceWidth && |
232 description.maxWidth.type() != DeviceHeight | 233 description.maxWidth.type() != DeviceHeight |
233 ? -1 | 234 ? -1 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 adjustedLayoutSizeHeight = computeHeightByAspectRatio( | 274 adjustedLayoutSizeHeight = computeHeightByAspectRatio( |
274 adjustedLayoutSizeWidth, FloatSize(m_icbSize)); | 275 adjustedLayoutSizeWidth, FloatSize(m_icbSize)); |
275 } | 276 } |
276 } | 277 } |
277 | 278 |
278 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); | 279 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); |
279 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); | 280 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); |
280 } | 281 } |
281 | 282 |
282 } // namespace blink | 283 } // namespace blink |
OLD | NEW |