Chromium Code Reviews| Index: Source/web/PageScaleConstraintsSet.cpp |
| diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp |
| index b361be9ce18b7a5e6c70349c10fb53d7b7f8dae8..0c74a28be2cdc7526ae49f8057a9b1771dffc207 100644 |
| --- a/Source/web/PageScaleConstraintsSet.cpp |
| +++ b/Source/web/PageScaleConstraintsSet.cpp |
| @@ -39,6 +39,7 @@ namespace WebKit { |
| static const float defaultMinimumScale = 0.25f; |
| static const float defaultMaximumScale = 5.0f; |
| +static const float minimumLayoutWidth = 980.0f; |
|
aelias_OOO_until_Jul13
2013/11/07 22:02:50
ViewportDescription.minWidth.value() should always
skobes
2013/11/08 03:26:47
Done.
|
| PageScaleConstraintsSet::PageScaleConstraintsSet() |
| : m_lastContentsWidth(0) |
| @@ -182,4 +183,13 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri |
| } |
| } |
| +void PageScaleConstraintsSet::applyDeviceScaleAdjustment(const ViewportDescription& viewportDescription, float deviceScaleAdjustment) |
| +{ |
| + // If possible, reduce the layout width instead of applying text autosizing. |
| + // But don't reduce below the minimum fallback width and don't reduce if explicitly specified by the page author. |
| + float width = m_pageDefinedConstraints.layoutSize.width(); |
| + if (width > minimumLayoutWidth && !viewportDescription.isSpecifiedByAuthor()) |
|
aelias_OOO_until_Jul13
2013/11/07 22:02:50
Please delete the condition "width > minimumLayout
skobes
2013/11/08 03:26:47
Done.
|
| + m_pageDefinedConstraints.layoutSize.setWidth(std::max(minimumLayoutWidth, width / deviceScaleAdjustment)); |
| +} |
| + |
| } // namespace WebCore |