w3c/IntersectionObserver

What if "options" is absent in the constructor?

Closed this issue · 2 comments

The ‘options’ parameter of the constructor ‘new IntersectionObserver(callback, options)’ in section 2.2. The IntersectionObserver interface is marked as optional, but the algorithm does not treat the case that it is absent. Presumably, that does not throw a SyntaxError in step 4. But what does it do?

The steps to construct an IntersectionObserver have been split out to here:

https://w3c.github.io/IntersectionObserver/#initialize-new-intersection-observer

That specifies that it requires an IntersectionObserverInit as input, so I think this issue is now moot.

@bert-github, just to be clear, when options is omitted, the second argument is automatically assigned the following default values (so it always looks like options present):
https://w3c.github.io/IntersectionObserver/#dictdef-intersectionobserverinit

Closing as answered.