Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit 219546b

Browse files
committed
Add constructors
Issue w3c/TouchEvents#10
1 parent 4082863 commit 219546b

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

touchevents.html

+44-4
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ <h2><a><code>Touch</code></a> Interface</h2>
266266
attributes must not change.
267267
</p>
268268

269-
<dl title='interface Touch' class='idl'>
269+
<dl title='[Constructor(TouchInit touchInitDict)] interface Touch' class='idl' data-merge='TouchInit'>
270270
<dt>readonly attribute long identifier</dt>
271271
<dd>
272272
An identification number for each <a>touch point</a>.
@@ -352,6 +352,29 @@ <h2><a><code>Touch</code></a> Interface</h2>
352352
the sensitivity in levels of pressure, may vary.
353353
</dd>
354354
</dl>
355+
356+
<dl title='dictionary TouchInit' class='idl'>
357+
<dt>required long identifier</dt>
358+
<dd>Initializes the <code>identifier</code> property of the <code>Touch</code> object.</dd>
359+
<dt>required EventTarget target</dt>
360+
<dd>Initializes the <code>identifier</code> property of the <code>Touch</code> object.</dd>
361+
<dt>double screenX = 0</dt>
362+
<dd>Initializes the <code>screenX</code> property of the <code>Touch</code> object.</dd>
363+
<dt>double screenY = 0</dt>
364+
<dd>Initializes the <code>screenY</code> property of the <code>Touch</code> object.</dd>
365+
<dt>double pageX = 0</dt>
366+
<dd>Initializes the <code>pageX</code> and <code>clientX</code> properties of the <code>Touch</code> object.</dd>
367+
<dt>double pageY = 0</dt>
368+
<dd>Initializes the <code>pageY</code> and <code>clientY</code> properties of the <code>Touch</code> object.</dd>
369+
<dt>float radiusX = 0</dt>
370+
<dd>Initializes the <code>radiusX</code> property of the <code>Touch</code> object.</dd>
371+
<dt>float radiusY = 0</dt>
372+
<dd>Initializes the <code>radiusY</code> property of the <code>Touch</code> object.</dd>
373+
<dt>float rotationAngle = 0</dt>
374+
<dd>Initializes the <code>rotationAngle</code> property of the <code>Touch</code> object.</dd>
375+
<dt>float force = 0</dt>
376+
<dd>Initializes the <code>force</code> property of the <code>Touch</code> object.</dd>
377+
</dl>
355378
</section>
356379

357380
<section>
@@ -393,7 +416,7 @@ <h2><a><code>TouchEvent</code></a> Interface</h2>
393416
initialized, its attributes must not change.
394417
</p>
395418

396-
<dl title='interface TouchEvent : UIEvent' class='idl'>
419+
<dl title='[Constructor(DOMString type, optional TouchEventInit eventInitDict)] interface TouchEvent : UIEvent' class='idl' data-merge='TouchEventInit'>
397420
<dt>readonly attribute <a><code>TouchList</code></a> touches</dt>
398421
<dd>
399422
a list of <a><code>Touch</code></a> objects for every point of contact currently
@@ -445,6 +468,23 @@ <h2><a><code>TouchEvent</code></a> Interface</h2>
445468
</dd>
446469
</dl>
447470

471+
<dl title='dictionary TouchEventInit : UIEventInit' class='idl'>
472+
<dt>sequence&lt;Touch&gt; touches = []</dt>
473+
<dd>Initializes the <code>touches</code> property of the <code>TouchEvent</code> object with each element from the sequence.</dd>
474+
<dt>sequence&lt;Touch&gt; targetTouches = []</dt>
475+
<dd>Initializes the <code>touches</code> property of the <code>TouchEvent</code> object with each element from the sequence.</dd>
476+
<dt>sequence&lt;Touch&gt; changedTouches = []</dt>
477+
<dd>Initializes the <code>touches</code> property of the <code>TouchEvent</code> object with each element from the sequence.</dd>
478+
<dt>boolean altKey</dt>
479+
<dd>Initializes the <code>altKey</code> property of the <code>TouchEvent</code> object.</dd>
480+
<dt>boolean metaKey</dt>
481+
<dd>Initializes the <code>metaKey</code> property of the <code>TouchEvent</code> object.</dd>
482+
<dt>boolean ctrlKey</dt>
483+
<dd>Initializes the <code>ctrlKey</code> property of the <code>TouchEvent</code> object.</dd>
484+
<dt>boolean shiftKey</dt>
485+
<dd>Initializes the <code>shiftKey</code> property of the <code>TouchEvent</code> object.</dd>
486+
</dl>
487+
448488
<section class="informative">
449489
<h2>TouchEvent Implementer's Note</h2>
450490
<div class="note">
@@ -781,8 +821,8 @@ <h2>Extensions to the <a><code>Document</code></a> Interface</h2>
781821
can use it to initialize the properties of a <a><code>TouchEvent</code></a> object,
782822
including its <a><code>TouchList</code></a> properties (which can be initialized
783823
with values returned from <a><code>createTouchList</code></a>). The
784-
<a><code>initTouchEvent</code></a> method is not yet standardized, but it may appear
785-
in some form in a future specification.
824+
<a><code>initTouchEvent</code></a> method is not yet standardized and will
825+
eventually be superceded by the <code>TouchEvent</code> constructor.
786826
</p>
787827
</section>
788828

0 commit comments

Comments
 (0)