w3c / requestidlecallback

Cooperative Scheduling of Background Tasks
https://w3c.github.io/requestidlecallback/
Other
50 stars 19 forks source link

"the Window object's active document" makes no sense #25

Closed bzbarsky closed 8 years ago

bzbarsky commented 8 years ago

This spec talks about "the Window object's active document." There is no such thing. A browsing context has an active document. A Window has some set of documents associated with it, with no way to pick out the really relevant one that I can see. I thought I saw some spec trying to deal with this by talking about a Window's "most recent document" or something like that, but I don't recall which spec that was...

Need to coordinate with the HTML spec to define the right thing here.

igrigorik commented 8 years ago

@annevk @domenic what's the right concept for us to use here?

domenic commented 8 years ago

In the definition of requestIdleCallback below, references to the Document object [dom] are to be taken to be references to the Window object's active document.

This should go away

Each Document has: ... Let document be the Window object's active document object.

Why not just associate these things with Windows, instead of Documents? Then you can use "this Window object's idle callback identifier" etc. That is what setTimeout does, for the list of active timers.


If you do stick with Documents, I think you want "this Window object's newest Document object", similar to how window.document is defined. That links to "each Document in a browsing context is associated with a Window object".

igrigorik commented 8 years ago

Why not just associate these things with Windows, instead of Documents?

That would, indeed, simplify things. @rmcilroy any objections?

rmcilroy commented 8 years ago

Nope, no objections, that would indeed makes sense.

igrigorik commented 8 years ago

@domenic @rmcilroy first run at it: https://github.com/w3c/requestidlecallback/pull/38 - please take a look.