Re: [slightlyoff/ServiceWorker] consider firing a "clientcontrolled" event on ServiceWorkerGlobalScope (#886)

It looks like document client-wise, [7.8.10 History Traversal](https://html.spec.whatwg.org/multipage/browsers.html#history-traversal)'s step 3 `Make entry's Document object the active document of the browsing context.` can correspond to "clientcontrolled", it just needs an "other applicable specifications" algorithm callout here.  This covers:
* Use of "traverse the history by a delta" used for go(delta), back(), forward() which covers the bfcache case (which I assume is the only thin that really was a question?).
* Fresh navigations which use [update the session history with a new page](https://html.spec.whatwg.org/multipage/browsers.html#update-the-session-history-with-the-new-page) which calls out to [traverse the history](https://html.spec.whatwg.org/multipage/browsers.html#traverse-the-history) as well.  For HTML, this callout happens during [7.8.2 Page load processing model for HTML files](https://html.spec.whatwg.org/multipage/browsers.html#read-html), and is similarly invoked for the XML/text/etc. cases.

For "clientuncontrolled", it seems like [unload a document](https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document) is already linked in appropriately.  Specifically, [Handle Service Worker Client Unload](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#on-client-unload-algorithm)'s "unloading" link links to HTML's `unload a document` and we can add a step in the SW spec there already.  (HTML's `unload a document` Step 10 explicitly says `Run any unloading document cleanup steps for Document that are defined by this specification and other applicable specifications.`  The only reason one might want a change is if we want the parent document to notify ahead of its iframes; those get unloaded in step 13.)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/886#issuecomment-237677827

Received on Thursday, 4 August 2016 20:45:05 UTC