Closed rmcilroy closed 8 years ago
@dbaron, @igrigorik, @toddreifsteck, please take a look and let me know if you have any comments, thanks!
@rmcilroy Curious why you dropped the optional
from the timeout
in IdleRequestOptions
.
Also, the "who's timeout occurred before" seems rather less precise than it ought to be; it should probably say explicitly what timeout
(if present) is added to. (Also, "who's" -> "whose".)
@rmcilroy Curious why you dropped the optional from the timeout in IdleRequestOptions.
Apparently 'optional' is not allowed in a dictionary in IDL (dictionary properties are optional by default), so this was fixing an IDL bug (see https://github.com/w3c/requestidlecallback/pull/30#issuecomment-148805790).
Also, the "who's timeout occurred before" seems rather less precise than it ought to be; it should probably say explicitly what timeout (if present) is added to. (Also, "who's" -> "whose".)
Done in the latest patch.
Is this change good to land?
Good point! Added a line in the latest patch to ensure we only call the timeout callback algorithm if the handle is still in the list of callbacks (it would get removed if it was run during an idle period, or explicitly cancelled)
Actually, I just realized, the timeout callback algorithm already does this check, so the additional check at that line isn't really necessary. We could either keep both checks (for clarity) or remove on or the other, whichever you think makes things clearer.
Ahh, I completely missed the point of the first step there.. I guess there is no reason to keep it in both places. Is there any merit in doing that check in the new location, instead of after the task is queued? I'll defer to your judgement here.
I removed the change for the timeout check in the requestIdleCallback algorithm - I think it makes more sense to do it where it originally was in the timeout algorithm.
sg. With that resolved, LGTM. @dbaron @toddreifsteck any other feedback on this?
@dbaron @toddreifsteck can you guys please review this?
LGTM
Addresses some of #31