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

gotpointercapture event should be a PointerEvent #269

Closed
@bethge

Description

@bethge

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions