<?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>25491</bug_id>
          
          <creation_ts>2014-04-28 14:19:19 +0000</creation_ts>
          <short_desc>createEvent and case significance</short_desc>
          <delta_ts>2014-05-05 15:51:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">erik.arvidsson</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>adrianba</cc>
    
    <cc>bugs</cc>
    
    <cc>garykac</cc>
    
    <cc>mike</cc>
    
    <cc>robin</cc>
    
    <cc>rwlbuis</cc>
    
    <cc>travil</cc>
    
    <cc>www-dom</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>104554</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-04-28 14:19:19 +0000</bug_when>
    <thetext>Blink/WebKit do not supports lowercase names for the interface argument.

http://dom.spec.whatwg.org/#dom-document-createevent

It therefore seems like the open web cannot depend on this and therefore we should be able to clean up the spec a bit.

Notice that engines all allow a trailing &apos;s&apos; on the interface name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104555</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-28 14:24:19 +0000</bug_when>
    <thetext>So we should only have these:

* CustomEvent	
* Event
* Events
* HTMLEvents
* MouseEvent
* MouseEvents
* UIEvent
* UIEvents

Right?

I.e. we won&apos;t add CustomEvents or HTMLEvent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104556</commentid>
    <comment_count>2</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-04-28 14:30:37 +0000</bug_when>
    <thetext>Looks correct to me.

It is not clear to me that this list is extensible by other specs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104565</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-28 15:16:55 +0000</bug_when>
    <thetext>The idea is for it to not be extensible. I realize we may have to add more names, it&apos;s currently conservative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104566</commentid>
    <comment_count>4</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-04-28 15:18:33 +0000</bug_when>
    <thetext>FWIW here are the current test results for this:

http://w3c.github.io/dom/test-results/all.html#test-file-50</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104576</commentid>
    <comment_count>5</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-04-28 17:27:38 +0000</bug_when>
    <thetext>What is wrong with the current spec which says case-insensitive comparison.


Engines allow trailing &apos;s&apos; on some old interface names.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104577</commentid>
    <comment_count>6</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-04-28 17:46:04 +0000</bug_when>
    <thetext>(In reply to Olli Pettay from comment #5)
&gt; What is wrong with the current spec which says case-insensitive comparison.

I was hoping we could remove this quirks to make things simpler since it is very unlikely that any web content depends on this.

&gt; Engines allow trailing &apos;s&apos; on some old interface names.

We still need to allow that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104662</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-04-29 07:07:16 +0000</bug_when>
    <thetext>In webdevdata data set 2013-09-01 102,000 pages I see the following instances that don&apos;t match those in comment 1 (there were 616 createEvents in total):

&quot;TouchEvent&quot;
&apos;KeyEvents&apos;
&quot;TouchEvent&quot;
&apos;MessageEvent&apos;
&quot;TouchEvent&quot;
&apos;TouchEvent&apos;
&quot;TouchEvent&quot;
&quot;TouchEvent&quot;
&quot;TouchEvent&quot;
&quot;TouchEvent&quot;
&quot;TouchEvent&quot;

So from this data it seems it doesn&apos;t need to be case-insensitive, but possibly some values should be added (TouchEvent?).

$ find . -type f -print0 | xargs -0 -P 4 -n 40 grep -E &quot;\.createEvent\s*\(\s*[\&quot;&apos;][a-zA-Z]+[\&quot;&apos;]&quot; &gt;&gt; ../createEvent.txt
$ grep -Ec &quot;\.createEvent\s*\(\s*[\&quot;&apos;][a-zA-Z]+[\&quot;&apos;]&quot; createEvent.txt
616
$ grep -Ev &quot;\.createEvent\s*\(\s*[\&quot;&apos;](CustomEvent|Event|Events|HTMLEvents|MouseEvent|MouseEvents|UIEvent|UIEvents)[\&quot;&apos;]&quot; createEvent.txt &gt; other-createEvent.txt</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104877</commentid>
    <comment_count>8</comment_count>
    <who name="Rob Buis">rwlbuis</who>
    <bug_when>2014-04-30 22:44:04 +0000</bug_when>
    <thetext>(In reply to Simon Pieters from comment #7)
&gt; In webdevdata data set 2013-09-01 102,000 pages I see the following
&gt; instances that don&apos;t match those in comment 1 (there were 616 createEvents
&gt; in total):
&gt; 
&gt; &quot;TouchEvent&quot;
&gt; &apos;KeyEvents&apos;
&gt; &quot;TouchEvent&quot;
&gt; &apos;MessageEvent&apos;
&gt; &quot;TouchEvent&quot;
&gt; &apos;TouchEvent&apos;
&gt; &quot;TouchEvent&quot;
&gt; &quot;TouchEvent&quot;
&gt; &quot;TouchEvent&quot;
&gt; &quot;TouchEvent&quot;
&gt; &quot;TouchEvent&quot;
&gt; 
&gt; So from this data it seems it doesn&apos;t need to be case-insensitive, but
&gt; possibly some values should be added (TouchEvent?).
&gt; 
&gt; $ find . -type f -print0 | xargs -0 -P 4 -n 40 grep -E
&gt; &quot;\.createEvent\s*\(\s*[\&quot;&apos;][a-zA-Z]+[\&quot;&apos;]&quot; &gt;&gt; ../createEvent.txt
&gt; $ grep -Ec &quot;\.createEvent\s*\(\s*[\&quot;&apos;][a-zA-Z]+[\&quot;&apos;]&quot; createEvent.txt
&gt; 616
&gt; $ grep -Ev
&gt; &quot;\.
&gt; createEvent\s*\(\s*[\&quot;&apos;](CustomEvent|Event|Events|HTMLEvents|MouseEvent|Mouse
&gt; Events|UIEvent|UIEvents)[\&quot;&apos;]&quot; createEvent.txt &gt; other-createEvent.txt

I have also seen examples that refer to &quot;KeyboardEvent&quot;:

https://developer.mozilla.org/en-US/docs/Web/API/event.initKeyEvent

Not sure how many websites out there use it though.

Also I wonder why there are tests to verify that createEvent(&quot;ProgressEvent&quot;) is not possible? Is it special and needs as test compared to the above?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104902</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-01 09:43:01 +0000</bug_when>
    <thetext>We should probably have tests for all event interfaces that are not supported in the legacy createEvent() API. Having one for ProgressEvent seems like a good start.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104904</commentid>
    <comment_count>10</comment_count>
    <who name="Rob Buis">rwlbuis</who>
    <bug_when>2014-05-01 11:05:43 +0000</bug_when>
    <thetext>(In reply to Anne from comment #9)
&gt; We should probably have tests for all event interfaces that are not
&gt; supported in the legacy createEvent() API. Having one for ProgressEvent
&gt; seems like a good start.

I was just surprised that ProgressEvent has its own test:
http://www.w3c-test.org/dom/events/ProgressEvent.html

It seems to me writing a test for every possible event interface out there is not practical, unless there is whitelisting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104905</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-01 11:15:46 +0000</bug_when>
    <thetext>Well we know all the event interfaces in the platform. And they do all need tests. Adding a line for whether or not it should work through the createEvent() API does not seem like a big deal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104913</commentid>
    <comment_count>12</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-05-01 17:24:05 +0000</bug_when>
    <thetext>(In reply to Erik Arvidsson from comment #0)
&gt; Blink/WebKit do not supports lowercase names for the interface argument.
&gt; 
&gt; http://dom.spec.whatwg.org/#dom-document-createevent
&gt; 
&gt; It therefore seems like the open web cannot depend on this and therefore we
&gt; should be able to clean up the spec a bit.
&gt; 
&gt; Notice that engines all allow a trailing &apos;s&apos; on the interface name.

IE _does_ support all lowercase names. For example:
  document.createEvent(&quot;mouseevent&quot;) 
gives you an instance of the MouseEvent constructor. 

Is &quot;clean up the spec&quot; really the motivation for this?

Even if the spec was tightened up to not allow this, I&apos;m not sure it really matters enough to risk any compatibility impact to change our implementation in the near future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104995</commentid>
    <comment_count>13</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-05-02 21:51:19 +0000</bug_when>
    <thetext>(In reply to Travis Leithead [MSFT] from comment #12)
&gt; Even if the spec was tightened up to not allow this, I&apos;m not sure it really
&gt; matters enough to risk any compatibility impact to change our implementation
&gt; in the near future.
I could say the same about Gecko.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105020</commentid>
    <comment_count>14</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-04 08:46:57 +0000</bug_when>
    <thetext>Fair, ASCII case-insensitive does not seem too bad given that the list of names is restricted and its a legacy API anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105045</commentid>
    <comment_count>15</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-05-05 15:51:44 +0000</bug_when>
    <thetext>Fair enough.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>