Define the time origin for service workers#1621
Conversation
In [this HTML PR](whatwg/html#7339) we add a `time origin` getter to the `environment settings object`. We need to account for that value in service workers, which would be the time the worker environment is created.
The time origin, which is the epoch for all performance timeline APIs, was previously defined in https://w3c.github.io/hr-time/#dfn-time-origin. This makes its computation explicit, without changing its current definition and behavior. Notably: * "time origin becomes an environment settings object algorithm, computed differently for windows vs. worker scopes. * The 4 places where this timestamp is set are creation of an about:blank browsing context, the beginning of navigation, the confirmation of an unload prompt, and the creation of a worker. * The timestamp is a "shared monotonic clock" value, which is defined in HR-TIME (and internally in ECMAScript). As part of this PR, also refactored unload prompts to return a result rather than rely on a somewhat hand-wavy "refused to allow" property. See w3c/hr-time#131 and w3c/navigation-timing#166. See also w3c/ServiceWorker#1621.
jakearchibald
left a comment
There was a problem hiding this comment.
LGTM. The IPR check is failing - you dealt with that stuff right? I guess this PR was just before that happened?
I kept getting specific-patch approvals for IPR, never got one for this one. I can also join the WG as an individual if that's preferred. |
|
I'll land this now and we can deal with the fallout later. |
|
Usually there is a tool that provide a link to make it work magically, looks like it didn't work this time :( |
Great! How do I do that? |
The time origin, which is the epoch for all performance timeline APIs, was previously defined in https://w3c.github.io/hr-time/#dfn-time-origin. This makes its computation explicit, without changing its current definition and behavior. Notably: * "time origin becomes an environment settings object algorithm, computed differently for windows vs. worker scopes. * The 4 places where this timestamp is set are creation of an about:blank browsing context, the beginning of navigation, the confirmation of an unload prompt, and the creation of a worker. * The timestamp is a "shared monotonic clock" value, which is defined in HR-TIME (and internally in ECMAScript). As part of this PR, also refactored unload prompts to return a result rather than rely on a somewhat hand-wavy "refused to allow" property. See w3c/hr-time#131 and w3c/navigation-timing#166. See also w3c/ServiceWorker#1621.
In this HTML PR we add
a
time origingetter to theenvironment settings object.We need to account for that value in service workers, which would be the
time the worker environment is created.
Preview | Diff