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

Unified Diff: Source/core/html/HTMLBodyElement.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: address comments 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 | « Source/core/frame/LocalDOMWindow.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLBodyElement.cpp
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index 5702114e9b3a8bd42ddfbcd9c6ecac2499acbfa6..7c2e577627db6efaf69d604b253a3f93a564310e 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -247,6 +247,9 @@ void HTMLBodyElement::setScrollLeft(double scrollLeft)
Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
+ if (std::isnan(scrollLeft))
+ return;
+
if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
RenderBox* render = renderBox();
if (!render)
@@ -294,6 +297,9 @@ void HTMLBodyElement::setScrollTop(double scrollTop)
Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
+ if (std::isnan(scrollTop))
+ return;
+
if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
RenderBox* render = renderBox();
if (!render)
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698