Skip to content

[cssom-view] Restore "instant" IDL enum value of ScrollBehavior #7773

@saschanaz

Description

@saschanaz

#3074 removed "instant" from the IDL, arguing that it's removed from scroll-behavior CSS property. But that enum value is not for CSS but for scroll APIs and is still supported on all engines including Gecko, Blink, and WebKit. It's behavior is different from "auto", per https://w3c.github.io/csswg-drafts/cssom-view-1/#perform-a-scroll:

  1. If the user agent honors the scroll-behavior property and one of the following are true:

    • behavior is "auto" and element is not null and its computed value of the scroll-behavior property is smooth
    • behavior is smooth

    ...then perform a smooth scroll of box to position. Once the position has finished updating, emit the scrollend event. Otherwise, perform an instant scroll of box to position. After an instant scroll emit the scrollend event.

Passing "instant" allows devs to force instant scroll regardless of scroll-behavior property.

Hi @tabatkins, I think you were confused there, what do you think?

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