Open noamr opened 11 months ago
Should there be a deactivationEnd
? I think it should be at the basically the same time as unloadEventEnd
, which makes it somewhat redundant but for symmetry and for a future where hopefully there is no unload
event it would be nice to have.
Discussed on the March 13, 2024 W3C WebPerf call: https://docs.google.com/document/d/1k7lB7XWXHBUmxR5YaycYTXWsHVqXelLh0RRDIFnx-gI/edit#heading=h.t4ndg6qhajam
Currently page deactivation (specifically calling
pagehide
andvisibilitychange
) is done some time afterresponseStart
and before the new page is activated, but it's unclear how long they took. This becomes more important with the introduction of cross-document view transitions, as the browser might add a rendering step between the new page's response headers being ready and deactivating the old document.Proposing to add
deactivationStart
or some such toPerformanceNavigationTiming
, that marks the time right before firingpagehide
&visibilitychange
(both of which fire beforeunload
). This will only be accessible in same-origin navigation. In addition, we should finish specing and implementing https://github.com/w3c/resource-timing/issues/345 - if we havefinalResponseHeadersEnd
anddeactivationStart
, the time in between would often mean the time spend preparing a view-transition./cc @tunetheweb @fergald @yoavweiss