Intent to Implement: window.isFramePending

100 views
Skip to first unread message

Stefan Zager

unread,
Aug 30, 2019, 2:43:29 PM8/30/19
to blink-dev
Contact email: sza...@chromium.org




Summary: window.isFramePending() returns a boolean indicating whether the browser intends to update the visual display – including updating animations and running requestAnimationFrame callbacks – at the next opportunity (i.e., after the currently-running javascript task yields back to the browser).

Motivation: This provides developers with better information for making decisions in code about when to defer work and yield back to the browser's event loop.

Risks: This API reveals the fact that the browser has scheduled an animation frame, indicating that the page contents are dirty. More investigation is needed to ensure that this information is not exploitable (discussion is ongoing in the WICG proposal issue).

Interop/Compat: The way in which browsers determine when a "rendering opportunity" occurs is an un-specified implementation detail, so it's not immediately clear how much consistency there will be between browsers. Nevertheless, there are some useful invariants that can be included in web platform tests (see below).

Ergonomics: Should be pretty simple to use; follows the conventions of isInputPending.

Activation: To use this API effectively, developers should have a good understanding of the document lifecycle and how rendering updates happen.

Debuggability: No special features planned for debugging. The implementation includes a tracing variable that can show state changes.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, Android WebView): yes

Is this feature fully tested by web-platform-tests: Not yet, but a testing plan would probably include verifying the following:

  - When isFramePending() transitions from false to true, the only javascript tasks that are permitted to run before reqeuestAnimationFrame callbacks are input event handlers.

  - isFramePending() must always return false during the execution of a requestAnimationFrame callback.

Requesting approval to ship: no.

Brian Birtles

unread,
Sep 1, 2019, 6:36:19 PM9/1/19
to blink-dev
2019年8月31日土曜日 3時43分29秒 UTC+9 Stefan Zager:
Interop/Compat: The way in which browsers determine when a "rendering opportunity" occurs is an un-specified implementation detail, so it's not immediately clear how much consistency there will be between browsers. Nevertheless, there are some useful invariants that can be included in web platform tests (see below).

I understand the motivations for the proposal but a proposal where we we're not optimistic about future interop is a concern (something I believe Emilio raised in the WICG thread). The other browser vendors in that thread also appear hesitant.

Philip Jägenstedt

unread,
Sep 2, 2019, 9:57:34 AM9/2/19
to Brian Birtles, blink-dev
Issues filed on https://github.com/szager-chromium/isFramePending is probably the best way to make sure things don't fall off the radar. I filed https://github.com/szager-chromium/isFramePending/issues/1 but that's just about the naming.

Stefan, can you also file for TAG review early? That'd be another place for concerns about future interop to be raised.

--
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/4a36b09b-11eb-4caa-bc56-45a17682ebd7%40chromium.org.

Joe Medley

unread,
Sep 3, 2019, 12:44:25 PM9/3/19
to Philip Jägenstedt, Brian Birtles, blink-dev
Stefan,

Can you please create a Chrome Status entry?

Joe
Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.


Stefan Zager

unread,
Sep 3, 2019, 4:19:54 PM9/3/19
to Joe Medley, Philip Jägenstedt, Brian Birtles, blink-dev
On Tue, Sep 3, 2019 at 9:44 AM 'Joe Medley' via blink-dev <blin...@chromium.org> wrote:
Stefan,

Can you please create a Chrome Status entry?

Stefan Zager

unread,
Sep 3, 2019, 4:53:22 PM9/3/19
to Philip Jägenstedt, Brian Birtles, blink-dev
On Mon, Sep 2, 2019 at 6:57 AM Philip Jägenstedt <foo...@chromium.org> wrote:
Issues filed on https://github.com/szager-chromium/isFramePending is probably the best way to make sure things don't fall off the radar. I filed https://github.com/szager-chromium/isFramePending/issues/1 but that's just about the naming.

Stefan, can you also file for TAG review early? That'd be another place for concerns about future interop to be raised.

Reply all
Reply to author
Forward
0 new messages