<?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>24706</bug_id>
          
          <creation_ts>2014-02-18 01:28:27 +0000</creation_ts>
          <short_desc>Clarify when setPointerCapture is supposed to work</short_desc>
          <delta_ts>2014-03-04 01:06:05 +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>Linux</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="Olli Pettay">bugs</reporter>
          <assigned_to name="Jacob Rossi [MSFT]">jrossi</assigned_to>
          <cc>public-pointer-events</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>100783</commentid>
    <comment_count>0</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-02-18 01:28:27 +0000</bug_when>
    <thetext>Currently it seems that one could use setPointerCapture for mouse pointer at any time. That would lead to various unexpected behaviors, like ads stealing pointers etc. I think mouse should be part of active pointers only between
down and up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100784</commentid>
    <comment_count>1</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-02-18 01:33:42 +0000</bug_when>
    <thetext>This is already the case (and for the reasons you cite). From the steps in Section 10.1:
&quot;2.If the pointer is not in the active buttons state, then terminate these steps.&quot;

The active buttons state is defined as:

&quot;The condition when a pointer has a non-zero value for the buttons property. For mouse, this is when the device has at least one button depressed. For touch, this is when there is physical contact with the digitizer. For pen, this is when the pen has physical contact with the digitizer.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100785</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-02-18 01:37:03 +0000</bug_when>
    <thetext>setPointerCapture

Sets pointer capture for the pointer identified by the argument pointerId to the element on which this method is invoked. Subsequent events for the pointer MUST always be targeted at this element. Throws a DOMException with the name InvalidPointerId when the provided the method&apos;s argument does not match any of the
_active_pointers_.


active pointer
Any touch contact, pen stylus, mouse cursor, or other pointer that can produce events. If it is possible for a given pointer (identified by a unique pointerId) to produce additional events, then that pointer is still considered active. Examples:
* _A_mouse_connected_to_the_device_is_always_active_.



So the spec isn&apos;t consistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100786</commentid>
    <comment_count>3</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-02-18 02:48:46 +0000</bug_when>
    <thetext>&quot;active pointers&quot; != &quot;active button state&quot;

Hence, two separate entries in the glossary.

active pointer - pointers that can still produce further events.

pointer in the active button state - pointer with evt.buttons &gt; 0.

So the *exception throws* (step 1) when you&apos;re trying to set capture to a pointer that can&apos;t produce pointer events (e.g. a pointerId you made up or a pointerId for a pointer that has gone away like a finger that left the screen).

The API *silently fails* (step 2) if you try to set it to a pointer that is just hovering.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100797</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-02-18 11:41:43 +0000</bug_when>
    <thetext>I&apos;m not talking about 10.1, but
setPointerCapture description. It talks about active pointers, not active button state.

10.1 looks fine, it is 
https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEvents.html#widl-Element-setPointerCapture-void-long-pointerId which is misleading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100813</commentid>
    <comment_count>5</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-02-18 19:05:50 +0000</bug_when>
    <thetext>Ah, I think I understand.  Would this description be better?

&quot;Sets pointer capture for the pointer identified by the argument pointerId to the element on which this method is invoked. Subsequent events for the pointer MUST always be targeted at this element. The pointer MUST be in its active buttons state for this method to be effective, otherwise it fails silently. Throws a DOMException with the name InvalidPointerId when the provided the method&apos;s argument does not match any of the active pointers.&quot;

Feel free to propose alternate text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101759</commentid>
    <comment_count>6</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-03-03 16:54:51 +0000</bug_when>
    <thetext>Sounds good.

Though, I wonder if non-active button state case should throw.
Maybe not, since that would reveal to other domains whether mouse button is down.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101804</commentid>
    <comment_count>7</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2014-03-04 01:06:05 +0000</bug_when>
    <thetext>Change made as discussed: 
https://dvcs.w3.org/hg/pointerevents/rev/747e4fe321d1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>