Skip to content

Commit 7c12f1b

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 b7c6791 commit 7c12f1b

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
@@ -188,6 +188,10 @@ <h2>Terminology</h2>
188188
An <dfn>integer</dfn> is a <a>Number</a> that is unchanged
189189
under the <a>ToInteger</a> operation.
190190

191+
<p>
192+
A <dfn>floating-point number</dfn> is a <a>Number</a> that is
193+
produced by the <a>parseFloat</a> operation.
194+
191195
<p>
192196
The <dfn>initial value</dfn> of an ECMAScript property
193197
is the value defined by the platform for that property,
@@ -6888,8 +6892,7 @@ <h3 id=input-source-state>State</h3>
68886892
and <code>alt</code>, <code>shift</code>, <code>ctrl</code>,
68896893
and <code>meta</code> all set to <code>false</code>.
68906894

6891-
<p>
6892-
A <a>pointer input source</a>’s <a>input source state</a>
6895+
<p>A <a>pointer input source</a>’s <a>input source state</a>
68936896
is a <dfn>pointer input state</dfn> object.
68946897
This consists of a <code>subtype</code> property,
68956898
which has the possible values
@@ -6899,12 +6902,20 @@ <h3 id=input-source-state>State</h3>
68996902
a <code>pressed</code> property which is a set of unsigned integers,
69006903
an <code>x</code> property which is an unsigned integer,
69016904
and a <code>y</code> property which is an unsigned integer.
6905+
Additionally, it also contains optional properties
6906+
<code>width</code>, <code>height</code>, <code>pressure</code>, and
6907+
<code>tangentialPressure</code> which are floating-point numbers, and
6908+
<code>tiltX</code>, <code>tiltY</code>, and <code>twist</code> which
6909+
are integers in accordance with the requirements of [[!POINTER-EVENTS]].
69026910

69036911
<p>When required to <dfn>create a new pointer input state</dfn> object
69046912
with arguments <var>subtype</var> an implementation must return
69056913
a <a>pointer input state</a> object with <code>subtype</code> set
6906-
to <var>subtype</var>, <code>pressed</code> set to an empty set and
6907-
both <code>x</code> and <code>y</code> set to <code>0</code>.
6914+
to <var>subtype</var>, <code>pressed</code> set to an empty set,
6915+
both <code>x</code> and <code>y</code> set to <code>0</code>, and
6916+
<code>width</code>, <code>height</code>, <code>pressure</code>,
6917+
<code>tangentialPressure</code>, <code>tiltX</code>, <code>tiltY</code>,
6918+
and <code>twist</code> are set to null.
69086919

69096920
<p>Each <a>session</a> has an associated <dfn>input state table</dfn>.
69106921
This is a map between <a>input id</a>
@@ -7026,7 +7037,7 @@ <h3>Ticks</h3>
70267037
will have the <a><code>isTrusted</code></a> attribute set to true.
70277038

70287039
<p>
7029-
The most robust way to despatch these events
7040+
The most robust way to dispatch these events
70307041
is by creating them in the browser implementation itself.
70317042
Sending operating system specific input messages to the browser’s window
70327043
has the disadvantage that the browser being automated
@@ -7386,6 +7397,12 @@ <h2>Processing actions</h2>
73867397
<var>action item</var> and <var>action</var>.
73877398
If doing so results in an <a>error</a>, return that <a>error</a>.
73887399

7400+
<li><p>
7401+
If <var>subtype</var> is "<code>pointerUp</code>" or "<code>pointerDown</code>"
7402+
or "<code>pointerMove</code>", <a>process optional pointer properties</a> with
7403+
arguments <var>action item</var> and <var>action</var>.
7404+
If doing so results in an <a>error</a>, return that <a>error</a>.
7405+
73897406
<li><p>
73907407
If <var>subtype</var> is "<code>pointerCancel</code>"
73917408
<span class=issue>process a pointer cancel action</span>.
@@ -7488,6 +7505,132 @@ <h2>Processing actions</h2>
74887505

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

74937636

@@ -9168,6 +9311,7 @@ <h2>Acknowledgements</h2>
91689311
<!-- Sam Sneddon --> Sam Sneddon,
91699312
<!-- Seva Lotoshnikov --> Seva Lotoshnikov,
91709313
<!-- Simon Stewart --> <a href=http://www.rocketpoweredjetpants.com/>Simon Stewart</a>,
9314+
<!-- Timotius Arya Margo --> Timotius Arya Margo,
91719315
<!-- Titus Fortner --> Titus Fortner,
91729316
<!-- Vangelis Katsikaros --> and Vangelis Katsikaros.
91739317

0 commit comments

Comments
 (0)