Web developers currently have no way to know when a programmatic smooth-scroll has completed. This feature provides a solution to the problem: make the programmatic scroll methods return Promise objects that get resolved on scroll completion.
We have six scroll methods available through both Element and Window interfaces. These methods return immediately with the value undefined, which was fine during the early days of the web when scroll was assumed to be instant. This behavior no longer seems adequate from a web developer's perspective today: there is widespread support for smooth-scroll (see browser_compatibility [1] for the CSS property), and it is not easy for the developers to determine when a particular call for a smooth-scroll has completed. This feature makes the programmatic scroll methods return Promise objects that get resolved on scroll completion. [1] https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior#browser_compatibility
Interoperability and Compatibility
Interop: Given the developers' support in the github discussion and the easy resolution in the CSWWG, we expect other major browsers to implement this feature in near future. Compat: To maintain the backward compatibility for the scroll methods, we would avoid rejecting the returned Promises (as much as possible). This is because unhandled Promise rejections are treated as exceptions, which could fail any JS callers that assume that those methods succeed unconditionally.
Security
None.
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
No milestones specified