w3c / event-timing

A proposal for an Event Timing specification.
https://w3c.github.io/event-timing/
Other
44 stars 13 forks source link

Proposal: add page visibility attribute to PerformanceEventTiming entry #110

Closed nhelfman closed 2 years ago

nhelfman commented 3 years ago

When processing event timing entries it can be important to determine the page visibility state the event was during its duration. This is important since events which occurred (or completed) while the page was not visible may have longer duration due to UA CPU throttling.

Without being able to distinguish between the entries based on page visibility it is hard to collect reliable information about the responsiveness performance.

The is no simple way to exclude these events. Using Page Visibility API to determine that can be fragile and inaccurate.

npm1 commented 2 years ago

Is this a dupe of https://github.com/w3c/performance-timeline/issues/105? Let me know if we can close this in favor of that.

nhelfman commented 2 years ago

Sure. Assuming the performance timeline issue will be resolved in a way which provides reliable way to determine the visibility (or even better "throttled state") during the event period.

npm1 commented 2 years ago

Specifically when would you consider an event to be affected by visibility? Note that there may be changes in visibility from the time the event occurs to the end time of the Event Timing duration attribute.

npm1 commented 2 years ago

Anyways, let's keep the discussion on the Performance Timeline issue I linked above.