Chromium Code Reviews| 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); |
| } |