Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

gotpointercapture event should be a PointerEvent #269

Closed
bethge opened this issue Feb 11, 2016 · 1 comment
Closed

gotpointercapture event should be a PointerEvent #269

bethge opened this issue Feb 11, 2016 · 1 comment
Milestone

Comments

@bethge
Copy link
Contributor

bethge commented Feb 11, 2016

The gotpointercapture event caused by element.setPointerCapture() is currently a mere Event. The test pointerevent_gotpointercapture_before_first_pointerevent-manual expects a gotpointercapture event to be a pointer event: https://github.com/w3c/web-platform-tests/blob/master/pointerevents/pointerevent_gotpointercapture_before_first_pointerevent-manual.html#L39.

It looks doable to create a PointerEvent instead of an Event. The trickier part is getting the properties of the pointer at the time of the execution of element.setPointerCapture(), like pageX and pageY. Afaik, the only point where we store recent pointer events is dispatcher.pointermap, which contains the most recent mousedown event or particular touchstart properties.

Introducing tracking of the most recent mousemove and touchmove would get us closer to the actual value. Generally I would say the most recent mousedown \ touchstart is close enough, since the most common use case of a capture is to capture the movement of a pointer starting from the moment the pointer is pressed.
Though if one creates something fancy like: "Only capture, if the pointer has been dragged for over 2 seconds" or "only capture, if the pointer left a certain element", using the most recent pointerdown would be way off.

On the other hand, the setPointerCapture event is asynchronous, so maybe we can be somewhat lax about its properties.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants