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

Service worker registration selection for iframes with srcdoc #321

Open
jungkees opened this issue Nov 9, 2015 · 5 comments
Open

Service worker registration selection for iframes with srcdoc #321

jungkees opened this issue Nov 9, 2015 · 5 comments
Assignees

Comments

@jungkees
Copy link
Contributor

jungkees commented Nov 9, 2015

A document loading for an iframe with srcdoc attribute doesn't go through fetch algorithm. (That is, it uses the given value instead of fetching a resource.) So currently the selection (match) of the service worker registration for the navigation doesn't occur.

In the recent service worker f2f, it has been discussed that once the iframe srcdoc document is created, the resource requests for that document should be controlled by the containing frame's service worker. This bit should be specified.

Related issue: w3c/ServiceWorker#765

jungkees added a commit to jungkees/html that referenced this issue Nov 9, 2015
When iframe srcdoc document is created during the steps in navigation
algorithm, the document's Window object's environment settings object
should inherit the parent browsing context's active (service) worker.

This PR introduces an active worker for an environment settings object.
This internal slot may be referenced in more places when adding hooks
to service workers.

Fixes whatwg#321.

R= @annevk, @mikewest.
@annevk
Copy link
Member

annevk commented Nov 9, 2015

This is also true for about:blank, right? And for blob/data URLs?

@jungkees
Copy link
Contributor Author

jungkees commented Nov 9, 2015

I think those at least go through fetch (as local url requests)? If so, this text (https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#selection) seems to cover that. But sure it'd be better to specify that in the related steps directly.

@jungkees
Copy link
Contributor Author

jungkees commented Nov 9, 2015

I think I might want to add some steps in Navigate for the selection of the registration for local urls.

Also, I noticed that I cannot set the client's active worker to the registration's active worker in Handle Fetch step 12.5 as the target browsing context's Window object has not been created by that time. So setting an active worker to a window client should also be specified in the Navigate algorithm?

@annevk
Copy link
Member

annevk commented Nov 9, 2015

Yeah, blob and data URLs do go through Fetch (not sure how the latter should be handled, perhaps it should always be without service worker). about:blank doesn't always.

You probably want to hook the service worker stuff into when a document is created. And similarly at the place where a worker is created.

@jungkees
Copy link
Contributor Author

Yes, please assign this issue to me. (Note that it'll take time as I'm planning a two weeks vacation later this month.)

jungkees added a commit to jungkees/html that referenced this issue Mar 30, 2016
This PR defines an active worker for a Document and a
WorkerGlobalScope and the corresponding steps that set the values when
they are created. It also defines an active worker algorithm in the
environment settings object that returns the stored active worker.

This PR also defines setting an active worker for an iframe srcdoc
document to the creator Document's active worker. (Fixes whatwg#321.)

R= @annevk, @mikewest.
jungkees added a commit to jungkees/html that referenced this issue Mar 31, 2016
This PR defines an active worker for a Document and a
WorkerGlobalScope and the corresponding steps that set the values when
they are created. It also defines an active worker algorithm in the
environment settings object that returns the stored active worker.

This PR also defines setting an active worker for an iframe srcdoc
document to the creator Document's active worker. (Fixes whatwg#321.)

R= @annevk, @mikewest.
jungkees added a commit to jungkees/html that referenced this issue Apr 8, 2016
This PR defines an active worker for a Document and a
WorkerGlobalScope and the corresponding steps that set the values when
they are created. It also defines an active worker algorithm in the
environment settings object that returns the stored active worker.

This PR also defines setting an active worker for an iframe srcdoc
document to the creator Document's active worker. (Fixes whatwg#321.)

R= @annevk, @mikewest.
jungkees added a commit to jungkees/html that referenced this issue Apr 8, 2016
This PR defines an active worker for a Document and a
WorkerGlobalScope and the corresponding steps that set the values when
they are created. It also defines an active worker algorithm in the
environment settings object that returns the stored active worker.

This commit also makes the active worker of a document, whose address
is local and who has its creator (a parent or an opener), initialized
to the creator's document's active worker. The relevant steps are
added both in the creating a new browsing context algorithm and in the
initializing a new document algorithms. (Fixes whatwg#321)

R= @annevk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants