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.
| <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.
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.
...in fact, isn't this enough. target changes when event is dispatched.
There was a problem hiding this comment.
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 |
| <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.
Nit: target instead of plain "target"?
| <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.
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.
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