-
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
How is pointer event ctor supposed to work when coalescedEvents is passed using the PointerEventInit #223
Comments
Most Event ctor generally take the arguments as the user has specified even if they logically don't make sense. I'd expect pointer event to be like this. |
yeah, I'd expect that too, but the explanation of getCoalescedEvents() says What if the event wasn't dispatched at all? What if one just creates a pointer event and passes coalescedEvents in the init. What should getCoalescedEvents() return? |
Feel free to make a pull request with some alternate text. This really shouldn't be around the getCoalesecedEvent call but really how the coalescedEvents is initialized by the user agent by default. |
Regarding the event that are being created in js I remember talking to @RByers and he was saying the ctors usually don't do any checks and just initialize properties from the stuff in the dictionary. So we went with that idea and whatever you put inside the initialization dictionary will be inside the pointerevent object regardless of what js set the type of the event be or what no. |
Yeah, that sounds reasonable, but can we get that also to the spec? |
The spec has changed but it is still wrong. Nothing says how the data from |
https://dom.spec.whatwg.org/#inner-event-creation-steps handles the normal cases, but 'coalesced event list' isn't an attribute. |
@annevk do you recall other cases where event contructor needs to do something special like this? |
There's an issue with required members not working: whatwg/dom#600. (And there's whatwg/dom#606 about being more accurate about when time is captured.) (I'm somewhat surprised this got all the way to shipping without at least some investigation into "how should this be specified".) |
I recommend filing an issue against the DOM Standard for this so that we can consider what to do here whenever we end up reworking event construction and initialization. |
https://dom.spec.whatwg.org/#concept-event-constructor-ext So pointer events spec should to define that way the event constructions steps would follow the DOM spec. Currently PointerEvents spec has a bit hand wavy " Untrusted events have their coalesced events list initialized to the value passed to the constructor." And I think https://github.com/web-platform-tests/wpt/blob/1408b119ac/pointerevents/pointerevent_constructor.html is a bit broken since it tests that event.target of coalesced events is updated too, but those are untrusted events, so target shouldn't be changed. https://wpt.fyi/results/pointerevents/pointerevent_constructor.html?label=master&label=experimental&aligned&q=pointerevent_constructor.html shows that blink and gecko would need to be tweaked |
…passed using the PointerEventInit (#427) * Fix for #223, specify event constructing steps * linkify the reference to dictionary members Co-authored-by: smaug <[email protected]>
did #427 fully address this issue, or is there more that needs to be done here? |
Whoever updates the implementation first will need to tweak https://github.com/web-platform-tests/wpt/blob/1408b119ac/pointerevents/pointerevent_constructor.html |
I'm tweaking the test on mozilla-central. I'm expecting to land the patch soon and then the test gets automatically merged to wpt. |
web-platform-tests/wpt#32466 is the merge from mozilla-central. |
perfect, thank you @smaug---- |
It isn't clear what is supposed to happen when coalescedEvents is passed using the PointerEventInit.
Does the event have some internal array of pointer events or what? Does coalescedEvents work only when type is pointermove?
Gecko bug related to this: https://bugzilla.mozilla.org/show_bug.cgi?id=1303957.
I guess we'll implement some guess what the spec might try to say
The text was updated successfully, but these errors were encountered: