Skip to content

Define active document for the active pointers#300

Merged
NavidZ merged 3 commits into
gh-pagesfrom
pointer-activeness
Nov 4, 2019
Merged

Define active document for the active pointers#300
NavidZ merged 3 commits into
gh-pagesfrom
pointer-activeness

Conversation

@NavidZ

@NavidZ NavidZ commented Aug 23, 2019

Copy link
Copy Markdown
Member

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

NavidZ commented Aug 23, 2019

Copy link
Copy Markdown
Member Author

@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.

Comment thread index.html Outdated

<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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

@graouts graouts left a comment

Copy link
Copy Markdown

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.

Comment thread index.html Outdated
<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
Copy Markdown

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.

Comment thread index.html Outdated
<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>.

<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
Copy Markdown

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.

Comment thread 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
Copy Markdown

Choose a reason for hiding this comment

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

Same for this change.

Comment thread index.html Outdated

<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
Copy Markdown

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
Copy Markdown
Member

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

@flackr flackr self-assigned this May 24, 2024
@mustaqahmed mustaqahmed assigned mustaqahmed and unassigned flackr Nov 20, 2024
@mustaqahmed

Copy link
Copy Markdown
Member

We now have WPT coverage for this: pointerevent_pointercapture_in_frame.html.

@mustaqahmed mustaqahmed removed the needs-wpt Investigation whether the issue needs a wpt test has been done and wpt is missing label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants