Visibility and performance entries

Hey all,

At our last call, we discussed the problem
<https://github.com/w3c/paint-timing/issues/40> of paint timing entries
being hard to reason about when the page has been backgrounded. We noted
that this does not only affect paint timing and hence requires a more
holistic solution so developers can easily choose to discard certain
performance entries whenever the page has been backgrounded before the
creation of the entry.

There are two different potential solutions for this, and we're looking for
feedback about which one is preferable:

1. Provide a boolean in PerformanceEntry that specifies whether the Window
has even been hidden between the Window creation time and the time of
creation of the PerformanceEntry.
2. Add a PageVisibilityObserver with 'buffered' flag to the Page Visibility
API <https://w3c.github.io/page-visibility> so that developers can get a
full history of the visibility changes of the Document. Right now,
onvisibilitychange can we used to obtain any visibility changes in the
future, but none from the past.

(1) has the advantage of being very explicit and easier to use for the
use-case of discarding entries, but (2) has the advantage of being more
flexible and enabling more use-cases from the ability to reconstruct the
full visibility history of the page. What do you think is more useful?

Received on Friday, 17 April 2020 14:13:39 UTC