Skip to content

[scroll-animations] ScrollTimeline constructor has contradictory IDL and prose  #11340

Closed
@graouts

Description

@graouts

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:

  1. Let timeline be the new ScrollTimeline object.
  2. Set the source of timeline to:

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:

  1. {} where the source would be set to document.scrollingElement,
  2. { source: null } where the source would not be set,
  3. { source: document.body } where the source would be set to document.body.

At least this is what is being tested by the WPT test scroll-animations/scroll-timelines/constructor.html.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions