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

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

Issue 2361303003: Sync IntersectionObserver IDL with the spec (Closed)
Patch Set: nits Created 4 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
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 b24372c8246e044a283c83da938e207fd81c8689..49d165925bc3a4040f3aeb6d0e84dd422b140a2e 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -107,13 +107,13 @@ void parseRootMargin(String rootMarginParameter,
}
}
-void parseThresholds(const DoubleOrDoubleArray& thresholdParameter,
+void parseThresholds(const DoubleOrDoubleSequence& thresholdParameter,
Vector<float>& thresholds,
ExceptionState& exceptionState) {
if (thresholdParameter.isDouble()) {
thresholds.append(static_cast<float>(thresholdParameter.getAsDouble()));
} else {
- for (auto thresholdValue : thresholdParameter.getAsDoubleArray())
+ for (auto thresholdValue : thresholdParameter.getAsDoubleSequence())
thresholds.append(static_cast<float>(thresholdValue));
}
@@ -159,16 +159,12 @@ IntersectionObserver* IntersectionObserver::create(
}
Vector<Length> rootMargin;
- if (observerInit.hasRootMargin())
- parseRootMargin(observerInit.rootMargin(), rootMargin, exceptionState);
+ parseRootMargin(observerInit.rootMargin(), rootMargin, exceptionState);
if (exceptionState.hadException())
return nullptr;
Vector<float> thresholds;
- if (observerInit.hasThreshold())
- parseThresholds(observerInit.threshold(), thresholds, exceptionState);
- else
- thresholds.append(0);
+ parseThresholds(observerInit.threshold(), thresholds, exceptionState);
if (exceptionState.hadException())
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/IntersectionObserver.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698