Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Window post message steps' doesn't define which event loop is used for queuing a task #4653

Closed
smaug---- opened this issue May 23, 2019 · 1 comment · Fixed by #4917
Closed

Comments

@smaug----
Copy link

By just reading the algorithm it isn't clear which event loop is used for the task.
https://html.spec.whatwg.org/#window-post-message-steps
https://html.spec.whatwg.org/#queue-a-task

@gterzian
Copy link
Member

gterzian commented Jun 4, 2019

The algorihtm reads like the event-loop where targetWindow is running would be the implied event-loop, however I agree there is some un-clarity because the algorithm runs implicitely in the context of the "source window", as exemplified by Step 2 reading "Let incumbentSettings be the incumbent settings object", where the "incumbent settings object" is that of the source window, not the target.

So since the two communicating windows are potentially running in different similar-origin-window-agent, the algorithm actually falls in the "non-obvious category" mentioned at:

The exception is algorithms involving or specifying cross-agent communication (e.g., between a window and a worker); for those cases, the implied event loop concept must not be relied upon(..) (source: https://html.spec.whatwg.org/#implied-event-loop)

And "window-post-message-steps" should explicit ally include an event-loop in Step 8 where it queues a task.

Note that even if the two windows are same-origin, they could still be in different "similar-origin window agents" if they are part of different browsing-context group, see: https://html.spec.whatwg.org/#integration-with-the-javascript-agent-formalism:browsing-context-group (It seems one can learn something new everyday when it comes to this topic...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants