-
Notifications
You must be signed in to change notification settings - Fork 34
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
Coalesced and predicted event attributes within an untrusted event #514
Comments
FYI @smaug---- @flackr |
There is no isTrusted property in the *EventInit, and there is no target. I'm confused about this issue. The sentence in the spec talks about how one can initialize coalesced and predicted events lists. PointerEventInit has properties for those. JS created event is always non-trusted, so redispatching doesn't affect .target of coalesced/predicted events. |
The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f
Thanks @smaug----, that answers my first question. My second question remains. To clarify, this is about JS re-dispatch of browser-constructed event. Something like this with the user moving the mouse over target1.onpointermove = e => console.log(e.getCoalescedEvents()[0].isTrusted);
target2.onpointermove = e => setTimeout(() => target1.dispatchEvent(e), 0); (I am landing a tentative WPT for this.) |
FYI: both Firefox and Chromium emit |
Oh, the "parent" event has been dispatched once, and then you redispatch it again? I wouldn't expect anything to change for coalesced or predicted events |
I'm remembering now that previously we decided these additional structures would be treated as completely generic objects for developer dispatched events. This makes sense since the user could put anything they want in the coalescedEvents / predictedEvents lists, and I guess as such developers shouldn't trust the |
The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823713 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1350816}
The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823713 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1350816}
Well, the JS seems unable to construct a new [LegacyUnforgeable] readonly attribute boolean isTrusted; Did I miss anything? At least the spec needs a clarification, right? |
That is the whole point of isTrusted. It is set to true only for events which UA dispatches. If an event was trusted and it is later re-dispatched using JS, it becomes untrusted. |
Exactly! Therefore the current behavior essentially says "the If we want to maintain this behavior, I would suggest adding a spec note accordingly. |
The current behavior says that on untrusted events native code doesn't change anything on the coalesced/predicted lists, no? (but of course we should clarify the spec, if there is something unclear) |
… on redispatch., a=testonly Automatic update from web-platform-tests Add a WPT for coalesced event attributes on redispatch. The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823713 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1350816} -- wpt-commits: ab72b1d1516a5f8ed2a88af3e9a4fec1817c3a84 wpt-pr: 47940
… on redispatch., a=testonly Automatic update from web-platform-tests Add a WPT for coalesced event attributes on redispatch. The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823713 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1350816} -- wpt-commits: ab72b1d1516a5f8ed2a88af3e9a4fec1817c3a84 wpt-pr: 47940
… on redispatch., a=testonly Automatic update from web-platform-tests Add a WPT for coalesced event attributes on redispatch. The test is tentative due to: w3c/pointerevents#514 Bug: 353538500 Change-Id: Id3ead2029e84a3100573558adbd7c14c272e821f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823713 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1350816} -- wpt-commits: ab72b1d1516a5f8ed2a88af3e9a4fec1817c3a84 wpt-pr: 47940
The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb
The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866}
The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866}
The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866}
… non-tentative., a=testonly Automatic update from web-platform-tests Mark a coalesced event attribute test as non-tentative. The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866} -- wpt-commits: 69ce0d386cba2a63c29d1715e07f22658fdc88b7 wpt-pr: 48779
… non-tentative., a=testonly Automatic update from web-platform-tests Mark a coalesced event attribute test as non-tentative. The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866} -- wpt-commits: 69ce0d386cba2a63c29d1715e07f22658fdc88b7 wpt-pr: 48779
… non-tentative., a=testonly Automatic update from web-platform-tests Mark a coalesced event attribute test as non-tentative. The spec issue has been resolved: w3c/pointerevents#514 Change-Id: I453fc30258e6b599d65330a63b02822b6815e6fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5957237 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1372866} -- wpt-commits: 69ce0d386cba2a63c29d1715e07f22658fdc88b7 wpt-pr: 48779
The spec Sec 10 mentions the following about the attributes of the "contained events" for a JS-constructed (untrusted) event, which needs a clarification for at least
isTrusted
andtarget
attributes: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:
both browsers emit the following:
So
isTrusted
andtarget
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:
The text was updated successfully, but these errors were encountered: