-
Notifications
You must be signed in to change notification settings - Fork 33
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
Update targets of predicted and coalesced events when trusted event target changes. #390
Conversation
This is also only done for trusted events, establishing the precedent that for untrusted events there is no required association between the predicted and coaleseced events and their owning event.
index.html
Outdated
<code>isPrimary</code> and <code>isTrusted</code> to the {{PointerEvent}}'s | ||
<code>pointerId</code>, <code>pointerType</code>, <code>isPrimary</code> and | ||
<code>isTrusted</code>.</li> | ||
<code>pointerId</code>, <code>pointerType</code>, <code>target</code>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how precise we want to be here. When a PointerEvent is created, it doesn't have a target at all. target is set during event dispatch. https://dom.spec.whatwg.org/#concept-event-listener-invoke
and <a><code>predicted events targets dirty</code></a> to true.</p> | ||
|
||
<p>When the <code><a data-lt="PointerEvent.getCoalescedEvents">getCoalescedEvents</a></code> method is called:</p> | ||
<p>When a trusted <a>PointerEvent</a>'s target is changed:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...in fact, isn't this enough. target changes when event is dispatched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this is much simpler. Updated.
assume this can then be grafted back in/onto #377 going to trust @smaug---- on the whether or not this sufficiently addresses our concern there |
<ol> | ||
<li>If the <a>coalesced events targets dirty</a> is true: | ||
for each event in the <a>coalesced event list</a>, set the event's {{Event/target}} | ||
<li>for each event in the <a>coalesced event list</a>, set the event's {{Event/target}} | ||
to this <code>PointerEvent</code>'s target.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: target
instead of plain "target"?
<ol> | ||
<li>If the <a>coalesced events targets dirty</a> is true: | ||
for each event in the <a>coalesced event list</a>, set the event's {{Event/target}} | ||
<li>for each event in the <a>coalesced event list</a>, set the event's {{Event/target}} | ||
to this <code>PointerEvent</code>'s target.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there before but never came to me: the "this" here seems unclear to me. The first point in the above para (source line 1110) doesn't use "this", but also unclear to me :( .
- Can we make both paras consistent?
- Can we perhaps use something like "container event"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep in mind that this PR will then be followed by #377 which completely rejigs this stuff....
I couldn't find a test for this |
I'm writing a test for this. |
A super simple manual wpt is here web-platform-tests/wpt#46485 |
This allows removing the dirty flag, as trusted events keep the target of the PointerEvent in sync with their coalesced and predicted events.
Preview | Diff