<?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>126711</bug_id>
          
          <creation_ts>2014-01-09 12:17:16 -0800</creation_ts>
          <short_desc>mouseleave event fires for leaving elements inside the shadow DOM of input[type]=range</short_desc>
          <delta_ts>2014-03-19 10:31:17 -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>UI Events</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Xabier Rodríguez Calvar">calvaris</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>966017</commentid>
    <comment_count>0</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2014-01-09 12:17:16 -0800</bug_when>
    <thetext>Given the following HTML code:

&lt;html&gt;
  &lt;body&gt;
    &lt;div id=&quot;outer&quot; style=&quot;height: 300px; width=300px; background-color: green;&quot;&gt;
      &lt;input id=&quot;inner&quot; type=&quot;range&quot;&gt;&lt;/input&gt;
    &lt;/div&gt;
    &lt;p id=&quot;demo&quot;&gt;Run event to see this text changed.&lt;/p&gt;
    &lt;p id=&quot;debug&quot;&gt;debug.&lt;/p&gt;
    &lt;div&gt;
      &lt;pre&gt;
        &lt;script&gt;
var i = 0;
function myCallback(event) {
    inner = document.getElementById(&quot;inner&quot;);
    debug = document.getElementById(&quot;debug&quot;);
    debug.innerHTML = &quot;event target id: &quot; + event.relatedTarget.id + &quot;, inner id: &quot; + inner.id;
    if (event.relatedTarget != inner) {
        demo = document.getElementById(&quot;demo&quot;);
        demo.innerHTML = ++i;
    }
}

outer = document.getElementById(&quot;outer&quot;);
outer.addEventListener(&apos;mouseout&apos;, myCallback, false);
        &lt;/script&gt;
      &lt;/pre&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;



  &lt;body&gt;
    &lt;div id=&quot;outer&quot; style=&quot;height: 300px; width=300px; background-color: green;&quot;&gt;
      &lt;input id=&quot;inner&quot; type=&quot;range&quot;&gt;&lt;/input&gt;
    &lt;/div&gt;
    &lt;p id=&quot;demo&quot;&gt;Run event to see this text changed.&lt;/p&gt;
    &lt;p id=&quot;debug&quot;&gt;debug.&lt;/p&gt;
    &lt;div&gt;
      &lt;pre&gt;
        &lt;script&gt;
var i = 0;
function myCallback(event) {
    inner = document.getElementById(&quot;inner&quot;);
    debug = document.getElementById(&quot;debug&quot;);
    debug.innerHTML = &quot;event target id: &quot; + event.relatedTarget.id;
    if (event.relatedTarget != inner) {
        demo = document.getElementById(&quot;demo&quot;);
        demo.innerHTML = ++i;
    }
}

outer = document.getElementById(&quot;outer&quot;);
outer.addEventListener(&apos;mouseout&apos;, myCallback, false);
        &lt;/script&gt;
      &lt;/pre&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;

Steps:

1) Open the the code in the browser
2) Move the mouse to the green div
3) Move the mouse out of the green div
4) Move it in again
5) Move it to the input range (out of the thumb)
6) Move it onto the thumb

Chromium outcome:

5) Number not increased and debug is &quot;event target id: inner&quot;
6) Number not increased and debug remains &quot;event target id: inner&quot;

WebKitGTK+:

5) Number increased and debug is &quot;event target id:&quot;
6) Number not increased and debug changes to &quot;event target id: inner&quot;

For some reason in WebKitGTK+ we are not handling those events correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966018</commentid>
    <comment_count>1</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2014-01-09 12:18:25 -0800</bug_when>
    <thetext>(In reply to comment #0)

It looks like I pasted too much code, the good one is:

&lt;html&gt;
  &lt;body&gt;
    &lt;div id=&quot;outer&quot; style=&quot;height: 300px; width=300px; background-color: green;&quot;&gt;
      &lt;input id=&quot;inner&quot; type=&quot;range&quot;&gt;&lt;/input&gt;
    &lt;/div&gt;
    &lt;p id=&quot;demo&quot;&gt;Run event to see this text changed.&lt;/p&gt;
    &lt;p id=&quot;debug&quot;&gt;debug.&lt;/p&gt;
    &lt;div&gt;
      &lt;pre&gt;
        &lt;script&gt;
var i = 0;
function myCallback(event) {
    inner = document.getElementById(&quot;inner&quot;);
    debug = document.getElementById(&quot;debug&quot;);
    debug.innerHTML = &quot;event target id: &quot; + event.relatedTarget.id + &quot;, inner id: &quot; + inner.id;
    if (event.relatedTarget != inner) {
        demo = document.getElementById(&quot;demo&quot;);
        demo.innerHTML = ++i;
    }
}

outer = document.getElementById(&quot;outer&quot;);
outer.addEventListener(&apos;mouseout&apos;, myCallback, false);
        &lt;/script&gt;
      &lt;/pre&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966271</commentid>
    <comment_count>2</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2014-01-10 00:28:36 -0800</bug_when>
    <thetext>Fiddle: http://jsfiddle.net/eE563/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966296</commentid>
    <comment_count>3</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2014-01-10 02:04:45 -0800</bug_when>
    <thetext>It also happens in Mac, so I assume the bug is crossplatform, removing [GTK] label.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966301</commentid>
    <comment_count>4</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2014-01-10 02:33:08 -0800</bug_when>
    <thetext>According to the shadow dom, the range is composed by three divs, being the innest one the thumb and that&apos;s the one signalling itself as id=&quot;inner&quot; in the example. Anyway, one of the other two divs must be firing that other problematic event that shouldn&apos;t be happening because we shouldn&apos;t be firing those events for things in the shadow dom, I guess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966467</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2014-01-10 11:03:28 -0800</bug_when>
    <thetext>Could you precisely explain what the problem is, and what the expected outcome is?  How &quot;incorrect&quot; is it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966685</commentid>
    <comment_count>6</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2014-01-10 16:44:02 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Could you precisely explain what the problem is, and what the expected outcome is?  How &quot;incorrect&quot; is it?

Sorry, I should have said that I consider the Chromium one as the correct. The explanation can be read partially in comment 4, but summing up: if you read the event.relatedTarget when going out from the green div to the range input, you should be receiving the range input. That isn&apos;t happening. From the DOM POV the range input should behave as a single component and it is not. You receive one event when &apos;leaving&apos; to the range and another when &apos;leaving&apos; to the range thumb instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>966687</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2014-01-10 16:47:51 -0800</bug_when>
    <thetext>Thanks for the clarification.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>