Skip to content

Actions pointer additional properties #1417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 250 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ <h2>Terminology</h2>
An <dfn>integer</dfn> is a <a>Number</a> that is unchanged
under the <a>ToInteger</a> operation.

<p>
A <dfn>floating-point number</dfn> is a <a>Number</a> that is
produced by the <a>parseFloat</a> operation.

<p>
The <dfn>initial value</dfn> of an ECMAScript property
is the value defined by the platform for that property,
Expand Down Expand Up @@ -6888,8 +6892,7 @@ <h3 id=input-source-state>State</h3>
and <code>alt</code>, <code>shift</code>, <code>ctrl</code>,
and <code>meta</code> all set to <code>false</code>.

<p>
A <a>pointer input source</a>’s <a>input source state</a>
<p>A <a>pointer input source</a>’s <a>input source state</a>
is a <dfn>pointer input state</dfn> object.
This consists of a <code>subtype</code> property,
which has the possible values
Expand All @@ -6900,11 +6903,55 @@ <h3 id=input-source-state>State</h3>
an <code>x</code> property which is an unsigned integer,
and a <code>y</code> property which is an unsigned integer.

<p>Additionally, a <a>pointer input state</a> object also contains
<dfn>optional pointer properties</dfn> as shown in the table below
in accordance with the requirements of [[POINTER-EVENTS]].

<table class=simple>
<thead>
<tr>
<th>Property
<th>Type
</tr>
</thead>
<tr>
<td><code>width</code>
<td><a>floating-point number</a>
</tr>
<tr>
<td><code>height</code>
<td><a>floating-point number</a>
</tr>
<tr>
<td><code>pressure</code>
<td><a>floating-point number</a>
</tr>
<tr>
<td><code>tangentialPressure</code>
<td><a>floating-point number</a>
</tr>
<tr>
<td><code>tiltX</code>
<td><a>integer</a>
</tr>
<tr>
<td><code>tiltY</code>
<td><a>integer</a>
</tr>
<tr>
<td><code>twist</code>
<td><a>integer</a>
</tr>
</table>

<p>When required to <dfn>create a new pointer input state</dfn> object
with arguments <var>subtype</var> an implementation must return
a <a>pointer input state</a> object with <code>subtype</code> set
to <var>subtype</var>, <code>pressed</code> set to an empty set and
both <code>x</code> and <code>y</code> set to <code>0</code>.
to <var>subtype</var>, <code>pressed</code> set to an empty set,
both <code>x</code> and <code>y</code> set to <code>0</code>,
<code>width</code>, <code>height</code>, <code>pressure</code>,
<code>tangentialPressure</code>, <code>tiltX</code>, <code>tiltY</code>,
and <code>twist</code> set to <a>null</a>.

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

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

<li><p>
If <var>subtype</var> is "<code>pointerUp</code>" or "<code>pointerDown</code>"
or "<code>pointerMove</code>", <a>process optional pointer properties</a> with
arguments <var>action item</var> and <var>action</var>.
If doing so results in an <a>error</a>, return that <a>error</a>.

<li><p>
If <var>subtype</var> is "<code>pointerCancel</code>"
<span class=issue>process a pointer cancel action</span>.
Expand Down Expand Up @@ -7488,6 +7541,132 @@ <h2>Processing actions</h2>

<li><p>Return success with data <a>null</a>.
</ol>

<p>When required to <dfn>process optional pointer properties</dfn>
with arguments <var>action item</var>, and <var>action</var>, a
<a>remote end</a> must run the following steps in accordance with
the requirements of [[POINTER-EVENTS]]:</p>

<ol>
<li><p>Let <var>width</var> be the result
of getting the property <code>width</code>
from <var>action item</var>.

<li><p>If <var>width</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>width</var> is not a <a>Floating-Point Number</a> greater than or equal to 1,
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>width</code> property of <var>action</var>
to <var>width</var>.
</ol>

<li><p>Let <var>height</var> be the result
of getting the property <code>height</code>
from <var>action item</var>.

<li><p>If <var>height</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>height</var> is not a <a>Floating-Point Number</a> greater than or equal to 1,
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>height</code> property of <var>action</var>
to <var>height</var>.
</ol>

<li><p>If <var>width</var> is not <a>undefined</a> while
<var>height</var> is <a>undefined</a> or vice versa
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>Let <var>pressure</var> be the result
of getting the property <code>pressure</code>
from <var>action item</var>.

<li><p>If <var>pressure</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>pressure</var> is not a <a>Floating-Point Number</a> in the range of [0, 1]
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>pressure</code> property of <var>action</var>
to <var>pressure</var>.
</ol>

<li><p>Let <var>tangentialPressure</var> be the result
of getting the property <code>tangentialPressure</code>
from <var>action item</var>.

<li><p>If <var>tangentialPressure</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>tangentialPressure</var> is not a <a>Floating-Point Number</a>
in the range of [-1, 1]
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>tangentialPressure</code> property of <var>action</var>
to <var>tangentialPressure</var>.
</ol>

<li><p>Let <var>tiltX</var> be the result
of getting the property <code>tiltX</code>
from <var>action item</var>.

<li><p>If <var>tiltX</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>tiltX</var> is not an <a>Integer</a> in the range of [-90, 90]
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>tiltX</code> property of <var>action</var>
to <var>tiltX</var>.
</ol>

<li><p>Let <var>tiltY</var> be the result
of getting the property <code>tiltY</code>
from <var>action item</var>.

<li><p>If <var>tiltY</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>tiltY</var> is not an <a>Integer</a> in the range of [-90, 90]
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>tiltY</code> property of <var>action</var>
to <var>tiltY</var>.
</ol>

<li><p>Let <var>twist</var> be the result
of getting the property <code>twist</code>
from <var>action item</var>.

<li><p>If <var>twist</var> is not <a>undefined</a>:

<ol>
<li><p>
If <var>twist</var> is not an <a>Integer</a> in the range of [0, 359]
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>
Set the <code>twist</code> property of <var>action</var>
to <var>twist</var>.
</ol>

<li><p>Return success with data <a>null</a>.
</ol>
</section> <!-- /processing-actions -->


Expand Down Expand Up @@ -8100,6 +8279,9 @@ <h2>Pointer actions</h2>
<var>input state</var>’s <code>pressed</code> property, and
let <var>buttons</var> be the resulting value of that property.

<li><p><a>Set input state optional pointer properties</a> with
arguments <var>action object</var>, <var>input state</var>.

<li><p>Append a copy of <var>action object</var> with
the <var>subtype</var> property changed to <var>pointerUp</var> to
the <a>current session</a>’s <a>input cancel list</a>.
Expand All @@ -8109,7 +8291,9 @@ <h2>Pointer actions</h2>
numbered <var>button</var> on the pointer with ID
<var>source id</var>, having type <var>pointerType</var> at
viewport x coordinate <var>x</var>, viewport y
coordinate <var>y</var>, with buttons <var>buttons</var> depressed
coordinate <var>y</var>, with buttons <var>buttons</var> depressed,
and type specific properties set to the <var>input state</var>’s
<a>optional pointer properties</a> that are not <a>null</a>,
in accordance with the requirements of [[UI-EVENTS]] and
[[POINTER-EVENTS]]. The generated events must
set <code>ctrlKey</code>, <code>shiftKey</code>, <code>altKey</code>,
Expand Down Expand Up @@ -8147,6 +8331,9 @@ <h2>Pointer actions</h2>
<li><p>Let <var>y</var> be equal to <var>input state</var>’s
<code>y</code> property.

<li><p><a>Set input state optional pointer properties</a> with
arguments <var>action object</var>, <var>input state</var>.

<li><p>Remove <var>button</var> from the set corresponding
to <var>input state</var>’s <code>pressed</code> property, and
let <var>buttons</var> be the resulting value of that
Expand All @@ -8158,6 +8345,8 @@ <h2>Pointer actions</h2>
<var>source id</var> having type <var>pointerType</var> at
viewport x coordinate <var>x</var>, viewport y
coordinate <var>y</var>, with buttons <var>buttons</var> depressed,
and type specific properties set to the <var>input state</var>’s
<a>optional pointer properties</a> that are not <a>null</a>,
in accordance with the requirements of [[UI-EVENTS]] and
[[POINTER-EVENTS]]. The generated events must
set <code>ctrlKey</code>, <code>shiftKey</code>, <code>altKey</code>,
Expand Down Expand Up @@ -8235,6 +8424,9 @@ <h2>Pointer actions</h2>
return <a>error</a> with error code <a>move target out of
bounds</a>.

<li><p><a>Set input state optional pointer properties</a> with
arguments <var>action object</var>, <var>input state</var>.

<li><p>Let <var>duration</var> be equal to
<var>action object</var>’s <code>duration</code> property if it
is not <a>undefined</a>, or <var>tick duration</var>
Expand Down Expand Up @@ -8306,7 +8498,9 @@ <h2>Pointer actions</h2>
viewport x coordinate <var>current x</var>, viewport y
coordinate <var>y</var> to viewport x coordinate <var>x</var> and
viewport y coordinate <var>y</var>, with
buttons <var>buttons</var> depressed, in accordance with the
buttons <var>buttons</var> depressed, and type specific properties
set to the <var>input state</var>’s <a>optional pointer properties</a>
that are not <a>null</a>, in accordance with the
requirements of [[UI-EVENTS]] and [[POINTER-EVENTS]]. The
generated events must set <code>ctrlKey</code>, <code>shiftKey</code>,
<code>altKey</code>, and <code>metaKey</code> from the
Expand Down Expand Up @@ -8359,6 +8553,54 @@ <h2>Pointer actions</h2>

</ol>

<p>When required to <dfn>set input state optional pointer properties</dfn>
with arguments <var>action object</var>, <var>input state</var>,
an implementation must run the following steps:

<ol>
<li><p>Let <var>width</var> be equal to
<var>action object</var>’s <code>width</code> property.

<li><p>If <var>width</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>width</code> property equal <var>width</var>.

<li><p>Let <var>height</var> be equal to
<var>action object</var>’s <code>height</code> property.

<li><p>If <var>height</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>height</code> property equal <var>height</var>.

<li><p>Let <var>pressure</var> be equal to
<var>action object</var>’s <code>pressure</code> property.

<li><p>If <var>pressure</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>pressure</code> property equal <var>pressure</var>.

<li><p>Let <var>tangentialPressure</var> be equal to
<var>action object</var>’s <code>tangentialPressure</code> property.

<li><p>If <var>tangentialPressure</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>tangentialPressure</code> property equal <var>tangentialPressure</var>.

<li><p>Let <var>tiltX</var> be equal to
<var>action object</var>’s <code>tiltX</code> property.

<li><p>If <var>tiltX</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>tiltX</code> property equal <var>tiltX</var>.

<li><p>Let <var>tiltY</var> be equal to
<var>action object</var>’s <code>tiltY</code> property.

<li><p>If <var>tiltY</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>tiltY</code> property equal <var>tiltY</var>.

<li><p>Let <var>twist</var> be equal to
<var>action object</var>’s <code>twist</code> property.

<li><p>If <var>twist</var> is not <a>undefined</a>, let <var>input state</var>’s
<code>twist</code> property equal <var>twist</var>.
</ol>

<p>When required to <dfn>dispatch a pointerCancel action</dfn> with
arguments <var>source id</var>, <var>action object</var>,
<var>input state</var> and <var>tick duration</var> a
Expand Down Expand Up @@ -9168,6 +9410,7 @@ <h2>Acknowledgements</h2>
<!-- Sam Sneddon --> Sam Sneddon,
<!-- Seva Lotoshnikov --> Seva Lotoshnikov,
<!-- Simon Stewart --> <a href=http://www.rocketpoweredjetpants.com/>Simon Stewart</a>,
<!-- Timotius Arya Margo --> Timotius Arya Margo,
<!-- Titus Fortner --> Titus Fortner,
<!-- Vangelis Katsikaros --> and Vangelis Katsikaros.

Expand Down