ISSUE-10: Add a relatedTarget attribute to the TouchEvent interface.
authorMatt Brubeck <mbrubeck@mozilla.com>
Sun, 24 Apr 2011 21:29:55 -0700
changeset 43 fc6abcf8b74c
parent 42 49296bde5e04
child 44 ad7715ddbcda
ISSUE-10: Add a relatedTarget attribute to the TouchEvent interface.
test/touchevents/single-touch.html
touchevents.html
--- a/test/touchevents/single-touch.html	Sun Apr 24 21:28:56 2011 -0700
+++ b/test/touchevents/single-touch.html	Sun Apr 24 21:29:55 2011 -0700
@@ -17,6 +17,11 @@
         touchstart_received = true;
 
         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.");
+        }, "TouchEvent target attributes are correct.");
+
+        test(function() {
           assert_equals(ev.touches.length, 1, "One touch point.");
           assert_equals(ev.changedTouches.length, 1, "One changed touch point.");
           assert_equals(ev.targetTouches.length, 1, "One target touch point.");
--- a/touchevents.html	Sun Apr 24 21:28:56 2011 -0700
+++ b/touchevents.html	Sun Apr 24 21:29:55 2011 -0700
@@ -248,6 +248,15 @@
         <dd>
           <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>