- From: Mustaq Ahmed via GitHub <sysbot+gh@w3.org>
- Date: Wed, 28 Aug 2024 21:13:32 +0000
- To: public-pointer-events@w3.org
mustaqahmed has just created a new issue for https://github.com/w3c/pointerevents:
== Coalesced and predicted event attributes within an untrusted event ==
The spec [Sec 10](https://w3c.github.io/pointerevents/#coalesced-and-predicted-events) mentions the following about the attributes of the "contained events" for a JS-constructed (untrusted) event, which needs a clarification for at least `isTrusted` and `target` attributes:
> Untrusted events have their coalesced/predicted events list initialized to the value passed to the constructor.
This text seems to suggest that the constructor allows setting any arbitrary value to an attribute. However, when I run the following code in Chrome and Firefox:
```JS
// Read default values:
let e0 = new PointerEvent("pointermove");
console.log(e0.isTrusted, e0.bubbles, e0.clientX, e0.pointerType, e0.target);
// Read assigned values:
let e1 = new PointerEvent("pointermove", {isTrusted: true, bubbles: true, clientX: 1234, pointerType: "hand", target: document.body});
console.log(e1.isTrusted, e1.bubbles, e1.clientX, e1.pointerType, e1.target);
```
both browsers emit the following:
```
false false 0 '' null
false true 1234 'hand' null
```
So `isTrusted` and `target` attributes do not allow arbitrary values while other attributes allow. I didn't see any indication in IDLs to explain this behavior!
In any case, we need clarifications for those two special attributes _in coalesced and predicted event lists_:
- Within a JS-constructed "parent" event, will they always have their default values?
- When a trusted "parent" event is redispatched from JS, will they be reset to their default values?
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/514 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 28 August 2024 21:13:32 UTC