Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should the active worker move to environment settings object? #811

Closed
jungkees opened this issue Jan 7, 2016 · 7 comments
Closed

Should the active worker move to environment settings object? #811

jungkees opened this issue Jan 7, 2016 · 7 comments

Comments

@jungkees
Copy link
Collaborator

jungkees commented Jan 7, 2016

It seems the navigation behavior in HTML has changed and says now a navigation doesn't create a new environment settings object but just re-use the settings object for the browsing context: https://html.spec.whatwg.org/#navigating-across-documents:set-up-a-browsing-context-environment-settings-object.

An environment settings object is a good fit to cover both window clients and worker clients. I think service worker client's active worker should move to environment settings object. And resetting the active worker can be specified in the HTML navigation algorithm. WDYT?

/cc @annevk @domenic

@annevk
Copy link
Member

annevk commented Jan 20, 2016

@domenic should probably weigh in, but I think that any state should be stored on the document. The global is not a great place because it does not change during navigation, as you noted.

@jungkees
Copy link
Collaborator Author

Then what do we do with workers? I don't think we're adding an unnecessary state. If that's still not desired, I guess at least we need a new client definition that holds necessary info for fetch and sw. What was the reason that environment settings object's lifetime is tied to the entire browsing context's lifetime by the way?

@annevk
Copy link
Member

annevk commented Jan 20, 2016

For workers it's fine to use the global object. I'm not saying the state is unnecessary, I'm just saying to put it on documents when the global is Window, and on the global elsewhere.

(And the reason the Window global is so messed up, not sure. Largely history at this point. We should probably explain that a bit somewhere if we haven't already.)

@slightlyoff
Copy link
Contributor

Going to resolve in favor of Client changes #870

@jakearchibald
Copy link
Contributor

Pre F2F notes: Doesn't look like there's anything to discuss

@jungkees
Copy link
Collaborator Author

F2F: We will have the active worker internal slot in global objects and have the corresponding environment settings objects return those values. This issue depends on and will be resolved by the changes that client-creating steps will make (among HTML, SW, and Fetch): #870.

@jungkees
Copy link
Collaborator Author

jungkees commented Nov 4, 2016

The active service worker has settled on the newly defined environment concept finally!

@jungkees jungkees closed this as completed Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants