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

Unified Diff: third_party/WebKit/Source/core/dom/ViewportDescription.cpp

Issue 2461143002: Reconstrain zoom value to the [min-zoom, max-zoom] range before it used (Closed)
Patch Set: Created 4 years, 2 months 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: third_party/WebKit/Source/core/dom/ViewportDescription.cpp
diff --git a/third_party/WebKit/Source/core/dom/ViewportDescription.cpp b/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
index 0deda17a3f8a508f73704deaf15a6edef9d5c089..9b2bb1be5f3cb1ff2d48bc2548b35188e297e01d 100644
--- a/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
+++ b/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
@@ -201,7 +201,7 @@ PageScaleConstraints ViewportDescription::resolve(
initialViewportSize.width();
}
- // Resolve initial-scale value.
+ // 9. Resolve initial-scale value.
rune 2016/10/31 14:45:03 The numbering used to correspond with the numberin
bokan 2016/10/31 14:47:55 In that case, since the numbers no longer correspo
if (resultZoom == ViewportDescription::ValueAuto) {
if (resultWidth != ViewportDescription::ValueAuto && resultWidth > 0)
resultZoom = initialViewportSize.width() / resultWidth;
@@ -212,6 +212,12 @@ PageScaleConstraints ViewportDescription::resolve(
}
}
+ // 10. Reconstrain zoom value to the [min-zoom, max-zoom] range. It will reset
+ // below, if it is ValueAuto.
+ resultZoom = compareIgnoringAuto(
+ resultMinZoom, compareIgnoringAuto(resultMaxZoom, resultZoom, std::min),
+ std::max);
rune 2016/10/31 14:45:03 This can be moved inside the block above, right?
+
// If user-scalable = no, lock the min/max scale to the computed initial
// scale.
if (!resultUserZoom)

Powered by Google App Engine
This is Rietveld 408576698