On 21/07/15 15:31, Josh Matthews wrote:
This appears to satisfy the requirements of the spec (c.f. https://html.spec.whatwg.org/multipage/webappapis.html#processing-model-9 & https://html.spec.whatwg.org/multipage/webappapis.html#task-source). My main concern is the loss of deterministic ordering here - with a single event queue, any event that is queued before another is guaranteed to run before it as well. In this new model, if two events are added to different queues in the same document, they could run in any order. This could be fixed by always running the oldest event available in any single document's queue, but are there dangers of out-of-order events between same-origin documents? Thoughts?
Per the conversation we had on irc, I think that the spec allows the current model but not your proposed design (see [1]). I believe the proposed model has observable changes that likely have a compat. impact e.g. given a page with two subframes A and B, a script on the parent that does A.postMessage(1); A.postMessage(2); B.postMessage(3) can currently rely on the messages being received in the order 1,2,3 whereas that is not a possible ordering in the event-loop-per-document design. Therefore my initial reaction is that this is unlikely to work. However it might be worthwhile checking what IE does here as I vaugely remember they have relatively well-isolated iframes (but it's several years since I tested it, so I don't remember any details).
[1] https://html.spec.whatwg.org/multipage/webappapis.html#event-loop ("There must be at least one browsing context event loop per user agent, and at most one per unit of related similar-origin browsing contexts.")
_______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo