Skip to content

[scroll-animations-1] Something is odd with the handling of source in the ScrollTimeline constructor #5202

@birtles

Description

@birtles

The ScrollTimeline constructor text has the following:

Creates a new ScrollTimeline object using the following procedure:

  1. Let timeline be a new ScrollTimeline object.

  2. Let source be the result corresponding to the first matching condition from below.
    If the source value of options is non-null,

    • Let source be source

    Otherwise (source is null):

    • Let source be the scrollingElement of the Document associated with the Window that is the current global object.

    Note: source may still be null after this step, e.g. if the Document has no scrollingElement.

  3. Set the source of timeline to source.

Which is odd because source is not nullable in the ScrollTimeline spec. So how can we assign source if it is null?

Also, "Let source be source" is odd. Clearly it means the source member of options but it needs to say that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions