<?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>21749</bug_id>
          
          <creation_ts>2013-04-19 06:28:04 +0000</creation_ts>
          <short_desc>Setting a capture on an offshore element</short_desc>
          <delta_ts>2014-06-02 22:25:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>PointerEventsWG</product>
          <component>Pointer Events specification</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Jacob Rossi [MSFT]">jrossi</reporter>
          <assigned_to name="Jacob Rossi [MSFT]">jrossi</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>francois.remy.dev</cc>
    
    <cc>nekr.fabula</cc>
    
    <cc>public-pointer-events</cc>
    
    <cc>rbyers</cc>
          
          <qa_contact name="Pointer Events Bugzilla list">public-pointer-events-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>86383</commentid>
    <comment_count>0</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2013-04-19 06:28:04 +0000</bug_when>
    <thetext>From Francois Remy: http://lists.w3.org/Archives/Public/public-pointer-events/2013AprJun/0084.html


Here’s a test case for your consideration where, I believe, IE10 is distant from the official specification:


&lt;!doctype html&gt;
&lt;html onmspointerdown=&quot;eatPointer(event.pointerId)&quot; onmspointermove=&quot;if(event.button&gt;=0) console.log(event.clientX+&apos;,&apos;+event.clientY)&quot;&gt;
 &lt;head&gt;
  &lt;title&gt;Some pointer events test&lt;/title&gt;
  &lt;script&gt;
   var x = document.createElement(&quot;div&quot;);
   function eatPointer(id) {
    x.msSetPointerCapture(id); // will throw
   }
  &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;/body&gt;
&lt;/html&gt;


I believe the spec does not say the capture should fail, and therefore it should not. That would mean, however, that the capture may end up happening on a different window than the one the event was fired for, something which can be a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86384</commentid>
    <comment_count>1</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2013-04-19 06:28:24 +0000</bug_when>
    <thetext>This will be considered a CR issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102186</commentid>
    <comment_count>2</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-03-11 05:20:10 +0000</bug_when>
    <thetext>It&apos;s generally expected that DOM Events do not fire at orphaned elements. In particular, this is because you can&apos;t form a proper event path for dispatch.

However, because the capture APIs exists, I do see that this could lead a developer to believe capture could redirect events to an orphaned element. I&apos;d propose we add this exception to the spec.

My proposal is to add a step to the setPointerCapture() method that reads:

If the Element on which this method is invoked does not participate in its ownerDocument&apos;s tree, throw an exception with the name &quot;InvalidStateError&quot;.

Happy to let folks bikeshed on the specific exception to be thrown (IE currently, oddly enough, does not throw a named exception in this case). :-)

I&apos;m also not 100% confident on the spec language to denote an orphaned element. Will want to check with someone like AnneVK to confirm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102205</commentid>
    <comment_count>3</comment_count>
    <who name="Rick Byers">rbyers</who>
    <bug_when>2014-03-11 15:54:28 +0000</bug_when>
    <thetext>Note we agreed we also need to specify what happens when an element that has capture is removed.  I believe Jacob said he&apos;d provide more details on IE behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103859</commentid>
    <comment_count>4</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-04-15 05:11:44 +0000</bug_when>
    <thetext>It doesn&apos;t make sense to try to fire a lostpointercapture event in the case where the capture node is removed from the tree (events don&apos;t typically fire on nodes not in the tree). Capture should just get implicitly cleared for the pointer and hit testing resumes if the pointer is still producing events.

Given the proposed steps in comment 5 of bug 24971 [1], this can be accomplished by adding this to Section 10.3:

&quot;If the &apos;pointer capture target override&apos; is removed from the document tree, clear the &apos;pending pointer capture&apos; and &apos;pointer capture target override&apos; nodes. No lostpointercapture event is fired in this scenario.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103860</commentid>
    <comment_count>5</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-04-15 05:24:03 +0000</bug_when>
    <thetext>Rereading the minutes from 3/11 [1], the proposal was made that, when the capture node is removed from the tree, a lostpointercapture event be fired at the document.  That seems reasonable to me and it looks like there was consensus. Therefore, I propose we make the change described in Comment 2 plus add this to Section 10.3:

&quot;If the &apos;pointer capture target override&apos; node is removed from the document tree, clear the &apos;pending pointer capture&apos; and &apos;pointer capture target override&apos; nodes and fire a Pointer Event named lostpointercapture at the document.&quot;


[1] http://www.w3.org/2014/03/11-pointerevents-minutes.html#item03</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107158</commentid>
    <comment_count>6</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-06-02 22:25:21 +0000</bug_when>
    <thetext>Fixed:
https://dvcs.w3.org/hg/pointerevents/rev/734470902d30
Per resolution:
http://www.w3.org/2014/04/15-pointerevents-minutes.html#item04</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>