touchevents.html
author Tim Dresser <tdresser@chromium.org>
Thu, 24 Jul 2014 12:47:06 -0400
branchv1-errata
changeset 229 0c110aed1866
parent 228 e52f9e5c93cd
child 230 bca491d2ba3f
permissions -rw-r--r--
Update touchmove behavior on preventDefault

Based on discussion here:
http://lists.w3.org/Archives/Public/public-touchevents/2014Jul/0020.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Touch Events</title>
    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
    <meta name="viewport" content="width=device-width">
    <!--
      === NOTA BENE ===
      For the three scripts below, if your spec resides on dev.w3 you can check them
      out in the same tree and use relative links so that they'll work offline,
     -->
    <script src='https://www.w3.org/Tools/respec/respec-w3c-common.js' class='remove'></script>
    <script type="text/javascript" class='remove'>
      var respecConfig = {
          // specification status (e.g. WD, LC, NOTE, etc.). If in doubt use ED.
          specStatus:           "ED",

          // the specification's short name, as in http://www.w3.org/TR/short-name/
          shortName:            "touch-events",

          // if your specification has a subtitle that goes below the main
          // formal title, define it here
          // subtitle   :  "an excellent document",

          // if you wish the publication date to be other than today, set this
          publishDate:  "2014-05-29",

          // if the specification's copyright date is a range of years, specify
          // the start date here:
          // copyrightStart: "2005"

          // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
          // and its maturity status
          previousPublishDate:  "2013-05-09",
          previousMaturity:  "PR",

          // if there a publicly available Editor's Draft, this is the link
          edDraftURI:           "http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html",

          // if this is a LCWD, uncomment and set the end of its review period
          // lcEnd: "2013-02-14",
          // prEnd: "2013-06-06",

          // if you want to have extra CSS, append them to this list
          // it is recommended that the respec.css stylesheet be kept
          extraCSS:             ["http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],

          // editors, add as many as you like
          // only "name" is required
          editors:  [
              { name: "Doug Schepers", url: "http://schepers.cc/",
                company: "W3C", companyURL: "http://w3.org/" },
              { name: "Sangwhan Moon",
                company: "Opera Software ASA", companyURL: "http://www.opera.com/" },
              { name: "Matt Brubeck", url: "http://limpet.net/mbrubeck/",
                company: "Mozilla", companyURL: "http://www.mozilla.org/" },
              { name: "Arthur Barstow", 
                company: "Nokia", companyURL: "http://www.nokia.com/" },
          ],

          // authors, add as many as you like.
          // This is optional, uncomment if you have authors as well as editors.
          // only "name" is required. Same format as editors.

          //authors:  [
          //    { name: "Your Name", url: "http://example.org/",
          //      company: "Your Company", companyURL: "http://example.com/" },
          //],

          // name of the WG
          wg:           "Web Events Working Group",

          // URI of the public WG page
          wgURI:        "http://www.w3.org/2010/webevents/",

          // name (with the @w3c.org) of the public mailing to which comments are due
          wgPublicList: "public-touchevents",

          // URI of the patent status for this WG, for Rec-track documents
          // !!!! IMPORTANT !!!!
          // This is important for Rec-track documents, do not copy a patent URI from a random
          // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
          // Team Contact.
          wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/45559/status",
      };
    </script>
    <script type="text/javascript" id="fixuphook">
    (function () {
        // Hacky fix-up hook to patch up return types generated by respec.js, as special
        // operations like the ones in specialOps are not officially supported.
        var specialOps = ['getter ', 'setter ', 'creator ', 'deleter ', 'caller ', 'omittable '];
        var fixUpCaller = window.setInterval(function() {
            
            // Check if respec.js is done.
            var respecJS = document.querySelectorAll(".remove");
            if (respecJS.length > 0) return;
            
            else
            {
                // Performance-wise, this is a stupid idea. For long specs it's probably
                // going to take a *extremely* long time to finish. You have been warned.
                var tags = document.getElementsByTagName('a');
            
                for (var i = 0; i < tags.length; i++)
                    for (var j = 0; j < specialOps.length; j++)
                        if (tags[i].textContent.indexOf(specialOps[j]) === 0 &&
                            tags[i].parentNode.previousSibling.textContent.indexOf('Return type:') !== -1)
                            tags[i].textContent = tags[i].textContent.substring(specialOps[j].length - 1);
                
                // Clean-up script element and interval caller
                var fixUpEl = document.getElementById('fixuphook');
                fixUpEl.parentNode.removeChild(fixUpEl);
                
                window.clearInterval(fixUpCaller);
            }
        }, 100);
    })();
    </script>

    <style type="text/css">
      .event {
        font-family: monospace;
        color: #459900;
      }

      pre.idl {
        white-space: pre-wrap;
      }
    </style>
  </head>
  <body>
    <section id='sotd'>
     By publishing this Recommendation, W3C expects that the functionality
     specified in this Touch Interface Recommendation will not be affected by
     changes to HTML5 or Web IDL as those specifications proceed to
     Recommendation.

     The WG has completed and approved this specification's 
     <a href="http://w3c-test.org/webevents/tests/touch-events-v1/approved/">Test Suite</a> 
     and created an 
     <a href="http://www.w3.org/2010/webevents/wiki/TEv1ImplReport">
     Implementation Report</a> that shows that two or more independent implementations 
     pass each test.
    </section>

    <section id='abstract'>
      The Touch Events specification defines a set of low-level events that
      represent one or more points of contact with a touch-sensitive surface,
      and changes of those points with respect to the surface and any DOM
      elements displayed upon it (e.g. for touch screens) or associated with it
      (e.g. for drawing tablets without displays).  It also addresses
      pen-tablet devices, such as drawing tablets, with consideration toward
      stylus capabilities.
    </section>

    <section id='introduction' class='informative'>
      <h2>Introduction</h2>

      <p>
        User Agents that run on terminals which provide touch input to use web
        applications typically use interpreted mouse events to allow users
        to access interactive web applications. However, these interpreted
        events, being normalized data based on the physical touch input, tend
        to have limitations on delivering the intended user experience.
        Additionally, it is not possible to handle concurrent input regardless
        of device capability, due to constraints of mouse events: both
        system level limitations and legacy compatibility.
      </p>

      <p>
        Meanwhile, native applications are capable of handling both cases with
        the provided system APIs.
      </p>

      <p>
        The Touch Events specification provides a solution to this problem by
        specifying interfaces to allow web applications to directly handle touch
        events, and multiple touch points for capable devices.
      </p>

      <p class="note">
        The W3C's <a href="http://www.w3.org/WAI/PF/">
        Protocols and Formats Working Group</a> created a non-normative document 
        that includes a mapping of hardware events (e.g. keyboard events) to touch 
        events. For more information see 
        <a href="http://www.w3.org/WAI/PF/wiki/Touch_Events_Accessibility_Mapping">
        Touch Events Accessibility Mapping</a>.
      </p>

    </section>

    <section id='conformance'>
      <p>
        This specification defines conformance criteria that apply to a single
        product: the <dfn id="dfn-user-agent">user agent</dfn> that implements
        the interfaces that it contains.
      </p>

      <p>
        WindowProxy is defined in [[!HTML5]].
      </p>


        <h3 id="webidl-conform">WebIDL Conformance</h3>
        <p>
          The IDL blocks in this specification are conforming IDL 
          fragments as defined by the WebIDL specification [[!WEBIDL]].
        </p>

        <p>
          A conforming Web Events user agent must also be a <a href="http://www.w3.org/TR/WebIDL/#dfn-conforming-ECMAScript-implementation">conforming ECMAScript implementation</a> of this IDL fragments in this specification, with the following exception:</p>

        <ul>
          <li>
            <a href="http://www.w3.org/TR/WebIDL/#es-attributes">section 4.4.6
            of Web IDL</a> requires that IDL attributes are reflected as
            accessor properties on interface prototype objects.  Instead of
            this, the user agent may reflect IDL attributes as data properties
            on the platform objects that implement the relevant interface.
            These data properties must have the same behavior when getting and
            setting as would be exhibited when invoking the getter and setter
            of the accessor properties on the platform object.
          </li>
        </ul>
      <p>
        <strong>Note:</strong> Both ways of reflecting IDL attributes allow for simply getting and setting the property on the platform object to work.  For example, given a Touch object aTouch, evaluating aTouch.target would return the EventTarget for the Touch object.  If the user agent implements IDL attributes as accessor properties, then the property access invokes the getter which returns the EventTarget.  If the user agent implements IDL attributes as data properties on the platform object with the same behavior as would be found with the accessor properties, then the object would appear to have an own property named "target" whose value is an EventTarget object, and the property access would return this value.
      </p>
    </section>

    <section>
      <h2><a>Touch</a> Interface</h2>
      <p>
        This interface describes an individual <a>touch point</a> for a touch
        event.  <a>Touch</a> objects are immutable; after one is created, its
        attributes must not change.
      </p>

      <dl title='interface Touch' class='idl'>
        <dt>readonly attribute long identifier</dt>
        <dd>
          An identification number for each <a>touch point</a>.

          When a touch point becomes active, it must be assigned an
          <a>identifier</a> that is distinct from any other <a>active touch
          point</a>.  While the touch point remains active, all events that
          refer to it must assign it the same <a>identifier</a>.
        </dd>

        <dt>readonly attribute EventTarget target</dt>
        <dd>
          The <a>EventTarget</a> on which the <a>touch point</a> started when it
          was first placed on the surface, even if the <a>touch point</a> has
          since moved outside the interactive area of that element.
        </dd>

        <dt>readonly attribute double screenX</dt>
        <dd>
          The horizontal coordinate of point relative to the screen in pixels
        </dd>
        <dt>readonly attribute double screenY</dt>
        <dd>
          The vertical coordinate of point relative to the screen in pixels
        </dd>

        <dt>readonly attribute double clientX</dt>
        <dd>
          The horizontal coordinate of point relative to the viewport in pixels,
          excluding any scroll offset
        </dd>
        <dt>readonly attribute double clientY</dt>
        <dd>
          The vertical coordinate of point relative to the viewport in pixels,
          excluding any scroll offset
        </dd>

        <dt>readonly attribute double pageX</dt>
        <dd>
          The horizontal coordinate of point relative to the viewport in pixels,
          including any scroll offset
        </dd>
        <dt>readonly attribute double pageY</dt>
        <dd>
          The vertical coordinate of point relative to the viewport in pixels,
          including any scroll offset
        </dd>
      </dl>
    </section>

    <section>
      <h2><a>TouchList</a> Interface</h2>
      <p>
        This interface defines a list of individual points of contact for a
        touch event.  <a>TouchList</a> objects are immutable; after one is
        created, its contents must not change.
      </p>
      <p>
        A TouchList object's <em>supported property indices</em> ([[!WEBIDL]])
        are the numbers in the range 0 to one less than the length of the list. 
      </p>

      <dl title='interface TouchList' class='idl'>
        <dt>readonly attribute unsigned long length</dt>
        <dd>
          returns the number of <a>Touch</a>es in the list
        </dd>
        <dt>getter <a>Touch</a>? item (in unsigned long index)</dt>
        <dd>
          returns the <a>Touch</a> at the specified index in the list or
          null if the index is not less than the length of the list. 
        </dd>
      </dl>
    </section>

    <section>
      <h2><a>TouchEvent</a> Interface</h2>
      <p>
        This interface defines the <a>touchstart</a>, <a>touchend</a>,
        <a>touchmove</a>, and <a>touchcancel</a> event types.
        <a>TouchEvent</a> objects are immutable; after one is created and
        initialized, its attributes must not change.
      </p>

      <dl title='interface TouchEvent : UIEvent' class='idl'>
        <dt>readonly attribute <a>TouchList</a> touches</dt>
        <dd>
          a list of <a>Touch</a>es for every point of contact currently
          touching the surface.
        </dd>
        <dt>readonly attribute <a>TouchList</a> targetTouches</dt>
        <dd>
          a list of <a>Touch</a>es for every point of contact that is touching
          the surface <em>and</em> started on the element that is the
          <a>target</a> of the current event.
        </dd>
        <dt>readonly attribute <a>TouchList</a> changedTouches</dt>
        <dd>
          <p>
            a list of <a>Touch</a>es for every point of contact which contributed
            to the event.
          </p>
          <p>
            For the <a>touchstart</a> event this must be a list of the touch
            points that just became active with the current event.  For the
            <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> and 
			<a>touchcancel</a> events this must be a list of the touch points 
			that have just been removed from the surface.
          </p>
        </dd>

        <dt>readonly attribute boolean altKey</dt>
        <dd>
          <code>true</code> if the alt (Alternate) key modifier is activated;
          otherwise <code>false</code>
        </dd>
        <dt>readonly attribute boolean metaKey</dt>
        <dd>
          <code>true</code> if the meta (Meta) key modifier is activated;
          otherwise <code>false</code>.  On some platforms this attribute may
          map to a differently-named key modifier.
        </dd>
        <dt>readonly attribute boolean ctrlKey</dt>
        <dd>
          <code>true</code> if the ctrl (Control) key modifier is activated;
          otherwise <code>false</code>
        </dd>
        <dt>readonly attribute boolean shiftKey</dt>
        <dd>
          <code>true</code> if the shift (Shift) key modifier is activated;
          otherwise <code>false</code>
        </dd>
      </dl>

      <section class="informative">
       <h2>TouchEvent Implementer's Note</h2>
       <div class="note">
        <p>User agents should ensure that all <a>Touch</a> objects available from a given 
        <a>TouchEvent</a> are all associated to the same document that the <a>TouchEvent</a> was dispatched 
        to. To implement this, user agents should maintain a notion of the current 
        <em>touch-active</em> document. On first touch, this is set to the target document 
        where the touch was created. When all active touch points are released, the 
        <em>touch-active</em> document is cleared. All <a>TouchEvent</a>s are dispatched to the 
        current <em>touch-active</em> document, and each <a>Touch</a> object it contains refers 
        only to DOM elements (and co-ordinates) in that document. If a touch starts entirely 
        outside the currently <em>touch-active</em> document, then it is ignored entirely. </p>
       </div> 
      </section>
      
      <section class="informative">
          <h2>Usage Examples</h2>
          
          <p>
            The examples below demonstrate the relations between the different
            <a>TouchList</a> members defined in a <a>TouchEvent</a>.
          </p>
          
          <section>
              <h3>touches and targetTouches of a <a>TouchEvent</a></h3>
              
              <p>
                This example demonstrates the utility and relations between the
                touches and targetTouches members defined in the <a>TouchEvent</a>
                interface. The following code will generate different output based
                on the number of touch points on the touchable element and the document:
              </p>
      
              <pre class="example">
                  &lt;div id='touchable'&gt;
                      This element is touchable.
                  &lt;/div&gt;
          
                  document.getElementById('touchable').addEventListener('touchstart', function(ev) {

                      if (ev.touches.item(0) == ev.targetTouches.item(0))
                      {
                          /**
                           * If the first touch on the surface is also targeting the
                           * "touchable" element, the code below should execute.
                           * Since targetTouches is a subset of touches which covers the
                           * entire surface, TouchEvent.touches >= TouchEvents.targetTouches
                           * is always true.
                           */

                          document.write('Hello Touch Events!');
                      }

                      if (ev.touches.length == ev.targetTouches.length)
                      {
                          /**
                           * If all of the active touch points are on the "touchable"
                           * element, the length properties should be the same.
                           */

                          document.write('All points are on target element')
                      }

                      if (ev.touches.length > 1)
                      {
                          /**
                           * On a single touch input device, there can only be one point
                           * of contact on the surface, so the following code can only
                           * execute when the terminal supports multiple touches.
                           */

                          document.write('Hello Multiple Touch!');
                      }

                  }, false);
              </pre>
          </section>
          
          <section>
              <h3>changedTouches of a <a>TouchEvent</a></h3>
              
              <p>
                This example demonstrates the utility of changedTouches and it's relation
                with the other <a>TouchList</a> members of the <a>TouchEvent</a> interface.
                The code is a example which triggers whenever a touch point is removed
                from the defined touchable element:
              </p>
              
              <pre class="example">
                  &lt;div id='touchable'&gt;
                      This element is touchable.
                  &lt;/div&gt;
              
                  document.getElementById('touchable').addEventListener('touchend', function(ev) {

                      /**
                       * Example output when three touch points are on the surface,
                       * two of them being on the "touchable" element and one point
                       * in the "touchable" element is lifted from the surface:
                       *
                       * Touch points removed: 1
                       * Touch points left on element: 1
                       * Touch points left on document: 2
                       */

                      document.write('Removed: ' + ev.changedTouches.length);
                      document.write('Remaining on element: ' + ev.targetTouches.length);
                      document.write('Remaining on document: ' + ev.touches.length);

                  }, false);
              </pre>
          </section>
              
      </section>

      <section class="informative">
          <h2>List of <a>TouchEvent</a> types</h2>

          <p>
            The following table provides a summary of the types of possible
            <a>TouchEvent</a> types defined in this specification. All events
            should accomplish the bubbling phase. Some events are not cancelable
            (see <a>preventDefault</a>).
          </p>
          
          <!--
          // FIXME: As of the time of writing, respec.js doesn't have support for
          // tables like this - we're just piggybacking on a existing class, with
          // raw markup as a quick and dirty workaround.
          -->

          <table class="parameters" id="table-event-summary">
          <tr>
              <th>Event Type</th>
              <th>Sync / Async</th>
              <th>Bubbling phase</th>
              <th>Trusted proximal event target types</th>
              <th>DOM interface</th>
              <th>Cancelable</th>
              <th>Default Action</th>
          </tr>
          <tr> 
              <td><a>touchstart</a></td> 
              <td>Sync</td> 
              <td>Yes</td> 
              <td><code>Document, Element</code></td> 
              <td><a>TouchEvent</a></td> 
              <td>Yes</td> 
              <td>undefined</td> 
          </tr>
          <tr> 
              <td><a>touchend</a></td> 
              <td>Sync</td> 
              <td>Yes</td> 
              <td><code>Document, Element</code></td> 
              <td><a>TouchEvent</a></td> 
              <td>Yes</td> 
              <td>
                Varies: mousemove (If point has been moved), mousedown, 
                mouseup, click
              </td> 
          </tr>
          <tr> 
              <td><a>touchmove</a></td> 
              <td>Sync</td> 
              <td>Yes</td> 
              <td><code>Document, Element</code></td> 
              <td><a>TouchEvent</a></td> 
              <td>Yes</td> 
              <td>undefined</td> 
          </tr>
          <tr> 
              <td><a>touchcancel</a></td> 
              <td>Sync</td> 
              <td>Yes</td> 
              <td><code>Document, Element</code></td> 
              <td><a>TouchEvent</a></td> 
              <td>No</td> 
              <td>none</td> 
          </tr>
          </table>
      </section>
 
      <section>
        <h3 id="event-touchstart">The <dfn class="event">touchstart</dfn>
        event</h3>
        <p>
          A user agent must dispatch this event type to indicate when the user
          places a <a>touch point</a> on the touch surface.
        </p>

        <p>
          The target of this event must be an <a>Element</a>.  If the touch
          point is within a frame, the event should be dispatched to an element
          in the <a>child browsing context</a> of that frame.
        </p>

        <p>
          If the <a>preventDefault</a> method is called on this event, it
          should prevent any default actions caused by any touch events
          associated with the same <a>active touch point</a>, including mouse
          events or scrolling.
        </p>
      </section>

      <section>
        <h3 id="event-touchend">The <dfn class="event">touchend</dfn> event</h3>
        <p>
          A user agent must dispatch this event type to indicate when the user
          removes a <a>touch point</a> from the touch surface, also including
          cases where the touch point physically leaves the touch surface, such
          as being dragged off of the screen.
        </p>

        <p>
          The <a>target</a> of this event must be the same <a>Element</a> on 
		  which the <a>touch point</a> started when it was first
          placed on the surface, even if the <a>touch point</a> has since moved
          outside the interactive area of the <a>target</a> element.
        </p>

        <p>
          The <a>touch point</a> or points that were removed must be included
          in the <a>changedTouches</a> attribute of the <a>TouchEvent</a>, and
          must not be included in the <a>touches</a> and <a>targetTouches</a>
          attributes.
        </p>
      </section>

      <section>
        <h3 id="event-touchmove">The <dfn class="event">touchmove</dfn> event</h3>
        <p>
          A user agent must dispatch this event type to indicate when the user
          moves a <a>touch point</a> along the touch surface.
        </p>

        <p>
          The <a>target</a> of this event must be the same <a>Element</a> on 
		  which the <a>touch point</a> started when it was first
          placed on the surface, even if the <a>touch point</a> has since moved
          outside the interactive area of the <a>target</a> element.
        </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.
        </p>

        <p>
          A user agent should suppress the default action caused by
          any <a>touchmove</a> event until at least one <a>touchmove</a> event
          associated with the same <a>active touch point</a> is not
          cancelled. Whether the default action is suppressed
          for <a>touchmove</a> events after at least one <a>touchmove</a> event
          associated with the same <a>active touch point</a> is not cancelled is
          implementation dependent.
        </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
          point has been disrupted in an implementation-specific manner, such as
          a synchronous event or action originating from the UA canceling the
          touch, or the touch point leaving the document window into a
          non-document area which is capable of handling user interactions.
          (e.g. The UA's native user interface, plug-ins)  A user agent may
          also dispatch this event type when the user places more <a>touch
          point</a>s on the touch surface than the device or implementation is
          configured to store, in which case the earliest <a>Touch</a> object
          in the <a>TouchList</a> should be removed.
        </p>

        <p>
          The <a>target</a> of this event must be the same <a>Element</a> on 
		  which the <a>touch point</a> started when it was first
          placed on the surface, even if the <a>touch point</a> has since moved
          outside the interactive area of the <a>target</a> element.
        </p>

        <p>
          The <a>touch point</a> or points that were removed must be included
          in the <a>changedTouches</a> attribute of the <a>TouchEvent</a>, and
          must not be included in the <a>touches</a> and <a>targetTouches</a>
          attributes.
        </p>
      </section>
    </section>

    <section>
      <h2>Extensions to the <a>Document</a> Interface</h2>
      <p>
        The <a>Document</a> interface [[!DOM-LEVEL-3-CORE]] contains methods
        by which the user can create <a>Touch</a> and <a>TouchList</a>
        objects.
      </p>

      <dl title='partial interface Document' class='idl'>
        <dt>Touch createTouch()</dt>
        <dd>
          Creates a <a>Touch</a> object with the specified attributes.
          <dl class='parameters'>
            <dt>WindowProxy view</dt> <dd></dd>
            <dt>EventTarget target</dt> <dd></dd>
            <dt>long identifier</dt> <dd></dd>
            <dt>double pageX</dt> <dd></dd>
            <dt>double pageY</dt> <dd></dd>
            <dt>double screenX</dt> <dd></dd>
            <dt>double screenY</dt> <dd></dd>
          </dl>
        </dd>

        <dt>TouchList createTouchList()</dt>
        <dd>
          Creates a <a>TouchList</a> object consisting of zero or more <a>Touch</a> objects.
          Calling this method with no arguments creates a <a>TouchList</a> with no objects in it 
          and length 0 (zero). 
          <dl class='parameters'>
            <dt>Touch... touches</dt> <dd></dd>
          </dl>
        </dd>
      </dl>

      <p class="note">
        Some user agents implement an initTouchEvent method as part of the
        <a>TouchEvent</a> interface.  When this method is available, scripts
        can use it to initialize the properties of a <a>TouchEvent</a> object,
        including its <a>TouchList</a> properties (which can be initialized
        with values returned from <a>createTouchList</a>).  The
        <a>initTouchEvent</a> method is not yet standardized, but it may appear
        in some form in a future specification.
      </p>
    </section>

    <section id="mouse-events">
      <h2>Interaction with Mouse Events</h2>
      <p>
        The user agent may dispatch both touch events and mouse events
        [[!DOM-LEVEL-2-EVENTS]] in response to the same user input.  If the
        user agent dispatches both touch events and mouse events in response to
        a single user action, then the <a>touchstart</a> event type must be
        dispatched before any mouse event types for that action.  If the
        <a>preventDefault</a> method of <a>touchstart</a> or <a>touchmove</a>
        is called, the user agent should not dispatch any mouse event that
        would be a consequential result of the the prevented touch event.
      </p>

      <p class="note">
        If a Web application can process touch events, it can intercept them, 
        and no corresponding mouse events would need to be dispatched by the 
        user agent. If the Web application is not specifically written for 
        touch input devices, it can react to the subsequent mouse events instead.
      </p>

      <p>
        If the user agent intreprets a sequence of touch events as a click,
        then it should dispatch <a>mousemove</a>, <a>mousedown</a>,
        <a>mouseup</a>, and <a>click</a> events (in that order) at the location
        of the <a>touchend</a> event for the corresponding touch input.  If the
        contents of the document have changed during processing of the touch
        events, then the user agent may dispatch the mouse events to a
        different target than the touch events.
      </p>

      <p>
        The default actions and ordering of any further touch and mouse events
        are implementation-defined, except as specified elsewhere.
      </p>
    </section>

    <section>
      <h2>Glossary</h2>

      <dl>
        <dt><dfn>active touch point</dfn></dt>
        <dd>
          A <a>touch point</a> which is currently on the screen and is being
          tracked by the user agent.  The touch point becomes active when the
          user agent first dispatches a <a>touchstart</a> event indicating its
          appearance.  It ceases to be active after the user agent dispatches a
          <a>touchend</a> or <a>touchcancel</a> event indicating that the touch
          point is removed from the surface or no longer tracked.
        </dd>

        <dt><dfn>touch point</dfn></dt>
        <dd>
          The coordinate point at which a pointer (e.g finger or stylus)
          intersects the target surface of an interface.  This may apply to a
          finger touching a touch-screen, or an digital pen writing on a piece
          of paper.
        </dd>
        
        <dt><dfn>preventDefault</dfn></dt>
        <dd>
          If a event is cancelable, the preventDefault method is used to signify
          that the event is to be canceled, and any default actions defined in the
          user agent as a result of this event, or consequential events from the
          canceled event will not occur. Calling this method on non-cancelable
          events will have no effect.
        </dd>        
      </dl>
    </section>

    <section id='issues' class='informative'>
      <h2>Issues</h2>
      <p>
        The working group maintains <a
         href='http://www.w3.org/2010/webevents/track/issues/open'
        >a list of open issues in this specification</a>.  These issues may be
        addressed in future revisions of the specification.
      </p>
    </section>

    <section class='appendix informative'>
      <h2>Acknowledgements</h2>
      <p>
        Many thanks to the WebKit engineers for developing the model used as a
        basis for this spec, Neil Roberts (SitePen) for his summary of WebKit
        touch events, Peter-Paul Koch (PPK) for his write-ups and suggestions,
        Robin Berjon for developing the <a
          href="http://dev.w3.org/2009/dap/ReSpec.js/documentation.html"
        >ReSpec.js spec authoring tool</a>, and the WebEvents WG for their many
        contributions.
      </p>

      <p>
        Many others have made additional comments as the spec developed, which
        have led to steady improvements.  Among them are Matthew Schinckel,
        Andrew Grieve, Cathy Chan, and Boris Zbarsky. If we inadvertently omitted your name,
        please let me know.
      </p>

      <p>
        The group acknowledges the following contributors to this specification's
        test suite: Matt Brubeck, Olli Pettay, Art Barstow, Cathy Chan and Rick Byers.
      </p>
    </section>

    <section class='appendix informative'>
      <h2>Changes Since Last Publication</h2>
      <p>The following non-substantive changes were made since the 
        <a href="http://www.w3.org/TR/2013/WD-touch-events-20130124/">
         24 January 2013 Last Call Working Draft</a> was published:
      </p>
      <ul>
       <li>Added a non-normative note for implementers regarding event targets 
          (<a href="https://dvcs.w3.org/hg/webevents/rev/6f2c52cd50f6">changeset</a>).</li>
       <li>Added a non-normative note regarding mapping hardware events to touch events
          (<a href="https://dvcs.w3.org/hg/webevents/rev/fe0ce5b66e4d">changeset</a>).</li>
       <li>Minor Web IDL bug fixes and clarifications (changesets: 
          <a href="https://dvcs.w3.org/hg/webevents/rev/67417356ff2a">1</a>,  
          <a href="https://dvcs.w3.org/hg/webevents/rev/0edc668e7910">2</a>).</li>
       <li>Added a non-normative note regarding the <code>initTouchEvent</code> method
          that is not standardized (changesets: 
          <a href="https://dvcs.w3.org/hg/webevents/rev/6294f7949a33">1</a>,  
          <a href="https://dvcs.w3.org/hg/webevents/rev/a892e79887ab">2</a>).</li>
      </ul>
    </section>

  </body>
</html>