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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 2754323003: Temporarily add CHECKs to VisualViewport::didSetScaleAndLocation (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
index 71388154af98c38a5efdfa1ff1c72483ab7d6d24..f960a6b3073e64ebc26b97ad15b0f1c886b663e3 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
@@ -250,6 +250,8 @@ bool VisualViewport::didSetScaleOrLocation(float scale,
bool valuesChanged = false;
+ CHECK(!std::isnan(scale));
+ CHECK(std::isfinite(scale));
if (scale != m_scale) {
m_scale = scale;
valuesChanged = true;
@@ -259,6 +261,10 @@ bool VisualViewport::didSetScaleOrLocation(float scale,
ScrollOffset clampedOffset = clampScrollOffset(toScrollOffset(location));
+ CHECK(!std::isnan(clampedOffset.width()) &&
+ !std::isnan(clampedOffset.height()));
+ CHECK(std::isfinite(clampedOffset.width()) &&
+ std::isfinite(clampedOffset.height()));
if (clampedOffset != m_offset) {
m_offset = clampedOffset;
scrollAnimator().setCurrentOffset(m_offset);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698