-
Notifications
You must be signed in to change notification settings - Fork 785
[cssom-view] Element.scrolled promise? #13760
Description
In #1562 we resolved that the scrolling apis return promises, however what if the scroll wasn't programmatically initiated or has already been initiated? In the web animation api you can use the finished property of an active animation to wait until it is finished. I think it would be useful to have a similar property for scroll promises, e.g. Element.scrolled, to return the current scroll finished promise (or a resolved promise if no scrolling is ongoing) for that scroll container.
There is definitely some additional complexity here since we would have to define when non-programmatic scroll promises end, e.g. does each down arrow keypress start a new scroll or extend the life of the previous, but it may be useful both in wpt testing and in scroll listeners.