Re: [html-tests] Promise + event loop integration (#3454)

@bzbarsky I've read the FF bug, and read through FF code. That bug talks about attempting to bring FF promise handling closer to the spec by integrating it with MutationObserver microtasks.

My test case here has narrower scope. The idea is that developers will use Promises for scheduling, and it would be great if this use case worked well cross-browser. 
A common scheduling code pattern is:
- do something inside rAF, and schedule a Promise to be executed immediately after rAF completes, but before paint.

FF does not execute promises immediately after rAF. It paints, dispatches a task, then runs Promise::PerformMicroTaskCheckpoint

I've looked at FF code. FF runs Promise::PerformMicroTaskCheckpoint in two places:
nsGlobalWindow::RunTimeoutHandler
XPCJSRuntime::BeforeProcessTask

I think that adding another call to PerformMicroTaskCheck to nsRefreshDriver::RunFrameRequestCallbacks would fix this bug, and that this would be a worthy patch until full MutationObserver queue integration.


View on GitHub: https://github.com/w3c/web-platform-tests/pull/3454#issuecomment-239547341

Received on Friday, 12 August 2016 20:07:29 UTC