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

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

Issue 2361303003: Sync IntersectionObserver IDL with the spec (Closed)
Patch Set: Array->Sequence Created 4 years, 3 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 1970c981dc1e8de5d0fe50185daa80c0d5569d65..7da91ebc19173844a08fff4ebb5a47bbdc1fa91e 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -102,12 +102,12 @@ void parseRootMargin(String rootMarginParameter, Vector<Length>& rootMargin, Exc
}
}
-void parseThresholds(const DoubleOrDoubleArray& thresholdParameter, Vector<float>& thresholds, ExceptionState& exceptionState)
+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));
}
@@ -148,16 +148,12 @@ IntersectionObserver* IntersectionObserver::create(const IntersectionObserverIni
}
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;

Powered by Google App Engine
This is Rietveld 408576698