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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 670833002: Early out if the scroll position passed in by js is NaN (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« 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: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index e347ad1045eab396af17f553cea46caed05003b3..1413db1de2b3e796cd65d0ceda7bada5f12a9940 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1403,6 +1403,12 @@ void LocalDOMWindow::scrollTo(double x, double y, ScrollBehavior scrollBehavior)
if (!view)
return;
+ // If the scrollTo position x/y is NaN, explicitly set it to 0.
+ if (x != x)
Rick Byers 2014/10/21 20:44:15 use std::isnan (then you can also remove the comme
+ x = 0;
+ if (y != y)
+ y = 0;
+
DoublePoint layoutPos(x * m_frame->pageZoomFactor(), y * m_frame->pageZoomFactor());
view->setScrollPosition(layoutPos, scrollBehavior);
}
« 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