Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hasPointerCapture #127

Merged
merged 4 commits into from
Aug 2, 2016
Merged

Add hasPointerCapture #127

merged 4 commits into from
Aug 2, 2016

Conversation

RByers
Copy link
Contributor

@RByers RByers commented Aug 1, 2016

Fixes #121

Also cleans up a couple related definitions for easier linking.

@RByers
Copy link
Contributor Author

RByers commented Aug 1, 2016

Preview.
@patrickhlauke @NavidZ @scottgonzalez @teddink any feedback?

@@ -1002,6 +1006,7 @@
<li><a href="https://github.com/w3c/pointerevents/pull/34">Clarify the button value for mouse drag</a></li>
<li><a href="https://github.com/w3c/pointerevents/pull/24">Fix the touch-action processing model for zoom scenarios</a></li>
<li><a href="https://github.com/w3c/pointerevents/pull/13">Add direction-specific touch-action values</a> (pan-left, pan-right, pan-up, pan-down) and clarified behavior of existing pan-x and pan-y values.</li>
<li><a href="https://github.com/w3c/pointerevents/pull/127">Add hasPointerCapture</a></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the revision history is in reverse chronological order, so this should be at the very top of the list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, thanks.

@patrickhlauke
Copy link
Member

makes sense to me in principle. random pondering: would we also want a function that lets me query which pointer(s) the element i'm calling the function on has capture for? or is that getting a bit too convoluted?

<dt><dfn>hasPointerCapture</dfn></dt>
<dd>
<p>Indicates whether the element on which this method is invoked has <a>pointer capture</a> for the pointer identified by the argument <code>pointerId</code>. In particular, returns <code>true</code> if the <a>pending pointer capture target override</a> for <code>pointerId</code> is set to the element on which this method is invoked, and <code>false</code> otherwise.</p>
<div class="note">This method will return true immediately after a call to <a>setPointerCapture</a>, even though that element will not yet have received a <a>gotpointercapture event</a>. As a result it can be useful to detecting <a>implicit pointer capture</a> from inside of a <a>pointerdown event</a> listener.</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"useful to detecting" -> "useful for detecting" or "useful to detect"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

@scottgonzalez
Copy link
Member

makes sense to me in principle. random pondering: would we also want a function that lets me query which pointer(s) the element i'm calling the function on has capture for? or is that getting a bit too convoluted?

Do you have a scenario in mind where you would want to know this? We expect this would be used inside an event and you'd be querying against the single pointer ID for that event.

@patrickhlauke
Copy link
Member

Do you have a scenario in mind

admittedly no, i don't have a concrete use case in mind - which is probably a good indicator that this would be superfluous.

@RByers
Copy link
Contributor Author

RByers commented Aug 2, 2016

Do you have a scenario in mind

admittedly no, i don't have a concrete use case in mind - which is probably a good indicator that this would be superfluous.

Yeah I think the use cases even for this simple API are pretty limited. I think we should add it mainly as a hedge - it makes conceptual sense, has nice symmetry with the existing APIs and so adds very little overall complexity, and there's some reason to believe there may be non-zero value. But for anything more complex I think we should wait for more compelling use cases. Easy to add later though!

@RByers
Copy link
Contributor Author

RByers commented Aug 2, 2016

Suggestions applied, any other feedback?

@patrickhlauke
Copy link
Member

Looking good to me, fella

@RByers
Copy link
Contributor Author

RByers commented Aug 2, 2016

Ok, thanks! Let's land this now then (so I can more easily do the next step) - happy to take additional feedback after the fact.

@RByers RByers merged commit 8de360d into w3c:gh-pages Aug 2, 2016
@RByers RByers deleted the hasPointerCapture branch August 29, 2016 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants