<?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>22641</bug_id>
          
          <creation_ts>2013-07-11 01:07:50 +0000</creation_ts>
          <short_desc>Normatively specify the order in which mouse events should fire</short_desc>
          <delta_ts>2013-10-23 13:51:14 +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>HISTORICAL - DOM3 Events</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gordon P. Hemsley">gphemsley</reporter>
          <assigned_to name="Travis Leithead [MSFT]">travil</assigned_to>
          <cc>annevk</cc>
    
    <cc>bugs</cc>
    
    <cc>garykac</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90624</commentid>
    <comment_count>0</comment_count>
    <who name="Gordon P. Hemsley">gphemsley</who>
    <bug_when>2013-07-11 01:07:50 +0000</bug_when>
    <thetext>When a mouse cursor is moved over an element, three events are fired (in some order):

* mouseover
* mouseenter
* mousemove

Possible orders include:

(1) mouseover -&gt; mouseenter -&gt; mousemove
(2) mousenter -&gt; mouseover -&gt; mousemove
(3) mousemove -&gt; mouseover -&gt; mouseenter

The spec suggests (non-normatively, AIUI) order (1). According to [1] (and some of my own testing), Gecko uses order (1). Opera uses order (2), which is IMO the most logical. IE uses order (3). Chrome and Safari could use either order (1) or order (2), as neither currently fires the mouseenter event. (I&apos;m told a patch has recently landed for Chrome support, but I haven&apos;t verified what order that implements.)

Interestingly enough, Opera seem to agree that the canonical order for the reverse is (4):

(4) mousemove -&gt; mouseout -&gt; mouseleave

As before, Chrome and Opera do not fire the mouseleave event, but otherwise maintain the order in (4). I didn&apos;t test IE.

The spec should say definitively, and not just in some examples or suggestions, what the canonical order should be.

[1] http://rodneyrehm.github.io/select-events/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90625</commentid>
    <comment_count>1</comment_count>
    <who name="Gordon P. Hemsley">gphemsley</who>
    <bug_when>2013-07-11 01:08:55 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Interestingly enough, Opera seem to agree that the canonical order for the
&gt; reverse is (4):
&gt; 
&gt; (4) mousemove -&gt; mouseout -&gt; mouseleave
&gt; 
&gt; As before, Chrome and Opera do not fire the mouseleave event, but otherwise
&gt; maintain the order in (4). I didn&apos;t test IE.

Wow, lots of typos. That first line should say &quot;Gecko and Opera&quot; and that second line should say &quot;Chrome and Safari&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90627</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-07-11 02:20:37 +0000</bug_when>
    <thetext>http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevent-event-order
and Gecko follows that.

Feel free to re-open if there is something unclear in the spec.
The order of mouseover/enter and mouseout/leave should be clear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90678</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-07-12 17:50:27 +0000</bug_when>
    <thetext>That isn&apos;t normative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90822</commentid>
    <comment_count>4</comment_count>
    <who name="Gordon P. Hemsley">gphemsley</who>
    <bug_when>2013-07-16 22:24:53 +0000</bug_when>
    <thetext>The Chrome implementation is here:

http://src.chromium.org/viewvc/blink?view=revision&amp;revision=153877

According to [1], Chrome seems to use order (2) from comment 0 for the entry (like Opera), but order (5) below for the exit:

(5) mouseleave -&gt; mouseout

(I didn&apos;t test this myself, so I don&apos;t know where &apos;mousemove&apos; falls into the order.)

[1]: http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/events/mouseenter-mouseleave-expected.txt?pathrev=153877</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95190</commentid>
    <comment_count>5</comment_count>
    <who name="Gary Kacmarcik">garykac</who>
    <bug_when>2013-10-23 13:51:14 +0000</bug_when>
    <thetext>I&apos;ve updated the text in the ED to mark the
   over - enter - move - out - leave
order as normative.

FF and IE both use the above order.

IE also has a single extra move before the over, which we are having them investigate. We believe that it is there to work around some issues with touch devices, but we&apos;ll track that as a separate issue if needed.

Safari 6.0.5 and Chrome 29 don&apos;t yet have enter/leave.


For reference/testing browser mouse events, I created:
https://dvcs.w3.org/hg/d4e/raw-file/tip/mouse-event-test.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>