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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>68791</bug_id>
          
          <creation_ts>2011-09-25 23:56:23 -0700</creation_ts>
          <short_desc>[meta] Remove init*Event methods</short_desc>
          <delta_ts>2017-08-04 06:04:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>71338</dependson>
    
    <dependson>71340</dependson>
    
    <dependson>71344</dependson>
    
    <dependson>71374</dependson>
    
    <dependson>71636</dependson>
    
    <dependson>71687</dependson>
    
    <dependson>71689</dependson>
    
    <dependson>71691</dependson>
    
    <dependson>71698</dependson>
    
    <dependson>71701</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne van Kesteren">annevk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>dglazkov</cc>
    
    <cc>dominicc</cc>
    
    <cc>haraken</cc>
    
    <cc>haraken</cc>
    
    <cc>ian</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>luchellesheldon</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>472984</commentid>
    <comment_count>0</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2011-09-25 23:56:23 -0700</bug_when>
    <thetext>Now we have event constructors the init*Event methods on recently introduced Event interfaces can be removed. It is no longer correct to support them for CustomEvent, ErrorEvent, ProgressEvent, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473250</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-09-26 11:45:18 -0700</bug_when>
    <thetext>Is the idea here that no one has shipped these APIs yet so author aren&apos;t using them?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473253</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-09-26 11:47:43 -0700</bug_when>
    <thetext>We can&apos;t really remove them, they are already used widely in the wild :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473255</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-09-26 11:49:17 -0700</bug_when>
    <thetext>http://codesearch.google.com/codesearch#search/&amp;q=init(Custom%7CError%7CMouse%7CProgress)Event%20lang:js&amp;type=cs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473275</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-09-26 12:04:03 -0700</bug_when>
    <thetext>This search comes up clean:

http://codesearch.google.com/codesearch#search/&amp;q=init(Error%7CProgress)Event%20lang:js&amp;type=cs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473277</commentid>
    <comment_count>5</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-09-26 12:06:36 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; This search comes up clean:
&gt; 
&gt; http://codesearch.google.com/codesearch#search/&amp;q=init(Error%7CProgress)Event%20lang:js&amp;type=cs

We can certainly try to kill them :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473333</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-26 13:09:05 -0700</bug_when>
    <thetext>Obviously the ancient ones like initMouseEvent aren&apos;t going anywhere.

But many of the new ones haven&apos;t even shipped in multiple browsers yet. Those are the ones that should go, e.g. almost all the ones in the HTML spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473339</commentid>
    <comment_count>7</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-09-26 13:27:27 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Obviously the ancient ones like initMouseEvent aren&apos;t going anywhere.
&gt; 
&gt; But many of the new ones haven&apos;t even shipped in multiple browsers yet. Those are the ones that should go, e.g. almost all the ones in the HTML spec.

SGTM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473654</commentid>
    <comment_count>8</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-09-26 20:10:46 -0700</bug_when>
    <thetext>Purging initErrorEvent and initProgressEvent sounds great (probably can&apos;t with Custom, since I think some YUI stuff use it).  There are probably some other ones we can kill as well (perhaps some of the ones we have added in the last few months, Composition?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473655</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-09-26 20:14:12 -0700</bug_when>
    <thetext>CloseEvent?  MediaSteamEvent? WebGLContextEvent? PopStateEvent? PageTransisionEvent? The webkit version of MessageEvent?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494293</commentid>
    <comment_count>10</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-11-01 16:38:13 -0700</bug_when>
    <thetext>Assuming we want to remove separate init*Event methods in separate patches, to make it easier to roll individual methods back in if it turns out they are used in the wild.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494383</commentid>
    <comment_count>11</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-11-01 18:16:35 -0700</bug_when>
    <thetext>Should these events be removed from EventFactory.in at the same time? createEvent(&apos;ProgressEvent&apos;) does not seem useful without initProgressEvent, for example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494736</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-11-02 10:59:13 -0700</bug_when>
    <thetext>&gt; Should these events be removed from EventFactory.in at the same time? createEvent(&apos;ProgressEvent&apos;) does not seem useful without initProgressEvent, for example.

That will effect the JS wrapper selection as well.  When the IDL says Event, the bindings actually return a wrapper for the actual type of the Event.  EventFactory.in provides an enumeration of all the event interfaces.

IMHO, there isn&apos;t anything to be gained by preventing these objects from being created by createEvent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494757</commentid>
    <comment_count>13</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-11-02 11:29:28 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; That will effect the JS wrapper selection as well.  When the IDL says Event, the bindings actually return a wrapper for the actual type of the Event.  EventFactory.in provides an enumeration of all the event interfaces.
&gt; 
&gt; IMHO, there isn&apos;t anything to be gained by preventing these objects from being created by createEvent.

Got it. I will leave createEvent alone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>496910</commentid>
    <comment_count>14</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-11-06 16:05:56 -0800</bug_when>
    <thetext>I have taken a look at all of the events in WebKit, the relevant specs, and whether the events are used (using Code Search.) Here is what I think we should do. For convenience I am just going to mention the event interface name, but I mean init*Event:

These are ones we already removed:

ErrorEvent (bug 71338), MediaStreamEvent (bug 71344), TrackEvent (never implemented)

I think we can remove these:

BeforeLoadEvent (bug 71636), CloseEvent (bug 71374), OverflowEvent, PageTransitionEvent, PopStateEvent, ProgressEvent (bug 71340), WebKitAnimationEvent, WebKitTransitionEvent

We *might* be able to remove these:

StorageEvent—used by Unhosted; HashChangeEvent—used by Ample SDK.

I think we can remove these, but we need to file bugs against the specs to get the specs updated:

AudioProcessingEvent, DeviceMotionEvent, DeviceOrientationEvent, WebGLContextEvent

And for completeness, these are the untouchables—we can’t remove these, it seems hordes of people use them:

CompositionEvent, CustomEvent (YUI), Event, KeyboardEvent, MessageEvent, MouseEvent, MutationEvent, TextEvent, TouchEvent, UIEvent, WheelEvent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>527139</commentid>
    <comment_count>15</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-12-25 21:58:38 -0800</bug_when>
    <thetext>On more careful inspection I am not sure whether YUI uses initCustomEvent. It has a method of its own, initCustomEvent*s*, that is unrelated but shows up in casual searches.

However initCustomEvent is used in smaller frameworks such as Ample, JSDOM and &quot;XBL&quot; &lt;http://codesearch.google.com/#search/&amp;q=initCustomEvent%5B%5Es%5D%20lang:js&amp;type=cs&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1335226</commentid>
    <comment_count>16</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2017-08-04 06:04:32 -0700</bug_when>
    <thetext>Fixed per dependencies.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>