Skip to content

Define the time origin for service workers#1621

Merged
jakearchibald merged 1 commit intow3c:mainfrom
noamr:time-origin
Jan 25, 2022
Merged

Define the time origin for service workers#1621
jakearchibald merged 1 commit intow3c:mainfrom
noamr:time-origin

Conversation

@noamr
Copy link
Copy Markdown
Contributor

@noamr noamr commented Nov 24, 2021

In this HTML PR 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.


Preview | Diff

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.
domenic pushed a commit to whatwg/html that referenced this pull request Nov 29, 2021
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.
Copy link
Copy Markdown
Contributor

@jakearchibald jakearchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The IPR check is failing - you dealt with that stuff right? I guess this PR was just before that happened?

@noamr
Copy link
Copy Markdown
Contributor Author

noamr commented Jan 17, 2022

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.

@jakearchibald
Copy link
Copy Markdown
Contributor

@ylafon what does @noamr need to do to give irp for this particular change?

@noamr
Copy link
Copy Markdown
Contributor Author

noamr commented Jan 25, 2022

@ylafon what does @noamr need to do to give irp for this particular change?

ping?

@jakearchibald
Copy link
Copy Markdown
Contributor

I'll land this now and we can deal with the fallout later.

@jakearchibald jakearchibald merged commit d64ffd5 into w3c:main Jan 25, 2022
@noamr noamr deleted the time-origin branch January 25, 2022 14:18
@ylafon
Copy link
Copy Markdown
Member

ylafon commented Jan 25, 2022

Usually there is a tool that provide a link to make it work magically, looks like it didn't work this time :(
Joining as individual would makes things easier.

@noamr
Copy link
Copy Markdown
Contributor Author

noamr commented Jan 25, 2022

Usually there is a tool that provide a link to make it work magically, looks like it didn't work this time :( Joining as individual would makes things easier.

Great! How do I do that?

@ylafon
Copy link
Copy Markdown
Member

ylafon commented Jan 26, 2022

mfreed7 pushed a commit to mfreed7/html that referenced this pull request Jun 3, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants