Difference between revisions of "PointerEvents/TestAssertions"

From W3C Wiki
Jump to: navigation, search
(Test Assertions for Pointer Events)
(Test Assertions for Pointer Events)
Line 53: Line 53:
 
!
 
!
 
! Assertion  
 
! Assertion  
 +
|-
 +
| 2.x
 +
| The pointerdown event must be dispatched if the input device is a mouse and the device transitions from no buttons depressed to at least one button depressed.
 +
|-
 +
| 2.x
 +
| The pointerdown event must be dispatched if the input device is touch and the device makes physical contact with the digitizer.
 +
|-
 +
| 2.x
 +
| The pointerdown event must be dispatched if the input device is pen and the device makes physical contact with the digitizer.
 +
|-
 +
| 2.x
 +
| For input devices that do not support hover, a pointerover event must precede the pointerdown event. Furthermore, the pointerType and isPrimary attributes of the pointerover event must be the same as the respective attributes of the corresponding pointerdown event.
 
|-
 
|-
 
| 2.x
 
| 2.x
Line 78: Line 90:
 
| 3.x
 
| 3.x
 
| The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 
| The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 +
|-
 +
| 3.x
 +
| The pointerup event must be dispatched if the input device is a mouse and the device transitions from at least one button depressed to no buttons depressed.
 +
|-
 +
| 3.x
 +
| The pointerup event must be dispatched if the input device is touch and physical contact is removed from the digitizer.
 +
|-
 +
| 3.x
 +
| The pointerup event must be dispatched if the input device is touch and the pen is removed from physical contact with the digitizer.
 +
|-
 +
| 3.x
 +
| For input devices that do not support hover, a pointerout event must follow the pointerup event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointerup event.
 
|-
 
|-
 
|}
 
|}
Line 116: Line 140:
 
|-
 
|-
 
| 6.x
 
| 6.x
| The pointerType attribute of a pointerover event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
|
|-
+
| 6.x
+
| The isPrimary attribute of a pointerover event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
 
|-
 
|-
 
|}
 
|}
Line 129: Line 150:
 
|-
 
|-
 
| 7.x
 
| 7.x
| The pointerType attribute of a pointerout event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
|
|-
+
| 7.x
+
| The isPrimary attribute of a pointerout event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
 
|-
 
|-
 
|}
 
|}
Line 142: Line 160:
 
|-
 
|-
 
| 8.x
 
| 8.x
| The pointerType attribute of a pointerenter event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
|
|-
+
| 8.x
+
| The isPrimary attribute of a pointerenter event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
 
|-
 
|-
 
|}
 
|}
Line 155: Line 170:
 
|-
 
|-
 
| 9.x
 
| 9.x
| The pointerType attribute of a pointerleave event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
|
|-
+
| 9.x
+
| The isPrimary attribute of a pointerleave event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
 
|-
 
|-
 
|}
 
|}

Revision as of 20:12, 25 March 2013

Test Assertions for Pointer Events

This page documents the test assertions for the Pointer Events specification [1].

Test Assertions for PointerEvent Interface

Assertion
1.1 For any PointerEvent object, each of the attributes must exist.
1.2 For any PointerEvent object, each of the attributes must be of the specified data type.
1.3 If a pointer event is initiated by a mouse device, then pointerType must be "mouse".
1.4 If a pointer event is initiated by a pen input device, then pointerType must be "pen".
1.5 If a pointer event is initiated by a touch input device, then pointerType must be "touch".
1.6 The value of pressure must be between 0 and 1 (inclusive).
1.7 If pointerType is "mouse" and buttons is 0, then pressure must be 0.
1.8 If pointerType is "mouse" and buttons > 0, then pressure must be 0.5.
1.9 If pointerType is "mouse", tiltX must be 0.
1.10 If pointerType is "mouse", tiltY must be 0.
1.11 If pointerType is "mouse", then pointerId must be 1.
1.12 If pointerType is not "mouse", then pointerId must not be 1.
1.13 If pointerType is "mouse", then isPrimary must be true.

Test Assertions for pointerdown events

Assertion
2.x The pointerdown event must be dispatched if the input device is a mouse and the device transitions from no buttons depressed to at least one button depressed.
2.x The pointerdown event must be dispatched if the input device is touch and the device makes physical contact with the digitizer.
2.x The pointerdown event must be dispatched if the input device is pen and the device makes physical contact with the digitizer.
2.x For input devices that do not support hover, a pointerover event must precede the pointerdown event. Furthermore, the pointerType and isPrimary attributes of the pointerover event must be the same as the respective attributes of the corresponding pointerdown event.
2.x If pointerType is "touch" and no other active pointers representing touch input exists, then isPrimary must be true.
2.x If pointerType is "touch" and some other active pointers representing touch input exist, then isPrimary must be false.
2.x If pointerType is "pen" and no other active pointers representing pen input exists, then isPrimary must be true.
2.x If pointerType is "pen" and some other active pointers representing pen input exist, then isPrimary must be false.

Test Assertions for pointerup events

Assertion
3.x The pointerType attribute of a pointerup event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
3.x The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
3.x The pointerup event must be dispatched if the input device is a mouse and the device transitions from at least one button depressed to no buttons depressed.
3.x The pointerup event must be dispatched if the input device is touch and physical contact is removed from the digitizer.
3.x The pointerup event must be dispatched if the input device is touch and the pen is removed from physical contact with the digitizer.
3.x For input devices that do not support hover, a pointerout event must follow the pointerup event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointerup event.

Test Assertions for pointercancel events

Assertion
4.x The pointerType attribute of a pointercancel event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
4.x The isPrimary attribute of a pointercancel event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.

Test Assertions for pointermove events

Assertion
5.x The pointerType attribute of a pointermove event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
5.x The isPrimary attribute of a pointermove event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
5.x If pointerType is "mouse" and no mouse button is pressed, then button must be -1 and buttons must be 0.

Test Assertions for pointerover events

Assertion
6.x

Test Assertions for pointerout events

Assertion
7.x

Test Assertions for pointerenter events

Assertion
8.x

Test Assertions for pointerleave events

Assertion
9.x

Test Assertions for gotpointercapture events

Assertion
10.x

Test Assertions for lostpointercapture events

Assertion
11.x