Skip to content

Commit 120397c

Browse files
committed
actions: add additional pointer properties
W3C Pointer Events defined additional pointer properties (pressure, contact geometry, tilt, etc.) to the PointerEvent interface that reflects new interactions with pointer devices like touch and pen. Update the WebDriver actions to support these additional properties.
1 parent 9b93d7e commit 120397c

File tree

1 file changed

+149
-5
lines changed

1 file changed

+149
-5
lines changed

index.html

Lines changed: 149 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ <h2>Terminology</h2>
195195
An <dfn>integer</dfn> is a <a>Number</a> that is unchanged
196196
under the <a>ToInteger</a> operation.
197197

198+
<p>
199+
A <dfn>floating-point number</dfn> is a <a>Number</a> that is
200+
produced by the <a>parseFloat</a> operation.
201+
198202
<p>
199203
The <dfn>initial value</dfn> of an ECMAScript property
200204
is the value defined by the platform for that property,
@@ -6895,8 +6899,7 @@ <h3 id=input-source-state>State</h3>
68956899
and <code>alt</code>, <code>shift</code>, <code>ctrl</code>,
68966900
and <code>meta</code> all set to <code>false</code>.
68976901

6898-
<p>
6899-
A <a>pointer input source</a>’s <a>input source state</a>
6902+
<p>A <a>pointer input source</a>’s <a>input source state</a>
69006903
is a <dfn>pointer input state</dfn> object.
69016904
This consists of a <code>subtype</code> property,
69026905
which has the possible values
@@ -6906,12 +6909,20 @@ <h3 id=input-source-state>State</h3>
69066909
a <code>pressed</code> property which is a set of unsigned integers,
69076910
an <code>x</code> property which is an unsigned integer,
69086911
and a <code>y</code> property which is an unsigned integer.
6912+
Additionally, it also contains optional properties
6913+
<code>width</code>, <code>height</code>, <code>pressure</code>, and
6914+
<code>tangentialPressure</code> which are floating-point numbers, and
6915+
<code>tiltX</code>, <code>tiltY</code>, and <code>twist</code> which
6916+
are integers in accordance with the requirements of [[!POINTER-EVENTS]].
69096917

69106918
<p>When required to <dfn>create a new pointer input state</dfn> object
69116919
with arguments <var>subtype</var> an implementation must return
69126920
a <a>pointer input state</a> object with <code>subtype</code> set
6913-
to <var>subtype</var>, <code>pressed</code> set to an empty set and
6914-
both <code>x</code> and <code>y</code> set to <code>0</code>.
6921+
to <var>subtype</var>, <code>pressed</code> set to an empty set,
6922+
both <code>x</code> and <code>y</code> set to <code>0</code>, and
6923+
<code>width</code>, <code>height</code>, <code>pressure</code>,
6924+
<code>tangentialPressure</code>, <code>tiltX</code>, <code>tiltY</code>,
6925+
and <code>twist</code> are set to null.
69156926

69166927
<p>Each <a>session</a> has an associated <dfn>input state table</dfn>.
69176928
This is a map between <a>input id</a>
@@ -7033,7 +7044,7 @@ <h3>Ticks</h3>
70337044
will have the <a><code>isTrusted</code></a> attribute set to true.
70347045

70357046
<p>
7036-
The most robust way to despatch these events
7047+
The most robust way to dispatch these events
70377048
is by creating them in the browser implementation itself.
70387049
Sending operating system specific input messages to the browser’s window
70397050
has the disadvantage that the browser being automated
@@ -7393,6 +7404,12 @@ <h2>Processing actions</h2>
73937404
<var>action item</var> and <var>action</var>.
73947405
If doing so results in an <a>error</a>, return that <a>error</a>.
73957406

7407+
<li><p>
7408+
If <var>subtype</var> is "<code>pointerUp</code>" or "<code>pointerDown</code>"
7409+
or "<code>pointerMove</code>", <a>process optional pointer properties</a> with
7410+
arguments <var>action item</var> and <var>action</var>.
7411+
If doing so results in an <a>error</a>, return that <a>error</a>.
7412+
73967413
<li><p>
73977414
If <var>subtype</var> is "<code>pointerCancel</code>"
73987415
<span class=issue>process a pointer cancel action</span>.
@@ -7495,6 +7512,132 @@ <h2>Processing actions</h2>
74957512

74967513
<li><p>Return success with data <a>null</a>.
74977514
</ol>
7515+
7516+
<p>When required to <dfn>process optional pointer properties</dfn>
7517+
with arguments <var>action item</var>, and <var>action</var>, a
7518+
<a>remote end</a> must run the following steps in accordance with
7519+
the requirements of [[!POINTER-EVENTS]]:</p>
7520+
7521+
<ol>
7522+
<li><p>Let <var>width</var> be the result
7523+
of getting the property <code>width</code>
7524+
from <var>action item</var>.
7525+
7526+
<li><p>If <var>width</var> is not <a>undefined</a>:
7527+
7528+
<ol>
7529+
<li><p>
7530+
If <var>width</var> is not a <a>Floating-Point Number</a> greater than or equal to 1,
7531+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7532+
7533+
<li><p>
7534+
Set the <code>width</code> property of <var>action</var>
7535+
to <var>width</var>.
7536+
</ol>
7537+
7538+
<li><p>Let <var>height</var> be the result
7539+
of getting the property <code>height</code>
7540+
from <var>action item</var>.
7541+
7542+
<li><p>If <var>height</var> is not <a>undefined</a>:
7543+
7544+
<ol>
7545+
<li><p>
7546+
If <var>height</var> is not a <a>Floating-Point Number</a> greater than or equal to 1,
7547+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7548+
7549+
<li><p>
7550+
Set the <code>height</code> property of <var>action</var>
7551+
to <var>height</var>.
7552+
</ol>
7553+
7554+
<li><p>If <var>width</var> is not <a>undefined</a> while
7555+
<var>height</var> is <a>undefined</a> or vice versa
7556+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7557+
7558+
<li><p>Let <var>pressure</var> be the result
7559+
of getting the property <code>pressure</code>
7560+
from <var>action item</var>.
7561+
7562+
<li><p>If <var>pressure</var> is not <a>undefined</a>:
7563+
7564+
<ol>
7565+
<li><p>
7566+
If <var>pressure</var> is not a <a>Floating-Point Number</a> in the range of [0, 1]
7567+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7568+
7569+
<li><p>
7570+
Set the <code>pressure</code> property of <var>action</var>
7571+
to <var>pressure</var>.
7572+
</ol>
7573+
7574+
<li><p>Let <var>tangentialPressure</var> be the result
7575+
of getting the property <code>tangentialPressure</code>
7576+
from <var>action item</var>.
7577+
7578+
<li><p>If <var>tangentialPressure</var> is not <a>undefined</a>:
7579+
7580+
<ol>
7581+
<li><p>
7582+
If <var>tangentialPressure</var> is not a <a>Floating-Point Number</a>
7583+
in the range of [-1, 1]
7584+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7585+
7586+
<li><p>
7587+
Set the <code>tangentialPressure</code> property of <var>action</var>
7588+
to <var>tangentialPressure</var>.
7589+
</ol>
7590+
7591+
<li><p>Let <var>tiltX</var> be the result
7592+
of getting the property <code>tiltX</code>
7593+
from <var>action item</var>.
7594+
7595+
<li><p>If <var>tiltX</var> is not <a>undefined</a>:
7596+
7597+
<ol>
7598+
<li><p>
7599+
If <var>tiltX</var> is not an <a>Integer</a> in the range of [-90, 90]
7600+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7601+
7602+
<li><p>
7603+
Set the <code>tiltX</code> property of <var>action</var>
7604+
to <var>tiltX</var>.
7605+
</ol>
7606+
7607+
<li><p>Let <var>tiltY</var> be the result
7608+
of getting the property <code>tiltY</code>
7609+
from <var>action item</var>.
7610+
7611+
<li><p>If <var>tiltY</var> is not <a>undefined</a>:
7612+
7613+
<ol>
7614+
<li><p>
7615+
If <var>tiltY</var> is not an <a>Integer</a> in the range of [-90, 90]
7616+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7617+
7618+
<li><p>
7619+
Set the <code>tiltY</code> property of <var>action</var>
7620+
to <var>tiltY</var>.
7621+
</ol>
7622+
7623+
<li><p>Let <var>twist</var> be the result
7624+
of getting the property <code>twist</code>
7625+
from <var>action item</var>.
7626+
7627+
<li><p>If <var>twist</var> is not <a>undefined</a>:
7628+
7629+
<ol>
7630+
<li><p>
7631+
If <var>twist</var> is not an <a>Integer</a> in the range of [0, 359]
7632+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
7633+
7634+
<li><p>
7635+
Set the <code>twist</code> property of <var>action</var>
7636+
to <var>twist</var>.
7637+
</ol>
7638+
7639+
<li><p>Return success with data <a>null</a>.
7640+
</ol>
74987641
</section> <!-- /processing-actions -->
74997642

75007643

@@ -9175,6 +9318,7 @@ <h2>Acknowledgements</h2>
91759318
<!-- Sam Sneddon --> Sam Sneddon,
91769319
<!-- Seva Lotoshnikov --> Seva Lotoshnikov,
91779320
<!-- Simon Stewart --> <a href=http://www.rocketpoweredjetpants.com/>Simon Stewart</a>,
9321+
<!-- Timotius Arya Margo --> Timotius Arya Margo,
91789322
<!-- Titus Fortner --> Titus Fortner,
91799323
<!-- Vangelis Katsikaros --> and Vangelis Katsikaros.
91809324

0 commit comments

Comments
 (0)