w3c / requestidlecallback

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

Processing model will not make progress #7

Closed lawnsea closed 9 years ago

lawnsea commented 9 years ago

The Processing Model says the following:

  1. Let last_deadline be the last idle period deadline associated with the current event loop, or 0 if no previous deadline exists.
  2. If last_deadline is less than the current time:
    1. Wait until current time is equal to last_deadline.

The first time this is executed, there will be no last idle period deadline, so last_deadline will be 0. It will always be the case that 0 < performance.now(), thus we take the branch at step 2 and wait for the current time to equal last_deadline, which will never happen.

rmcilroy commented 9 years ago

Yes you're right, thanks for the fix.