diff --git a/index.html b/index.html index 73c6e11..b006351 100644 --- a/index.html +++ b/index.html @@ -388,142 +388,145 @@

The Primary Pointer

In some cases, it is possible for the user agent to fire pointer events in which no pointer is marked as a primary pointer. For instance, when there are multiple active pointers of a particular type like multi-touch and the primary pointer is removed (e.g. it leaves the screen), there will be no primary pointer events. Also on the platforms where the primary pointer is determined using all active pointers on the device (including those targeted at an application other than the user agent), if the first touch interaction is targeted outside the user agent and a secondary (multi-touch) touch interaction is targeted inside the user agent, then the user agent may fire pointer events for the second contact with a value of false for isPrimary.
Current operating systems and user agents don't usually have a concept of multiple mouse inputs. When more than one mouse device is present (for instance, on a laptop with both a trackpad and an external mouse), all mouse devices are generally treated as a single device - movements on any of the devices are translated to movement of a single mouse pointer, and there is no distinction between button presses on different mouse devices. For this reason, there will usually only be a single mouse pointer, and that pointer will be primary.
+ +
+

Firing events using the PointerEvent interface

+

To fire a pointer event name e means to fire an event named e as defined in [[!DOM4]] with an event using the PointerEvent interface whose attributes are set as defined in PointerEvent Interface.

+ +

Initialize the bubbles attribute for the event to true if the event name is

+ +

Initialize the cancelable attribute for the event to true if the event name is

+

+ +

The target object at which the event is fired is determined as follows: +

+ +
+

Process Pending Pointer Capture

+

Whenever a user agent is to fire a Pointer Event that is not gotpointercapture or lostpointercapture, it must first run these steps:

+
    +
  1. If the pointer capture target override for this pointer is set and is not equal to the pending pointer capture target override, then fire a pointer event named lostpointercapture at the pointer capture target override node. + +
  2. +
  3. If the pending pointer capture target override for this pointer is set and is not equal to the pointer capture target override, then fire a pointer event named gotpointercapture at the pending pointer capture target override. +
      +
    • Further, if the pointer capture target override is not set and, the pending pointer capture target override is not equal to the hit test node for the pointer event which invoked this process, and the hit test node has received pointerover and pointerenter events, then fire a pointer event named pointerout and a pointer event named pointerleave at the hit test node.
    • +
    +
  4. +
  5. Set the pointer capture target override to the pending pointer capture target override, if set. Otherwise, clear the pointer capture target override.
  6. +
+
+
-

Pointer Event Types

-

Firing events using the PointerEvent interface

-

To fire a pointer event name e means to fire an event named e as defined in [[!DOM4]] with an event using the PointerEvent interface whose attributes are set as defined in PointerEvent Interface.

- -

Initialize the bubbles attribute for the event to true if the event name is

- -

Initialize the cancelable attribute for the event to true if the event name is

-

- -

The target object at which the event is fired is determined as follows: -

-

Process Pending Pointer Capture

-

Whenever a user agent is to fire a Pointer Event that is not gotpointercapture or lostpointercapture, it must first run these steps:

-
    -
  1. If the pointer capture target override for this pointer is set and is not equal to the pending pointer capture target override, then fire a pointer event named lostpointercapture at the pointer capture target override node. - -
  2. -
  3. If the pending pointer capture target override for this pointer is set and is not equal to the pointer capture target override, then fire a pointer event named gotpointercapture at the pending pointer capture target override. -
      -
    • Further, if the pointer capture target override is not set and, the pending pointer capture target override is not equal to the hit test node for the pointer event which invoked this process, and the hit test node has received pointerover and pointerenter events, then fire a pointer event named pointerout and a pointer event named pointerleave at the hit test node.
    • -
    -
  4. -
  5. Set the pointer capture target override to the pending pointer capture target override, if set. Otherwise, clear the pointer capture target override.
  6. -
+

Pointer Event types

+

The following table provides a summary of the event types defined in this specification.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Event TypeSync/AsyncBubblesCancelableDefault Action
pointeroverSyncYesYesNone
pointerenterSyncNoNoNone
pointerdownSyncYesYesVaries: when the pointer is primary, all default actions of the mousedown event +
Canceling this event also sets the PREVENT MOUSE EVENT flag for this pointerType, which prevents subsequent firing of certain compatibility mouse events.
pointermoveSyncYesYesVaries: when the pointer is primary, all default actions of mousemove
pointerupSyncYesYesVaries: when the pointer is primary, all default actions of mouseup
pointercancelSyncYesNoNone
pointeroutSyncYesYesNone
pointerleaveSyncNoNoNone
gotpointercaptureSync/AsyncYesNoNone
lostpointercaptureSync/AsyncYesNoNone
+

In the case of the primary pointer, these events (with the exception of gotpointercapture, and lostpointercapture) may also fire compatibility mouse events.

-
-

List of Pointer Events

-

The following table provides a summary of the event types defined in this specification.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event TypeSync/AsyncBubblesCancelableDefault Action
pointeroverSyncYesYesNone
pointerenterSyncNoNoNone
pointerdownSyncYesYesVaries: when the pointer is primary, all default actions of the mousedown event -
Canceling this event also sets the PREVENT MOUSE EVENT flag for this pointerType, which prevents subsequent firing of certain compatibility mouse events.
pointermoveSyncYesYesVaries: when the pointer is primary, all default actions of mousemove
pointerupSyncYesYesVaries: when the pointer is primary, all default actions of mouseup
pointercancelSyncYesNoNone
pointeroutSyncYesYesNone
pointerleaveSyncNoNoNone
gotpointercaptureSync/AsyncYesNoNone
lostpointercaptureSync/AsyncYesNoNone
-

In the case of the primary pointer, these events (with the exception of gotpointercapture, and lostpointercapture) may also fire compatibility mouse events.

-

The pointerover event

A user agent MUST fire a pointer event named pointerover when a pointing device is moved into the hit test boundaries of an element. A user agent MUST also fire this event prior to firing a pointerdown event for devices that do not support hover (see pointerdown).