This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Please refer to [1] for the motivation. It could be necessary and useful for a message port to know if the message port on other end is started or closed, so that the message port can decide if it needs to start or stop posting/receiving messages. For example, through the message port, an Music App can post its now-playing song info to the Lock Screen App and show it on the screen. However, the Lock Screen App still needs a dynamic way to know if the message port on the Music App side is still alive or not (message port can be dead when the Music App is killed). Otherwise, the Lock Screen App would misunderstand the message port on the Music App stops posting, but it is actually dead, thus failing to turn off the now-playing song info. We hope to add onstart/onclose event handlers in addition to onmessage, which will be triggered when: 1. the message port on the other end explicitly calls start()/close() or 2. the message port is killed and the system will be in chage of firing onstart/onclose events. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=915880
This is my first time firing bugs here. Please correct me if the components, assignee or anything are wrong. Thanks!
This is not a DOM bug, but an HTML bug. However, it's WONTFIX as far as I know because we don't want to make garbage collection observable.
Indeed. Silly me, didn't think about GC behavior in in https://bugzilla.mozilla.org/show_bug.cgi?id=915880
(In reply to Anne from comment #2) > This is not a DOM bug, but an HTML bug. However, it's WONTFIX as far as I > know because we don't want to make garbage collection observable. Sorry I don't get it. Could you please elaborate more about "garbage collection observable"?
I posted about this to the whatwg list.
(In reply to Gene Lian [:gene] from comment #4) > > Sorry I don't get it. Could you please elaborate more about "garbage > collection observable"? Garbage collection: https://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Different browsers have different algorithms, and we don't want to expose the specifics of those algorithms, since once a page relies on a particular behaviour, it'd constrain all future innovation in this space. (In reply to Ehsan Akhgari [:ehsan] from comment #5) > I posted about this to the whatwg list. Please either file bugs or send feedback to the list, but not both. It gets very confusing when we are talking about things in both places. I'm going to close this bug since there's outstanding feedback on the topic on the list.
(In reply to Ian 'Hixie' Hickson from comment #6) > Different browsers have different algorithms, and we don't want to expose > the specifics of those algorithms, since once a page relies on a particular > behaviour, it'd constrain all future innovation in this space. (Which is why PortCollection should be removed from the spec until some better API is designed. bug 23412)