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

Unified Diff: Source/core/css/CSSToLengthConversionData.h

Issue 871913003: Clamp 'zoom' in CSSToLengthConversionData. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Also clamp setZoom. Created 5 years, 11 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
« no previous file with comments | « LayoutTests/fast/css/zoom-zero-crash-expected.txt ('k') | Source/core/css/CSSToLengthConversionData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSToLengthConversionData.h
diff --git a/Source/core/css/CSSToLengthConversionData.h b/Source/core/css/CSSToLengthConversionData.h
index 93493c22226558ae3f9cb1770a97cda918bfd612..af3530220edc937713e5f5551f6c60c4cf711679 100644
--- a/Source/core/css/CSSToLengthConversionData.h
+++ b/Source/core/css/CSSToLengthConversionData.h
@@ -32,7 +32,9 @@
#define CSSToLengthConversionData_h
#include "wtf/Assertions.h"
+#include "wtf/MathExtras.h"
#include "wtf/Noncopyable.h"
+#include <limits>
namespace blink {
@@ -90,7 +92,7 @@ public:
double viewportMaxPercent() const;
void setFontSizes(const FontSizes& fontSizes) { m_fontSizes = fontSizes; }
- void setZoom(float zoom) { m_zoom = zoom; }
+ void setZoom(float zoom) { m_zoom = clampTo<float>(zoom, std::numeric_limits<float>::denorm_min()); }
CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const
{
« no previous file with comments | « LayoutTests/fast/css/zoom-zero-crash-expected.txt ('k') | Source/core/css/CSSToLengthConversionData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698