This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25414 - BroadcastChannel: dispatch order seems unnecessarily complex
Summary: BroadcastChannel: dispatch order seems unnecessarily complex
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-22 18:03 UTC by Jonas Sicking (Not reading bugmail)
Modified: 2014-05-01 17:58 UTC (History)
2 users (show)

See Also:


Attachments

Description Jonas Sicking (Not reading bugmail) 2014-04-22 18:03:48 UTC
It should be possible to implement BroadcastChannel by simply sorting BroadcastChannels in creation order within a particular process.
Comment 1 Ian 'Hixie' Hickson 2014-04-22 18:20:52 UTC
Given that the different processes have different event loops, in what sense does the current ordering not allow the implementation strategy you describe?
Comment 2 Jonas Sicking (Not reading bugmail) 2014-04-22 18:29:47 UTC
The following text:

"All BroadcastChannel objects whose BroadcastChannel settings objects specify a responsible document contained within a particular top-level browsing context must be sorted in the same relative order as the order that those Document objects are listed in the list of the descendant browsing contexts for the active document of that top-level browsing context."

This requires that BroadcastChannel objects coming from the same top-level browsing context, but from different Documents, have a particular sorted order. This order does not always match the creation order.

I.e. I can't make all BroadcastChannels from the same process simply be sorted in creation order.
Comment 3 Ian 'Hixie' Hickson 2014-04-29 23:42:05 UTC
Ah, yeah. The idea here would be that for each browsing context you would just walk the tree of frames and handle each one in turn. Is it easier to do it for all frames at once? I don't mind either way; this was just intended to make it easier to implement. (Same with the order of auxiliary windows — the idea was to match the order that the windows would have internally, assuming they are ordered in creation order.)
Comment 4 Jonas Sicking (Not reading bugmail) 2014-05-01 00:20:22 UTC
At least in gecko it would indeed be easier to do for all frames at once. At least all frames in the same eTLD+1 since those are guaranteed to be in the same process.
Comment 5 Ian 'Hixie' Hickson 2014-05-01 17:56:42 UTC
Ok! Well, since you're the first implementor, you get to pick the order. :-)
Comment 6 contributor 2014-05-01 17:58:47 UTC
Checked in as WHATWG revision r8593.
Check-in comment: Change the sort order for broadcast channel messages to be easier to implement
http://html5.org/tools/web-apps-tracker?from=8592&to=8593