acom...@fb.com, pani...@chromium.org, tdre...@chromium.org
https://github.com/WICG/is-input-pending
https://wicg.github.io/is-input-pending/
https://github.com/WICG/is-input-pending
This API enables developers to query for the presence of pending input events while running JavaScript. This enables them to respond immediately to user input by yielding, while being able to complete their work as fast as possible.
https://github.com/w3ctag/design-reviews/issues/475
Issues addressed
Interoperability risk: Medium. If other browsers do not implement this API, then a similar (albeit less performant) outcome can be achieved by yielding more often after checking for the presence of navigator.scheduling.isInputPending. This API has been discussed at length at TPAC 2018, TPAC 2019, and in Web Performance Working Group calls.
Compatibility risk: Low. Existing behaviour is unaffected. The primary mechanism through which compatibility risk could be introduced is through the addition of new input event types later down the line, in which case the function may return true more or less often than expected. We attempt to mitigate this by defining a semantic dichotomy of events (continuous and discrete, rather than allow filtering on a per-event basis).
Gecko: No signal (https://github.com/mozilla/standards-positions/issues/155)
WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2020-September/031390.html)
Web developers: Strongly positive
A Google ads team ran an experiment demonstrating they could yield 15% of the time on certain domains with an average input delay improvement of 100ms. They stated that the isInputPending latency improvement has clear UX benefit.
The Google Slides team was able to see a substantial improvement in render time (about 25%) of the left-hand-side filmstrip UI for complex content by not yielding (which is only possible with isInputPending, or else there would be unacceptable input delay).
Facebook was able to reduce event latency at p95 by 100ms by integrating isInputPending in an origin trial, while retaining their scheduler’s throughput.
Activation
This API will typically be used by framework libraries, such as React with concurrent mode (although any site that manages its own work queue may benefit). React plans to integrate isInputPending into their concurrent mode scheduler immediately. For web applications that do not use frameworks leveraging isInputPending yet frequently perform long tasks, they may benefit from additional outreach.
Implementers must take care to ensure that frames may not detect input events from other cross-origin frames. In Blink, this is achieved by performing hit testing on the compositor side for cross-origin frames within-process, and via viz for OOPIFs.
Yes
Yes (https://wpt.fyi/results/is-input-pending)
https://bugs.chromium.org/p/chromium/issues/approval?id=930987
https://wicg.github.io/is-input-pending/#examples-of-usage
https://chromestatus.com/feature/5719830432841728
Intent to Prototype: https://groups.google.com/a/chromium.org/d/msg/blink-dev/eLq8t56CbaQ/KdbOY7ZHCwAJ
Intent to Experiment: https://groups.google.com/a/chromium.org/d/msg/blink-dev/ItkbDBevOrs/yFffQlqTBQAJ
Contact emails
acom...@fb.com, pani...@chromium.org, tdre...@chromium.org
Explainer
https://github.com/WICG/is-input-pending
Specification
https://wicg.github.io/is-input-pending/
Design docs
https://github.com/WICG/is-input-pending
Summary
This API enables developers to query for the presence of pending input events while running JavaScript. This enables them to respond immediately to user input by yielding, while being able to complete their work as fast as possible.
Blink component
TAG review
https://github.com/w3ctag/design-reviews/issues/475
TAG review status
Issues addressed
Risks
Interoperability and Compatibility
Interoperability risk: Medium. If other browsers do not implement this API, then a similar (albeit less performant) outcome can be achieved by yielding more often after checking for the presence of navigator.scheduling.isInputPending. This API has been discussed at length at TPAC 2018, TPAC 2019, and in Web Performance Working Group calls.
Compatibility risk: Low. Existing behaviour is unaffected. The primary mechanism through which compatibility risk could be introduced is through the addition of new input event types later down the line, in which case the function may return true more or less often than expected. We attempt to mitigate this by defining a semantic dichotomy of events (continuous and discrete, rather than allow filtering on a per-event basis).
Gecko: No signal (https://github.com/mozilla/standards-positions/issues/155)
WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2020-September/031390.html)
Web developers: Strongly positive
A Google ads team ran an experiment demonstrating they could yield 15% of the time on certain domains with an average input delay improvement of 100ms. They stated that the isInputPending latency improvement has clear UX benefit.
The Google Slides team was able to see a substantial improvement in render time (about 25%) of the left-hand-side filmstrip UI for complex content by not yielding (which is only possible with isInputPending, or else there would be unacceptable input delay).
Facebook was able to reduce event latency at p95 by 100ms by integrating isInputPending in an origin trial, while retaining their scheduler’s throughput.
Activation
This API will typically be used by framework libraries, such as React with concurrent mode (although any site that manages its own work queue may benefit). React plans to integrate isInputPending into their concurrent mode scheduler immediately. For web applications that do not use frameworks leveraging isInputPending yet frequently perform long tasks, they may benefit from additional outreach.
Security
Implementers must take care to ensure that frames may not detect input events from other cross-origin frames. In Blink, this is achieved by performing hit testing on the compositor side for cross-origin frames within-process, and via viz for OOPIFs.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Is this feature fully tested by web-platform-tests?
Yes (https://wpt.fyi/results/is-input-pending)
Tracking bug
https://bugs.chromium.org/p/chromium/issues/approval?id=930987
Sample links
https://wicg.github.io/is-input-pending/#examples-of-usage
Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5719830432841728
Links to previous Intent discussions
Intent to Prototype: https://groups.google.com/a/chromium.org/d/msg/blink-dev/eLq8t56CbaQ/KdbOY7ZHCwAJ
Intent to Experiment: https://groups.google.com/a/chromium.org/d/msg/blink-dev/ItkbDBevOrs/yFffQlqTBQAJ
--
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+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/BYAPR15MB2728DBE16ED8A83933E33C7EC73F0%40BYAPR15MB2728.namprd15.prod.outlook.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+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/141dca84-024a-75d6-67cf-a3a6e090464f%40fb.com.