<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25907</bug_id>
          
          <creation_ts>2014-05-28 07:43:48 +0000</creation_ts>
          <short_desc>Need initMessageEvent method because https://github.com/whatwg/dom/commit/333b03cf6454e803d6433673c33f1292821dac0a</short_desc>
          <delta_ts>2014-09-11 23:13:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#messageevent</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>crimsteam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106895</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-28 07:43:48 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html
Multipage: http://www.whatwg.org/C#messageevent
Complete: http://www.whatwg.org/c#messageevent
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Need initMessageEvent method because
https://github.com/whatwg/dom/commit/333b03cf6454e803d6433673c33f1292821dac0a

Posted from: 90.230.218.37 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 OPR/22.0.1471.40 (Edition Next)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106908</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-28 11:21:41 +0000</bug_when>
    <thetext>It seems Gecko successfully removed that method. Why should we add it? I don&apos;t think things need to make sense for document.createEvent() users.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106909</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-28 11:56:53 +0000</bug_when>
    <thetext>I mean sites that use document.createEvent(&apos;messageevent&apos;) will most likely break if initMessageEvent doesn&apos;t exist. But if Gecko&apos;s experience is that the breakage is small enough and Blink is successful with removing it also, then sure, but then I think there&apos;s no point in having document.createEvent(&apos;messageevent&apos;) in DOM either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106910</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-28 11:58:39 +0000</bug_when>
    <thetext>https://bugzilla.mozilla.org/show_bug.cgi?id=848294
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/H6lsGFqdy3Y</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106915</commentid>
    <comment_count>4</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-05-28 13:12:33 +0000</bug_when>
    <thetext>Its strange that this list was extended:
https://github.com/whatwg/dom/commit/333b03cf6454e803d6433673c33f1292821dac0a

Before we have only:
CustomEvent
Event
MouseEvent
UIEvent

Now:
CustomEvent
Event
KeyboardEvent
MessageEvent
MouseEvent
TouchEvent
UIEvent

Event, MouseEvent and UIEvent has defined init*methods in D2E spec so still may be acceptable. Now DOM (only for Event and CustomEvent) and D3E (draft) define some other init*methods:

https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#legacy-event-initializers

The level of support these methods by different browsers is really chaotic and probably the only constructors finally change this situation.

Without dedicated initializer we can only use universal initEvent() and dispatch this event, but in practice (without posibility set some properties) its nonsens.

And for TouchEvent we have this in spec. (https://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html#h_note_3):

&quot;Some user agents implement an initTouchEvent method as part of the TouchEvent interface. When this method is available, scripts can use it to initialize the properties of a TouchEvent object, including its TouchList properties (which can be initialized with values returned from createTouchList). The initTouchEvent method is not yet standardized, but it may appear in some form in a future specification.&quot;

So still without any details of how such a method should look like.

In general adding more events for document.createEvent() but without dedicated initializer method (which are supported by browsers in the same way) is realy strange, especially if the trend is to remove (or limit) init*methods and use only constructors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106918</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-28 13:33:23 +0000</bug_when>
    <thetext>They were added because zcorpan reported usage of them in the bug associated with that change. I don&apos;t think that necessarily means we have to add corresponding init*Event() methods back. If they can stay gone, that&apos;s fine. If that means we try removing &quot;messageevent&quot; as argument again, fine. This part of the specification is still a bit experimental as it&apos;s only been a few years since we switched away from this model.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106930</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-28 17:57:33 +0000</bug_when>
    <thetext>Is there any point to creating the event that way if it can&apos;t be initialised?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107107</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-06-02 05:55:41 +0000</bug_when>
    <thetext>https://github.com/search?l=javascript&amp;q=createevent+messageevent&amp;ref=searchresults&amp;type=Code 19,392
https://github.com/search?l=javascript&amp;q=initmessageevent&amp;ref=searchresults&amp;type=Code 19,393

It seems to me that sites that use createEvent(&apos;messageevent&apos;) always also use initMessageEvent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107144</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-06-02 18:15:33 +0000</bug_when>
    <thetext>That makes more sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109971</commentid>
    <comment_count>9</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-08-05 22:33:45 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8711.
Check-in comment: Add initMessageEvent()
http://html5.org/tools/web-apps-tracker?from=8710&amp;to=8711</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109984</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-08-06 08:26:35 +0000</bug_when>
    <thetext>&quot;in &lt;span&gt;MessagePort&lt;/span&gt;[]? portsArg&quot;

&quot;in &quot; has been obsolete for a long time.

&quot;&lt;span&gt;MessagePort&lt;/span&gt;[]&quot; should become &quot;sequence&amp;lt;&lt;span&gt;MessagePort&lt;/span&gt;&gt;&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111412</commentid>
    <comment_count>11</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-09-11 23:13:22 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8760.
Check-in comment: Fix IDL for initMessageEvent()
http://html5.org/tools/web-apps-tracker?from=8759&amp;to=8760</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>