Defer initial inputsourcechange event till after the promise resolves#1002
Conversation
| <dd> Append |session| to the [=list of inline sessions=]. | ||
| </dl> | ||
| 1. [=/Resolve=] |promise| with |session|. | ||
| 1. [=Queue a task=] to perform the following steps: |
There was a problem hiding this comment.
Does the Resolve step wait until the task is done?
There was a problem hiding this comment.
It's the other way around, resolve uses a microtask, and queue a task uses a regular task, so we can guarantee that the callback attached in requestSession(..).resolve(callback) will execute before the task below does.
There was a problem hiding this comment.
ok. Resolve actually calls the then function. I think this looks good!
There was a problem hiding this comment.
Yep!
er, i should have written then instead of resolve in my comment above, but you get the idea
toji
left a comment
There was a problem hiding this comment.
LGTM! I think this is a pretty clean way of resolving the timing ambiguities.
|
@klausw you might want to ensure the impl in chrome does this deferring properly |
Fixes #961
As mentioned in #961, this is not the only way to fix this issue; the other way to fix it involves changing the spec so that
inputSourcescan start off non-null, however that involves ensuring the ecosystem respects that as well.r? @toji
cc @cabanier