Contact emailsmus...@chromium.org

Explainerhttps://github.com/explainers-by-googlers/promisify-scroll
Specificationhttps://github.com/w3c/csswg-drafts/issues/1562

Summary

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.

Blink componentBlink>Scroll
<https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3EScroll%22>

Motivation

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

Initial public proposalNone

TAG reviewNone

TAG review statusNot applicable

Risks

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.

*Gecko*: No signal

*WebKit*: No signal

*Web developers*: Positive (https://github.com/w3c/csswg-drafts/issues/1562)

*Other signals*:

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


Debuggability

None

Is this feature fully tested by web-platform-tests
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>
?No

Flag name on about://flagsNone

Finch feature nameNone

Non-finch justificationNone

Requires code in //chrome?False

Tracking bughttps://issues.chromium.org/41406914

Estimated milestones

No milestones specified

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5082138340491264?gate=5127047458062336

This intent message was generated by Chrome Platform Status
<https://chromestatus.com/>.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAB0cuO7QpgC2bUgHk6ZWLsNjaR%3DLb-O%3DA5hiOF5vgJicbR9igQ%40mail.gmail.com.

Reply via email to