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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |