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

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

Issue 2758773004: 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 38b97c84f41a28cb13eedfd8e750a48d5448664e..bf826822192c6482d76f696207df09f4b4c269ec 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