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 | 129 |
130 float targetDensityDPIFactor = computeDeprecatedTargetDensityDPIFactor(argum ents, deviceScaleFactor); | 130 float targetDensityDPIFactor = computeDeprecatedTargetDensityDPIFactor(argum ents, deviceScaleFactor); |
131 if (m_pageDefinedConstraints.initialScale != -1) | 131 if (m_pageDefinedConstraints.initialScale != -1) |
132 m_pageDefinedConstraints.initialScale *= targetDensityDPIFactor; | 132 m_pageDefinedConstraints.initialScale *= targetDensityDPIFactor; |
133 m_pageDefinedConstraints.minimumScale *= targetDensityDPIFactor; | 133 m_pageDefinedConstraints.minimumScale *= targetDensityDPIFactor; |
134 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor; | 134 m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor; |
135 | 135 |
136 float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width(); | 136 float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width(); |
137 if (useWideViewport && arguments.width == -1 && arguments.zoom != 1.0f) | 137 if (useWideViewport && arguments.width == -1 && arguments.zoom != 1.0f) |
138 adjustedLayoutSizeWidth = layoutFallbackWidth; | 138 adjustedLayoutSizeWidth = layoutFallbackWidth; |
139 else if (useWideViewport && arguments.width != -1 && arguments.width != View portArguments::ValueDeviceWidth) | |
140 adjustedLayoutSizeWidth = arguments.width; | |
aelias_OOO_until_Jul13
2013/08/21 20:23:54
This ends up bypassing every other width computati
mnaganov (inactive)
2013/08/22 08:51:55
Thanks for the suggestion, Alexandre! I didn't con
| |
139 else { | 141 else { |
140 if (!useWideViewport) | 142 if (!useWideViewport) |
141 adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, initialScale); | 143 adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, initialScale); |
144 else if (arguments.width == ViewportArguments::ValueDeviceWidth || (argu ments.width == -1 && arguments.zoom == 1.0f)) | |
145 adjustedLayoutSizeWidth = viewSize.width(); | |
142 if (!useWideViewport || arguments.width == -1 || arguments.width == View portArguments::ValueDeviceWidth) | 146 if (!useWideViewport || arguments.width == -1 || arguments.width == View portArguments::ValueDeviceWidth) |
143 adjustedLayoutSizeWidth /= targetDensityDPIFactor; | 147 adjustedLayoutSizeWidth /= targetDensityDPIFactor; |
144 } | 148 } |
145 | 149 |
146 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0); | 150 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0); |
147 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width(); | 151 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width(); |
148 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); | 152 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); |
149 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); | 153 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); |
150 } | 154 } |
151 | 155 |
152 } // namespace WebCore | 156 } // namespace WebCore |
OLD | NEW |