[Bug 13686] Remove the special case from onmessage (to call start())

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13686

Jacob Rossi [MSFT] <jrossi@microsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |jrossi@microsoft.com
         Resolution|WONTFIX                     |

--- Comment #14 from Jacob Rossi [MSFT] <jrossi@microsoft.com> 2011-09-07 20:20:04 UTC ---
(In reply to comment #12)
> EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
> satisfied with this response, please change the state of this bug to CLOSED. If
> you have additional information and would like the editor to reconsider, please
> reopen this bug. If you would like to escalate the issue to the full HTML
> Working Group, please add the TrackerRequest keyword to this bug, and suggest
> title and text for the tracker issue; or you may create a tracker issue
> yourself, if you are able to do so. For more details, see this document:
>    http://dev.w3.org/html5/decision-policy/decision-policy.html
> 
> Status: Rejected
> Change Description: no spec change
> Rationale: I disagree. I think that if we _don't_ have this in the spec,
> tutorials will be forced to tell people over and over "don't forget to call
> start(), man, isn't it lame that it isn't called automatically". They don't
> have to say anything at all at the moment. I don't think anyone will even
> realise anything magical is happening here unless they are advanced authors
> registering multiple event listeners, and then they'll be happy that it doesn't
> also happen in that case.

>> you almost certainly are doing something more complicated than
>> just hooking a listener and using the port

I do not believe that the use of addEventListener necessarily indicates
advanced developers--it's what we're encouraging developers use as *the best*
way to subscribe to events. 

You make the argument that not automatically starting the port makes the
developer model difficult. I agree, but I think that applies to
addEventListener too (I see the same "isn't it lame that it isn't called
automatically" appearing in a tutorial wrt addEventListener). 

Events are queued, so I don't really buy the need for more granularity over
when you start the port when using addEventListener versus the property.
Additionally, if my script isn't the only one registering for the event, then I
don't want to have to worry about whether someone has already started the port
or not.

I agree with Olli's statement and think it's a bigger disservice to the
developer model to have one registration method work different than another. 

Special casing an event property may be easier to spec, but it's not
necessarily any easier to implement. We have generic implementation that allows
us to designate a property as an event registration method. Then it just falls
out that setting that property registers a listener for the bubble phase.
Special casing onmessage isn't really any easier to implement than also special
casing addEventListener. 

In fact, it's probably easiest to implement (at least for IE) and the most
straight-forward for web developers if the spec says that you should start the
port upon registration of the first message event listener. Then you don't even
have to spec something special for addEventListener or onmessage.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Wednesday, 7 September 2011 20:20:07 UTC