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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define active document for the active pointers #300

Merged
merged 3 commits into from Nov 4, 2019
Merged

Conversation

NavidZ
Copy link
Member

@NavidZ NavidZ commented Aug 23, 2019

Limit the pointer capture API scope to only work
when it is called on the document who got the
last event in the given pointer stream.

Fixes #291


馃挜 Error: 500 Internal Server Error 馃挜

PR Preview failed to build. (Last tried on Nov 4, 2019, 9:35 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

馃毃 Spec Generator - Spec Generator is the web service used to build specs that rely on ReSpec.

馃敆 Related URL

锟絒33m馃摗 HTTP Error 520:锟絒39m 锟絒36mhttps://rawcdn.githack.com/w3c/pointerevents/506fdd165b523f5b2cf02402ffa63812cce3e10d/index.html锟絒39m

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

Limit the pointer capture API scope to only work
when it is called on the document who got the
last event in the given pointer stream.
@NavidZ
Copy link
Member Author

NavidZ commented Aug 23, 2019

@smaug---- @graouts
I feel like it might be too wordy. But I guess PointerEvent spec is not that algorithmic. I tried to spec this one more algorithmic.

Just something to remember regarding an embedded iframe. When the pointer moves on top of an embedded iframe the embedder will receive one 'pointerover' event on the iframe element and never receives a 'pointerleave' while the pointer is on top of the embedded iframe. That's why I didn't rely on the boundary events in this pull request.

index.html Outdated
</ul>

<p>If this is a <code>pointerdown</code> event, the associated device is a direct manipulation device and the target is an <code>Element</code>, then <a href="#setting-pointer-capture">set pointer capture</a> for this <code>pointerId</code> to the target element as described in <a>implicit pointer capture</a>.
<p>If the <var>eventTarget</var> is an <code>Element</code>, then let <var>targetDocument</var> be <var>eventTarget</var>'s <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> [[!DOM4]].
Otherwise, <var>eventTarget</var> is a <code>Window</code> object,
Copy link
Contributor

Choose a reason for hiding this comment

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

When can the eventTarget be Window?

Copy link

Choose a reason for hiding this comment

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

That's a good question. I don't know that this could ever happen due to pointer capture.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have been thinking about this and couldn't come up with any case. As a matter of fact Chrome code certainly never targets the window directly. Note that Window will be in the propagation path but never is the target if the event.
I have added the window case for the case of completion as it was different to get the document from a window object. But I'll remove it to be more precise as we know it doesn't happen at least with the current state of the things.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also pointer capture cannot cause that. As pointer capture API is from the Element idl and window doesn't inherit from that in anyway.

Copy link

@graouts graouts left a comment

Choose a reason for hiding this comment

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

The question about whether an event may be targeted at a Window object is a good one. I think once it is answered and the drive-by changes are moved to a dedicated PR, this will be good. I like the new text.

index.html Outdated
@@ -391,17 +393,24 @@ <h2>The <dfn>Primary Pointer</dfn></h2>
<section>
<h2>Firing events using the <code>PointerEvent</code> interface</h2>
<p>To <dfn>fire a pointer event named e</dfn> means to <dfn>fire an event named e</dfn> as defined in [[!DOM4]] with an event using the <a>PointerEvent</a> interface whose attributes are set as defined in <a href="#pointerevent-interface"><code>PointerEvent</code> Interface</a> and <a href="#attributes-and-default-actions">Attributes and Default Actions</a>.</p>
<p>If the event is not <code>gotpointercapture</code> or <code>lostpointercapture</code>, run <a href="#process-pending-pointer-capture">Process Pending Pointer Capture</a> steps for this <code>PointerEvent</code>.
<p>If the <var>event</var>'s <code>type</code> is not <code>gotpointercapture</code> or <code>lostpointercapture</code>, run <a href="#process-pending-pointer-capture">Process Pending Pointer Capture</a> steps for this <code>PointerEvent</code>.
Copy link

Choose a reason for hiding this comment

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

Sorry to be a stickler, but this change, while welcome, is unrelated to issue #291.

index.html Outdated

<p>The target object at which the event is fired is determined as follows:
<p>The <var>eventTarget</var> object at which the <var>event</var> is fired is determined as follows:
Copy link

Choose a reason for hiding this comment

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

Same for this change, this should be in a separate PR.

index.html Outdated
<li>If the <a>pointer capture target override</a> has been set for the pointer, set the target to <a>pointer capture target override</a> object.</li>
<li>Otherwise, set the target to the object returned by normal hit test mechanisms (out of scope for this specification).</li>
<li>If the <a>pointer capture target override</a> has been set for the pointer, set the <var>eventTarget</var> to <a>pointer capture target override</a> object.</li>
<li>Otherwise, set the <var>eventTarget</var> to the object returned by normal hit test mechanisms (out of scope for this specification).</li>
Copy link

Choose a reason for hiding this comment

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

Same for this change.

index.html Outdated
</ul>

<p>If this is a <code>pointerdown</code> event, the associated device is a direct manipulation device and the target is an <code>Element</code>, then <a href="#setting-pointer-capture">set pointer capture</a> for this <code>pointerId</code> to the target element as described in <a>implicit pointer capture</a>.
<p>If the <var>eventTarget</var> is an <code>Element</code>, then let <var>targetDocument</var> be <var>eventTarget</var>'s <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> [[!DOM4]].
Otherwise, <var>eventTarget</var> is a <code>Window</code> object,
Copy link

Choose a reason for hiding this comment

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

That's a good question. I don't know that this could ever happen due to pointer capture.

@NavidZ NavidZ merged commit b5cfaa6 into gh-pages Nov 4, 2019
@patrickhlauke patrickhlauke deleted the pointer-activeness branch November 25, 2019 22:00
@mustaqahmed mustaqahmed added needs-wpt Investigation whether the issue needs a wpt test has been done and wpt is missing and removed wpt labels Dec 20, 2022
@mustaqahmed
Copy link
Member

We need a WPT that requests pointer-capture on an element from a different frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-wpt Investigation whether the issue needs a wpt test has been done and wpt is missing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting pointer capture on an element in a parent frame when the pointer was made active in a child frame
5 participants