Initial checkin for Touch Events version 1 v1
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 11 Aug 2011 15:27:48 -0700
branchv1
changeset 101 2d830a098494
parent 100 4bbe000815dd
child 104 01190a01b4cf
Initial checkin for Touch Events version 1

This version is limited to those parts of the specification that already have
interoperable implementations. The following events and attributes will not
be included in v1, but will appear in Touch Events v2:

* touchenter, touchleave, relatedTarget
* radiusX, radiusY, rotationAngle
* force
test/touchevents/single-touch.html
touchevents.html
--- a/test/touchevents/single-touch.html	Wed Aug 03 19:15:56 2011 +0900
+++ b/test/touchevents/single-touch.html	Thu Aug 11 15:27:48 2011 -0700
@@ -35,7 +35,6 @@
 
         test(function() {
           assert_true(ev.target instanceof Element, "target must be an Element.");
-          assert_equals(ev.relatedTarget, null, "relatedTarget must be null for touchstart event.");
         }, "touchstart TouchEvent target attributes are correct.");
 
         test(function() {
@@ -72,17 +71,6 @@
         }, "identifiedTouch");
 
         test(function() {
-          assert_true(t.rotationAngle >= 0, "rotationAngle must be >= 0.");
-          assert_true(t.rotationAngle < 90, "rotationAngle must be > 90.");
-
-          assert_true(t.radiusX > 0, "radiusX is positive.");
-          assert_true(t.radiusY > 0, "radiusY is positive.");
-
-          assert_true(t.force >= 0, "force >= 0.");
-          assert_true(t.force <= 1, "force <= 1.");
-        }, "Touch attribute values are valid");
-
-        test(function() {
           var attrs = ["screenX", "screenY", "clientX", "clientY",
                        "pageX", "pageY"];
           for (var i = 0; i < attrs.length; i++) {
@@ -153,17 +141,6 @@
         }, "touchend identifier matches.");
 
         test(function() {
-          assert_true(t.rotationAngle >= 0, "rotationAngle must be >= 0.");
-          assert_true(t.rotationAngle < 90, "rotationAngle must be > 90.");
-
-          assert_true(t.radiusX > 0, "radiusX is positive.");
-          assert_true(t.radiusY > 0, "radiusY is positive.");
-
-          assert_true(t.force >= 0, "force >= 0.");
-          assert_true(t.force <= 1, "force <= 1.");
-        }, "Touch attribute values are valid");
-
-        test(function() {
           var attrs = ["screenX", "screenY", "clientX", "clientY",
                        "pageX", "pageY"];
           for (var i = 0; i < attrs.length; i++) {
--- a/touchevents.html	Wed Aug 03 19:15:56 2011 +0900
+++ b/touchevents.html	Thu Aug 11 15:27:48 2011 -0700
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
   <head>
-    <title>Touch Events Specification</title>
+    <title>Touch Events version 1</title>
     <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
     <meta name="viewport" content="width=device-width">
     <!--
@@ -23,7 +23,7 @@
           // subtitle   :  "an excellent document",
 
           // if you wish the publication date to be other than today, set this
-          publishDate:  "2011-07-19",
+          publishDate:  "2011-08-11",
 
           // if the specification's copyright date is a range of years, specify
           // the start date here:
@@ -198,60 +198,6 @@
           y-coordinate of point relative to the viewport, including any scroll
           offset
         </dd>
-
-        <dt>readonly attribute long radiusX</dt>
-        <dd>
-          the radius of the ellipse which most closely circumscribes the
-          touching area (e.g. finger, stylus) along the x-axis, in pixels of
-          the same scale as <a>screenX</a>; <code>1</code> if no value is
-          known.  The value must be positive.
-          <p class="issue" id="issue-units"><strong>Issue:</strong> What are
-          units of radiusX/radiusY?  CSS Pixels?</p>
-        </dd>
-        <dt>readonly attribute long radiusY</dt>
-        <dd>
-          the radius of the ellipse which most closely circumscribes the
-          touching area (e.g. finger, stylus) along the y-axis, in pixels of
-          the same scale as <a>screenY</a>; <code>1</code> if no value is
-          known.  The value must be positive.
-        </dd>
-
-        <dt>readonly attribute float rotationAngle</dt>
-        <dd>
-          <p>
-            the angle (in degrees) that the ellipse described by <a>radiusX</a>
-            and <a>radiusY</a> is rotated clockwise about its center;
-            <code>0</code> if no value is known.  The value must be greater
-            than or equal to <code>0</code> and less than <code>90</code>.
-          </p>
-          <p>
-            If the ellipse described by <a>radiusX</a> and <a>radiusY</a> is
-            circular, then <a>rotationAngle</a> has no effect.  The user agent
-            may use <code>0</code> as the value in this case, or it may use any
-            other value in the allowed range.  (For example, the user agent may
-            use the <a>rotationAngle</a> value from the previous touch event,
-            to avoid sudden changes.)
-          </p>
-        </dd>
-
-        <dt>readonly attribute float force</dt>
-        <dd>
-          a relative value of pressure applied, in the range <code>0</code> to
-          <code>1</code>, where <code>0</code> is no pressure, and
-          <code>1</code> is the highest level of pressure the touch device is
-          capable of sensing; <code>0</code> if no value is known.  In
-          environments where <a>force</a> is known, the absolute pressure
-          represented by the <a>force</a> attribute, and the sensitivity in
-          levels of pressure, may vary.
-
-          <p class="issue" id="issue-inkml">
-            <strong>Issue:</strong>
-            Consider aligning with other "channels" and values from
-            <a href="http://www.w3.org/TR/InkML/#channelContents">Ink Markup
-            Language (InkML)</a>, in addition to <a>force</a>, e.g. adding
-            <a>angle</a>, <a>clientZ</a>, <a>rotation</a>, etc.
-          </p>
-        </dd>
       </dl>
     </section>
 
@@ -284,8 +230,7 @@
       <h2><a>TouchEvent</a> Interface</h2>
       <p>
         This interface defines the <a>touchstart</a>, <a>touchend</a>,
-        <a>touchmove</a>, <a>touchenter</a>, <a>touchleave</a>, and
-        <a>touchcancel</a> event types.
+        <a>touchmove</a>, and <a>touchcancel</a> event types.
       </p>
 
       <dl title='interface TouchEvent : UIEvent' class='idl'>
@@ -312,9 +257,7 @@
             <a>touchmove</a> event this must be a list of the touch points that
             have moved since the last event.  For the <a>touchend</a> event
             this must be a list of the touch points that have just been removed
-            from the surface.  For the <a>touchenter</a> and <a>touchleave</a>
-            events, this must be a list of the touch points that have just
-            entered or left the target element.
+            from the surface.
           </p>
         </dd>
 
@@ -339,15 +282,6 @@
           <code>true</code> if the shift (Shift) key modifier is activated;
           otherwise <code>false</code>
         </dd>
-        <dt>readonly attribute EventTarget relatedTarget</dt>
-        <dd>
-          identifies a secondary EventTarget related to a touch event.  This
-          attribute is used with the <a>touchenter</a> event to indicate the
-          <a>EventTarget</a> the touch point exited, and with the
-          <a>touchleave</a> event to indicate the <a>EventTarget</a> the touch
-          point entered.  For other event types, this attribute must be
-          <code>null</code>.
-        </dd>
 
         <!-- Methods -->
         <dt>void initTouchEvent()</dt>
@@ -532,13 +466,6 @@
         </p>
 
         <p>
-          If the values of <a>radiusX</a>, <a>radiusY</a>,
-          <a>rotationAngle</a>, or <a>force</a> are known, then the user agent
-          also must dispatch this event type to indicate when any of these
-          attributes of a <a>touch point</a> have changed.
-        </p>
-
-        <p>
           Note that the rate at which the user agent sends <a>touchmove</a>
           events is implementation-defined, and may depend on hardware
           capabilities and other implementation details.
@@ -553,24 +480,6 @@
       </section>
 
       <section>
-        <h3 id="event-touchenter">The <dfn class="event">touchenter</dfn> event</h3>
-        <p>
-          A user agent must dispatch this event type to indicate when a
-          <a>touch point</a> moves onto the interactive area defined by a DOM
-          element.  Events of this type must not bubble.
-        </p>
-      </section>
-
-      <section>
-        <h3 id="event-touchleave">The <dfn class="event">touchleave</dfn> event</h3>
-        <p>
-          A user agent must dispatch this event type to indicate when a
-          <a>touch point</a> moves off the interactive area defined by a DOM
-          element.  Events of this type must not bubble.
-        </p>
-      </section>
-
-      <section>
         <h3 id="event-touchcancel">The <dfn class="event">touchcancel</dfn> event</h3>
         <p>
           A user agent must dispatch this event type to indicate when a touch
@@ -608,10 +517,6 @@
             <dt>long pageY</dt> <dd></dd>
             <dt>long screenX</dt> <dd></dd>
             <dt>long screenY</dt> <dd></dd>
-            <dt>optional long radiusX</dt> <dd></dd>
-            <dt>optional long radiusY</dt> <dd></dd>
-            <dt>optional float rotationAngle</dt> <dd></dd>
-            <dt>optional float force</dt> <dd></dd>
           </dl>
         </dd>