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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp

Issue 2132863002: IntersectionObserver: check threshold parameters for NaN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions-expected.txt ('k') | 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/dom/IntersectionObserver.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
index fbe2e1b875941bc5b194d4e415a06a7150da55e0..4f2451092ab7f37c36ab7ba2b6f69e7a370619d4 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -112,8 +112,8 @@ void parseThresholds(const DoubleOrDoubleArray& thresholdParameter, Vector<float
}
for (auto thresholdValue : thresholds) {
- if (thresholdValue < 0.0 || thresholdValue > 1.0) {
- exceptionState.throwRangeError("Threshold values must be between 0 and 1");
+ if (std::isnan(thresholdValue) || thresholdValue < 0.0 || thresholdValue > 1.0) {
+ exceptionState.throwRangeError("Threshold values must be numbers between 0 and 1");
break;
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698