Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1760)

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 61593006: Zoom instead of autosizing for desktop sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index b361be9ce18b7a5e6c70349c10fb53d7b7f8dae8..adb0ad41a26c51e62c1c471545da7e3553ee739b 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -182,4 +182,13 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
}
}
+void PageScaleConstraintsSet::applyDeviceScaleAdjustment(const ViewportDescription& viewportDescription, float deviceScaleAdjustment, float minimumWidth)
+{
+ // 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 > minimumWidth && !viewportDescription.isSpecifiedByAuthor() && deviceScaleAdjustment > 1.0f)
aelias_OOO_until_Jul13 2013/11/07 02:05:25 Can we delete the condition "deviceScaleAdjustment
skobes 2013/11/07 17:55:27 Done.
+ m_pageDefinedConstraints.layoutSize.setWidth(std::max(minimumWidth, width / deviceScaleAdjustment));
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698