Skip to content

Can we make user activation consistent between pointer types? #7341

Open
@flackr

Description

@flackr

In 6.4.2 Processing Model we define which types of events are activation triggering input event as follows:

An activation triggering input event is any event whose isTrusted attribute is true and whose type is one of:

  • keydown, provided the key is neither the Esc key nor a shortcut key reserved by the user agent.
  • mousedown.
  • pointerdown, provided the event's pointerType is "mouse".
  • pointerup, provided the event's pointerType is not "mouse".
  • touchend.

The rationale for omitting touchstart (and as a result pointerdown whose pointerType is not "mouse") seems to be to omit swipes, however mousedown (and hence pointerdown of type "mouse") was not omitted due to compat concerns, with concerns even over removing activation on touchstart for media playback.

However, defining a different activation rule for mouse vs other pointer types complicates the situation for developers, especially those who are building on pointer events who now could easily accidentally land code that works with mouse but not touch due to the different activation event. E.g. a pointerdown listener which tries to play a video would only work when triggered with mouse but not touch.

Since there are compat concerns with removing activation on the down event for mouse and even touch, can we change the rules to consider pointerdown an activation triggering input regardless of pointerType (and touchstart)? If we don't want to have activation as a result of a swipe would it be possible to cancel the pointerdown activation when we dispatch a pointercancel event? Alternately we could exclude pointerdown / touchstart when it could lead to a pan (e.g. can't prevent scroll and touch-action does not prevent panning), but that could result in a fair bit of complexity.

@mustaqahmed thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions