Difference between revisions of "PointerEvents/TestAssertions"

From W3C Wiki
Jump to: navigation, search
(Test Assertions for Pointer Events)
m (Test Assertions for Pointer Events)
Line 116: Line 116:
 
| 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.
 
| 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.
 
|-
 
|-
 +
| 4.x
 +
| The pointercancel event must be followed by a pointerout event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointercancel event.
 +
 
|}
 
|}
  
Line 130: Line 133:
 
|-
 
|-
 
| 5.x
 
| 5.x
| If pointerType is "mouse" and no mouse button is pressed, then button must be -1 and buttons must be 0.
+
| If pointerType is "mouse" and no mouse button is depressed, then button must be -1 and buttons must be 0.
 
|-
 
|-
 
|}
 
|}
Line 140: Line 143:
 
|-
 
|-
 
| 6.x
 
| 6.x
|
+
| When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched.
 
|-
 
|-
 
|}
 
|}
Line 150: Line 153:
 
|-
 
|-
 
| 7.x
 
| 7.x
|
+
| When a pointing device is moved out of the hit test boundaries of an element, the pointerout event must be dispatched.
 +
|-
 +
| 7.x
 +
| When a pen stylus leaves the hover range detectable by the digitizer, the pointerout event must be dispatched.
 
|-
 
|-
 
|}
 
|}
Line 160: Line 166:
 
|-
 
|-
 
| 8.x
 
| 8.x
|
+
| When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerover event must be dispatched.
 
|-
 
|-
 
|}
 
|}
Line 170: Line 176:
 
|-
 
|-
 
| 9.x
 
| 9.x
|
+
| When a pointing device is moved off of the hit test boundaries of an element and all of its descendants, the pointerover event must be dispatched.
 
|-
 
|-
 
|}
 
|}

Revision as of 21:55, 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.
4.x The pointercancel event must be followed by a pointerout event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointercancel event.

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 depressed, then button must be -1 and buttons must be 0.

Test Assertions for pointerover events

Assertion
6.x When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched.

Test Assertions for pointerout events

Assertion
7.x When a pointing device is moved out of the hit test boundaries of an element, the pointerout event must be dispatched.
7.x When a pen stylus leaves the hover range detectable by the digitizer, the pointerout event must be dispatched.

Test Assertions for pointerenter events

Assertion
8.x When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerover event must be dispatched.

Test Assertions for pointerleave events

Assertion
9.x When a pointing device is moved off of the hit test boundaries of an element and all of its descendants, the pointerover event must be dispatched.

Test Assertions for gotpointercapture events

Assertion
10.x

Test Assertions for lostpointercapture events

Assertion
11.x