Closed
Description
The ScrollTimeline
IDL reads as follows:
dictionary ScrollTimelineOptions {
Element? source;
ScrollAxis axis = "block";
};
[Exposed=Window]
interface ScrollTimeline : AnimationTimeline {
constructor(optional ScrollTimelineOptions options = {});
};
And its specification text is:
- Let timeline be the new ScrollTimeline object.
- Set the source of timeline to:
- If the source member of options is present and not null,
The source member of options.- Otherwise,
The scrollingElement of the Document associated with the Window that is the current global object.
To me, the IDL and the spec text are contradictory. Since the constructor is specified as taking optional ScrollTimelineOptions options = {}
then I don't think we can distinguish between ScrollTimeline
being constructed without an options
parameter or with { source: null }
. But I believe the spec text is actually trying to distinguish between three cases:
{}
where the source would be set todocument.scrollingElement
,{ source: null }
where the source would not be set,{ source: document.body }
where the source would be set todocument.body
.
At least this is what is being tested by the WPT test scroll-animations/scroll-timelines/constructor.html.