Intent to ship: VisibilityStateEntry

124 views
Skip to first unread message

Noam Rosenthal

unread,
Apr 25, 2023, 4:26:38 AM4/25/23
to blink-dev

Contact emails

n...@chromium.orgnrose...@chromium.org

Explainer

https://docs.google.com/document/d/1l5kHiJRkdQwEN-CYI5_mUNODhQVB5rCyjN4jHDdXDHA/edit#

Specification

https://github.com/whatwg/html/pull/8206

Summary

Exposes to PerformanceObserver the initial visibility state of a page plus any visibility state changes that the page goes through. Also adds support for this to the observe() method's buffered flag.



Blink component

Blink>PerformanceAPIs

Search tags

visibility

TAG review

https://github.com/w3ctag/design-reviews/issues/534

TAG review status

Issues addressed

Risks



Interoperability and Compatibility

Low risk, as this API should not be user-visible and we expect other major browser vendors to implement the API at some point, as they all currently implement document.visibilityState. This API has been discussed in the W3C WebPerf WG. Minutes here: https://docs.google.com/document/d/1PMbJ8kUHtrrCZxHJfKXcV0YQeTxyMOH4AORgd2VuhOw/edit



Gecko: Positive (https://github.com/whatwg/html/pull/8206#issuecomment-1499406083)

WebKit: No signal

Web developers: No signals

Other signals:

Ergonomics

This will frequently be used in tandem with other performance APIs, so the choice to integrate with PerformanceObserver seems natural in that regard.



Activation

This can already be somewhat polyfilled by appending a very early JavaScript snippet to the page, querying document.visibilityState, and registering an onvisibilitychange event handler.



Security

This API does not introduce any security/privacy risks that would not be already present with the Page Visibility API.



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?

N/A



Debuggability



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

Flag name

VisibilityStateEntry

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1103451

Measurement

New UseCounter has been added for visibility-state observers.

Availability expectation

Will be available in all browsers once shipped

Adoption expectation

Feature was requested by big partners such as Facebook, and matches some of the expectations of RUM providers.

Adoption plan

This is a small feature, probably a short blog + MDN update will do.

Estimated milestones

Shipping on desktop115
Shipping on Android115
Shipping on WebView115


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

https://github.com/whatwg/html/pull/8206

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5683502144028672

Links to previous Intent discussions



This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Apr 26, 2023, 6:28:13 AM4/26/23
to Noam Rosenthal, blink-dev
Thanks for pushing this over the line!!

What's preventing the PR from landing?
 


Summary

Exposes to PerformanceObserver the initial visibility state of a page plus any visibility state changes that the page goes through. Also adds support for this to the observe() method's buffered flag.



Blink component

Blink>PerformanceAPIs

Search tags

visibility

TAG review

https://github.com/w3ctag/design-reviews/issues/534

TAG review status

Issues addressed

Risks



Interoperability and Compatibility

Low risk, as this API should not be user-visible and we expect other major browser vendors to implement the API at some point, as they all currently implement document.visibilityState. This API has been discussed in the W3C WebPerf WG. Minutes here: https://docs.google.com/document/d/1PMbJ8kUHtrrCZxHJfKXcV0YQeTxyMOH4AORgd2VuhOw/edit



Gecko: Positive (https://github.com/whatwg/html/pull/8206#issuecomment-1499406083)

WebKit: No signal

Can we ask for a signal?
 

Web developers: No signals

I think Meta's request for this (even if old) can count as a positive signal.
 
--
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/CAJn%3DMYaRn4fPjxGmtLT4zTEUfq-r4esCpfU8EU36FhnNk4CGag%40mail.gmail.com.

Noam Rosenthal

unread,
Apr 26, 2023, 11:53:46 AM4/26/23
to Yoav Weiss, blink-dev
On Wed, Apr 26, 2023 at 1:28 PM Yoav Weiss <yoav...@chromium.org> wrote:
Thanks for pushing this over the line!!

On Tue, Apr 25, 2023 at 10:26 AM Noam Rosenthal <nrose...@chromium.org> wrote:

What's preventing the PR from landing?
Nothing at all. Sending this I2S is part of showing that Chrome is going to ship this. Was planning on merging the enabled-by-default CL after the spec PR is merged.

Yoav Weiss

unread,
Apr 27, 2023, 2:45:25 AM4/27/23
to Noam Rosenthal, blink-dev
LGTM1

Please send a webkit position for this, even if it is non-blocking.

Noam Rosenthal

unread,
Apr 27, 2023, 3:04:13 AM4/27/23
to Yoav Weiss, blink-dev
On Wed, 26 Apr 2023 at 18:53 Noam Rosenthal <nrose...@chromium.org> wrote:


On Wed, Apr 26, 2023 at 1:28 PM Yoav Weiss <yoav...@chromium.org> wrote:
Thanks for pushing this over the line!!

On Tue, Apr 25, 2023 at 10:26 AM Noam Rosenthal <nrose...@chromium.org> wrote:

What's preventing the PR from landing?
Nothing at all. Sending this I2S is part of showing that Chrome is going to ship this. Was planning on merging the enabled-by-default CL after the spec PR is merged.
 

The spec PR is now merged.

Mike Taylor

unread,
Apr 27, 2023, 10:29:58 AM4/27/23
to Yoav Weiss, Noam Rosenthal, blink-dev

Chris Harrelson

unread,
Apr 27, 2023, 12:21:01 PM4/27/23
to Mike Taylor, Yoav Weiss, Noam Rosenthal, blink-dev

Ilya Grigorik

unread,
Apr 27, 2023, 12:25:09 PM4/27/23
to Mike Taylor, Yoav Weiss, Noam Rosenthal, blink-dev
Hooray! Excited to see this landing.

On Thu, Apr 27, 2023 at 7:29 AM Mike Taylor <mike...@chromium.org> wrote:
Reply all
Reply to author
Forward
0 new messages