Closed dtapuska closed 5 years ago
Interesting. This is very different than the requirement to stop running new tasks; this implies the current task should not continue. Is that intended? Is that the implementation strategy?
Separately, as written, this says when "a document" is frozen (any document, I guess), no worklet or dedicated worker agents should make forward progress. I think the intention was for the ones that "belong" to the document to not make forward progress, right?
There might be an easier way to do this, but off the top of my head, that would involve checking the owner set for frozen Documents, or for workers whose owner set contains frozen documents, recursively. (I feel like we should have some sort of owner document concept for workers, but at least this late in the day, I can't find it.)
This is precisely what Firefox does with its back/forward cache. If I have an infinitely running worker counting something it stops counting when it is put in the background and when I come back to the page it resumes where it left off.
I think I've more clearly specified which document and added a recursive definition of owning document.
Err; I guess it might not be clear if a worker is started in a shared worker. Ugh...
The lifecycle of workers and worklets was undefined in the specification. Add some formalization around dedicated workers and worklets. Still to be determined is what happens with shared workers and service workers.