touchevents.html
branchwd
changeset 181 06545e9398a1
parent 89 e67b0a0fba5e
child 204 18427612773e
equal deleted inserted replaced
90:53610a270441 181:06545e9398a1
     1 <!DOCTYPE html>
     1 <!DOCTYPE html>
     2 <html lang="en">
     2 <html lang="en">
     3   <head>
     3 <head>
     4     <title>Touch Events Specification</title>
     4     <title>Touch Events version 1</title>
     5     <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
     5     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
     6     <meta name="viewport" content="width=device-width">
     6     <meta name="viewport" content="width=device-width">
     7     <!--
     7     <!--
     8       === NOTA BENE ===
     8       === NOTA BENE ===
     9       For the three scripts below, if your spec resides on dev.w3 you can check them
     9       For the three scripts below, if your spec resides on dev.w3 you can check them
    10       out in the same tree and use relative links so that they'll work offline,
    10       out in the same tree and use relative links so that they'll work offline,
    11      -->
    11      -->
    12     <script src='http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js' class='remove'></script>
    12     
    13     <script class='remove'>
    13     
    14       var respecConfig = {
       
    15           // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
       
    16           specStatus:           "FPWD",
       
    17 
       
    18           // the specification's short name, as in http://www.w3.org/TR/short-name/
       
    19           shortName:            "touch-events",
       
    20 
       
    21           // if your specification has a subtitle that goes below the main
       
    22           // formal title, define it here
       
    23           // subtitle   :  "an excellent document",
       
    24 
       
    25           // if you wish the publication date to be other than today, set this
       
    26           publishDate:  "2011-05-05",
       
    27 
       
    28           // if the specification's copyright date is a range of years, specify
       
    29           // the start date here:
       
    30           // copyrightStart: "2005"
       
    31 
       
    32           // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
       
    33           // and its maturity status
       
    34           // previousPublishDate:  "1977-03-15",
       
    35           // previousMaturity:  "WD",
       
    36 
       
    37           // if there a publicly available Editor's Draft, this is the link
       
    38           edDraftURI:           "http://dvcs.w3.org/hg/webevents/raw-file/default/touchevents.html",
       
    39 
       
    40           // if this is a LCWD, uncomment and set the end of its review period
       
    41           // lcEnd: "2009-08-05",
       
    42 
       
    43           // if you want to have extra CSS, append them to this list
       
    44           // it is recommended that the respec.css stylesheet be kept
       
    45           extraCSS:             ["http://www.w3.org/StyleSheets/TR/W3C-TR.css", "http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],
       
    46 
       
    47           // editors, add as many as you like
       
    48           // only "name" is required
       
    49           editors:  [
       
    50               { name: "Doug Schepers", url: "http://schepers.cc/",
       
    51                 company: "W3C", companyURL: "http://w3.org/" },
       
    52               { name: "Sangwhan Moon",
       
    53                 company: "Opera Software ASA", companyURL: "http://www.opera.com/" },
       
    54               { name: "Matt Brubeck",
       
    55                 company: "Mozilla", companyURL: "http://www.mozilla.org/" },
       
    56           ],
       
    57 
       
    58           // authors, add as many as you like.
       
    59           // This is optional, uncomment if you have authors as well as editors.
       
    60           // only "name" is required. Same format as editors.
       
    61 
       
    62           //authors:  [
       
    63           //    { name: "Your Name", url: "http://example.org/",
       
    64           //      company: "Your Company", companyURL: "http://example.com/" },
       
    65           //],
       
    66 
       
    67           // name of the WG
       
    68           wg:           "Web Events Working Group",
       
    69 
       
    70           // URI of the public WG page
       
    71           wgURI:        "http://www.w3.org/2010/webevents/",
       
    72 
       
    73           // name (with the @w3c.org) of the public mailing to which comments are due
       
    74           wgPublicList: "public-webevents",
       
    75 
       
    76           // URI of the patent status for this WG, for Rec-track documents
       
    77           // !!!! IMPORTANT !!!!
       
    78           // This is important for Rec-track documents, do not copy a patent URI from a random
       
    79           // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
       
    80           // Team Contact.
       
    81           wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/45559/status",
       
    82       };
       
    83     </script>
       
    84 
    14 
    85     <style type="text/css">
    15     <style type="text/css">
    86       .event {
    16       .event {
    87         font-family: monospace;
    17         font-family: monospace;
    88         color: #459900;
    18         color: #459900;
    90 
    20 
    91       pre.idl {
    21       pre.idl {
    92         white-space: pre-wrap;
    22         white-space: pre-wrap;
    93       }
    23       }
    94     </style>
    24     </style>
    95   </head>
    25   <style>/*****************************************************************
    96   <body>
    26  * ReSpec 3 CSS
    97     <section id='abstract'>
    27  * Robin Berjon - http://berjon.com/
    98       The Touch Interface specification defines a set of low-level events that
    28  *****************************************************************/
       
    29 
       
    30 /* --- INLINES --- */
       
    31 em.rfc2119 { 
       
    32     text-transform:     lowercase;
       
    33     font-variant:       small-caps;
       
    34     font-style:         normal;
       
    35     color:              #900;
       
    36 }
       
    37 
       
    38 h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
       
    39 h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
       
    40     border: none;
       
    41 }
       
    42 
       
    43 dfn {
       
    44     font-weight:    bold;
       
    45 }
       
    46 
       
    47 a.internalDFN {
       
    48     color:  inherit;
       
    49     border-bottom:  1px solid #99c;
       
    50     text-decoration:    none;
       
    51 }
       
    52 
       
    53 a.externalDFN {
       
    54     color:  inherit;
       
    55     border-bottom:  1px dotted #ccc;
       
    56     text-decoration:    none;
       
    57 }
       
    58 
       
    59 a.bibref {
       
    60     text-decoration:    none;
       
    61 }
       
    62 
       
    63 cite .bibref {
       
    64     font-style: normal;
       
    65 }
       
    66 
       
    67 code {
       
    68     color:  #ff4500;
       
    69 }
       
    70 
       
    71 
       
    72 /* --- --- */
       
    73 ol.algorithm { counter-reset:numsection; list-style-type: none; }
       
    74 ol.algorithm li { margin: 0.5em 0; }
       
    75 ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
       
    76 
       
    77 /* --- TOC --- */
       
    78 .toc a, .tof a {
       
    79     text-decoration:    none;
       
    80 }
       
    81 
       
    82 a .secno, a .figno {
       
    83     color:  #000;
       
    84 }
       
    85 
       
    86 ul.tof, ol.tof {
       
    87     list-style: none outside none;
       
    88 }
       
    89 
       
    90 .caption {
       
    91     margin-top: 0.5em;
       
    92     font-style:   italic;
       
    93 }
       
    94 
       
    95 /* --- TABLE --- */
       
    96 table.simple {
       
    97     border-spacing: 0;
       
    98     border-collapse:    collapse;
       
    99     border-bottom:  3px solid #005a9c;
       
   100 }
       
   101 
       
   102 .simple th {
       
   103     background: #005a9c;
       
   104     color:  #fff;
       
   105     padding:    3px 5px;
       
   106     text-align: left;
       
   107 }
       
   108 
       
   109 .simple th[scope="row"] {
       
   110     background: inherit;
       
   111     color:  inherit;
       
   112     border-top: 1px solid #ddd;
       
   113 }
       
   114 
       
   115 .simple td {
       
   116     padding:    3px 10px;
       
   117     border-top: 1px solid #ddd;
       
   118 }
       
   119 
       
   120 .simple tr:nth-child(even) {
       
   121     background: #f0f6ff;
       
   122 }
       
   123 
       
   124 /* --- DL --- */
       
   125 .section dd > p:first-child {
       
   126     margin-top: 0;
       
   127 }
       
   128 
       
   129 .section dd > p:last-child {
       
   130     margin-bottom: 0;
       
   131 }
       
   132 
       
   133 .section dd {
       
   134     margin-bottom:  1em;
       
   135 }
       
   136 
       
   137 .section dl.attrs dd, .section dl.eldef dd {
       
   138     margin-bottom:  0;
       
   139 }
       
   140 </style><style>/* --- EXAMPLES --- */
       
   141 div.example-title {
       
   142     min-width: 7.5em;
       
   143     color: #b9ab2d;
       
   144 }
       
   145 div.example-title span {
       
   146     text-transform: uppercase;   
       
   147 }
       
   148 aside.example, div.example, div.illegal-example {
       
   149     padding: 0.5em;
       
   150     margin: 1em 0;
       
   151     position: relative;
       
   152     clear: both;
       
   153 }
       
   154 div.illegal-example { color: red }
       
   155 div.illegal-example p { color: black }
       
   156 aside.example, div.example {
       
   157     padding: .5em;
       
   158     border-left-width: .5em;
       
   159     border-left-style: solid;
       
   160     border-color: #e0cb52;
       
   161     background: #fcfaee;    
       
   162 }
       
   163 
       
   164 aside.example div.example {
       
   165     border-left-width: .1em;
       
   166     border-color: #999;
       
   167     background: #fff;
       
   168 }
       
   169 aside.example div.example div.example-title {
       
   170     color: #999;
       
   171 }
       
   172 </style><style>/* --- ISSUES/NOTES --- */
       
   173 div.issue-title, div.note-title {
       
   174     padding-right:  1em;
       
   175     min-width: 7.5em;
       
   176     color: #b9ab2d;
       
   177 }
       
   178 div.issue-title { color: #e05252; }
       
   179 div.note-title { color: #52e052; }
       
   180 div.issue-title span, div.note-title span {
       
   181     text-transform: uppercase;
       
   182 }
       
   183 div.note, div.issue {
       
   184     margin-top: 1em;
       
   185     margin-bottom: 1em;
       
   186 }
       
   187 .note > p:first-child, .issue > p:first-child { margin-top: 0 }
       
   188 .issue, .note {
       
   189     padding: .5em;
       
   190     border-left-width: .5em;
       
   191     border-left-style: solid;
       
   192 }
       
   193 div.issue, div.note {
       
   194     padding: 0.5em;
       
   195     margin: 1em 0;
       
   196     position: relative;
       
   197     clear: both;
       
   198 }
       
   199 span.note, span.issue { padding: .1em .5em .15em; }
       
   200 
       
   201 .issue {
       
   202     border-color: #e05252;
       
   203     background: #fbe9e9;
       
   204 }
       
   205 .note {
       
   206     border-color: #52e052;
       
   207     background: #e9fbe9;
       
   208 }
       
   209 
       
   210 
       
   211 </style><style>/* --- WEB IDL --- */
       
   212 pre.idl {
       
   213     border-top: 1px solid #90b8de;
       
   214     border-bottom: 1px solid #90b8de;
       
   215     padding:    1em;
       
   216     line-height:    120%;
       
   217 }
       
   218 
       
   219 pre.idl::before {
       
   220     content:    "WebIDL";
       
   221     display:    block;
       
   222     width:      150px;
       
   223     background: #90b8de;
       
   224     color:  #fff;
       
   225     font-family:    initial;
       
   226     padding:    3px;
       
   227     font-weight:    bold;
       
   228     margin: -1em 0 1em -1em;
       
   229 }
       
   230 
       
   231 .idlType {
       
   232     color:  #ff4500;
       
   233     font-weight:    bold;
       
   234     text-decoration:    none;
       
   235 }
       
   236 
       
   237 /*.idlModule*/
       
   238 /*.idlModuleID*/
       
   239 /*.idlInterface*/
       
   240 .idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
       
   241     font-weight:    bold;
       
   242     color:  #005a9c;
       
   243 }
       
   244 
       
   245 .idlSuperclass {
       
   246     font-style: italic;
       
   247     color:  #005a9c;
       
   248 }
       
   249 
       
   250 /*.idlAttribute*/
       
   251 .idlAttrType, .idlFieldType, .idlMemberType {
       
   252     color:  #005a9c;
       
   253 }
       
   254 .idlAttrName, .idlFieldName, .idlMemberName {
       
   255     color:  #ff4500;
       
   256 }
       
   257 .idlAttrName a, .idlFieldName a, .idlMemberName a {
       
   258     color:  #ff4500;
       
   259     border-bottom:  1px dotted #ff4500;
       
   260     text-decoration: none;
       
   261 }
       
   262 
       
   263 /*.idlMethod*/
       
   264 .idlMethType, .idlCallbackType {
       
   265     color:  #005a9c;
       
   266 }
       
   267 .idlMethName {
       
   268     color:  #ff4500;
       
   269 }
       
   270 .idlMethName a {
       
   271     color:  #ff4500;
       
   272     border-bottom:  1px dotted #ff4500;
       
   273     text-decoration: none;
       
   274 }
       
   275 
       
   276 /*.idlParam*/
       
   277 .idlParamType {
       
   278     color:  #005a9c;
       
   279 }
       
   280 .idlParamName, .idlDefaultValue {
       
   281     font-style: italic;
       
   282 }
       
   283 
       
   284 .extAttr {
       
   285     color:  #666;
       
   286 }
       
   287 
       
   288 /*.idlConst*/
       
   289 .idlConstType {
       
   290     color:  #005a9c;
       
   291 }
       
   292 .idlConstName {
       
   293     color:  #ff4500;
       
   294 }
       
   295 .idlConstName a {
       
   296     color:  #ff4500;
       
   297     border-bottom:  1px dotted #ff4500;
       
   298     text-decoration: none;
       
   299 }
       
   300 
       
   301 /*.idlException*/
       
   302 .idlExceptionID {
       
   303     font-weight:    bold;
       
   304     color:  #c00;
       
   305 }
       
   306 
       
   307 .idlTypedefID, .idlTypedefType {
       
   308     color:  #005a9c;
       
   309 }
       
   310 
       
   311 .idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
       
   312     color:  #c00;
       
   313     font-weight:    normal;
       
   314 }
       
   315 
       
   316 .excName a {
       
   317     font-family:    monospace;
       
   318 }
       
   319 
       
   320 .idlRaises a.idlType, .excName a.idlType {
       
   321     border-bottom:  1px dotted #c00;
       
   322 }
       
   323 
       
   324 .excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
       
   325     width:  45px;
       
   326     text-align: center;
       
   327 }
       
   328 .excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
       
   329 .excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
       
   330 
       
   331 .idlImplements a {
       
   332     font-weight:    bold;
       
   333 }
       
   334 
       
   335 dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
       
   336     margin-left:    2em;
       
   337 }
       
   338 
       
   339 .attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
       
   340     font-weight:    normal;
       
   341 }
       
   342 
       
   343 .attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
       
   344     font-weight:    bold;
       
   345     color:  #000;
       
   346     font-family:    monospace;
       
   347 }
       
   348 
       
   349 .attributes dt code, .fields dt code, .dictionary-members dt code {
       
   350     background:  #ffffd2;
       
   351 }
       
   352 
       
   353 .attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
       
   354     color:  #005a9c;
       
   355     background:  transparent;
       
   356     font-family:    inherit;
       
   357     font-weight:    normal;
       
   358     font-style: italic;
       
   359 }
       
   360 
       
   361 .methods dt code {
       
   362     background:  #d9e6f8;
       
   363 }
       
   364 
       
   365 .constants dt code {
       
   366     background:  #ddffd2;
       
   367 }
       
   368 
       
   369 .attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
       
   370     margin-bottom:  1em;
       
   371 }
       
   372 
       
   373 table.parameters, table.exceptions {
       
   374     border-spacing: 0;
       
   375     border-collapse:    collapse;
       
   376     margin: 0.5em 0;
       
   377     width:  100%;
       
   378 }
       
   379 table.parameters { border-bottom:  1px solid #90b8de; }
       
   380 table.exceptions { border-bottom:  1px solid #deb890; }
       
   381 
       
   382 .parameters th, .exceptions th {
       
   383     color:  #fff;
       
   384     padding:    3px 5px;
       
   385     text-align: left;
       
   386     font-family:    initial;
       
   387     font-weight:    normal;
       
   388     text-shadow:    #666 1px 1px 0;
       
   389 }
       
   390 .parameters th { background: #90b8de; }
       
   391 .exceptions th { background: #deb890; }
       
   392 
       
   393 .parameters td, .exceptions td {
       
   394     padding:    3px 10px;
       
   395     border-top: 1px solid #ddd;
       
   396     vertical-align: top;
       
   397 }
       
   398 
       
   399 .parameters tr:first-child td, .exceptions tr:first-child td {
       
   400     border-top: none;
       
   401 }
       
   402 
       
   403 .parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
       
   404     width:  100px;
       
   405 }
       
   406 
       
   407 .parameters td.prmType {
       
   408     width:  120px;
       
   409 }
       
   410 
       
   411 table.exceptions table {
       
   412     border-spacing: 0;
       
   413     border-collapse:    collapse;
       
   414     width:  100%;
       
   415 }
       
   416 </style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-WD"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
       
   417   <body><div class="head">
       
   418   <p>
       
   419     
       
   420       <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
       
   421     
       
   422   </p>
       
   423   <h1 class="title" id="title">Touch Events version 1</h1>
       
   424   
       
   425   <h2 id="w3c-working-draft-24-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Working Draft 24 January 2013</h2>
       
   426   <dl>
       
   427     
       
   428       <dt>This version:</dt>
       
   429       <dd><a href="http://www.w3.org/TR/2013/WD-touch-events-20130124/">http://www.w3.org/TR/2013/WD-touch-events-20130124/</a></dd>
       
   430       <dt>Latest published version:</dt>
       
   431       <dd><a href="http://www.w3.org/TR/touch-events/">http://www.w3.org/TR/touch-events/</a></dd>
       
   432     
       
   433     
       
   434       <dt>Latest editor's draft:</dt>
       
   435       <dd><a href="http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html">http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html</a></dd>
       
   436     
       
   437     
       
   438     
       
   439     
       
   440     
       
   441       <dt>Previous version:</dt>
       
   442       <dd><a href="http://www.w3.org/TR/2011/CR-touch-events-20111215/">http://www.w3.org/TR/2011/CR-touch-events-20111215/</a></dd>
       
   443     
       
   444     
       
   445     <dt>Editors:</dt>
       
   446     <dd><a href="http://schepers.cc/">Doug Schepers</a>, <a href="http://w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a></dd>
       
   447 <dd><span>Sangwhan Moon</span>, <a href="http://www.opera.com/">Opera Software ASA</a></dd>
       
   448 <dd><a href="http://limpet.net/mbrubeck/">Matt Brubeck</a>, <a href="http://www.mozilla.org/">Mozilla</a></dd>
       
   449 
       
   450     
       
   451   </dl>
       
   452   
       
   453   
       
   454   
       
   455   
       
   456     
       
   457       <p class="copyright">
       
   458         <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 
       
   459         2013
       
   460         
       
   461         <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> 
       
   462         (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
       
   463         <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
       
   464         <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
       
   465         <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
       
   466         <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
       
   467         <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
       
   468       </p>
       
   469     
       
   470   
       
   471   <hr>
       
   472 </div>
       
   473     
       
   474 
       
   475     <section id="abstract" class="introductory"><h2>Abstract</h2><p>
       
   476       The Touch Events specification defines a set of low-level events that
    99       represent one or more points of contact with a touch-sensitive surface,
   477       represent one or more points of contact with a touch-sensitive surface,
   100       and changes of those points with respect to the surface and any DOM
   478       and changes of those points with respect to the surface and any DOM
   101       elements displayed upon it (e.g. for touch screens) or associated with it
   479       elements displayed upon it (e.g. for touch screens) or associated with it
   102       (e.g. for drawing tablets without displays).  It also addresses
   480       (e.g. for drawing tablets without displays).  It also addresses
   103       pen-tablet devices, such as drawing tablets, with consideration toward
   481       pen-tablet devices, such as drawing tablets, with consideration toward
   104       stylus capabilities.
   482       stylus capabilities.
   105     </section>
   483     </p></section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
   106 
   484   
   107     <section id='introduction' class='informative'>
   485     
   108       <h2>Introduction</h2>
   486       
       
   487         <p>
       
   488           <em>This section describes the status of this document at the time of its publication. Other
       
   489           documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
       
   490           of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
       
   491           index</a> at http://www.w3.org/TR/.</em>
       
   492         </p>
       
   493         
       
   494      This specification is the 24 January 2013 Last Call Working Draft. 
       
   495      The comment period for this Last Call Working Draft ends 14 February 2013.
       
   496 
       
   497      The <a href="http://www.w3.org/TR/2011/CR-touch-events-20111215/"> 
       
   498      15 December 2011 Candidate Recommendation</a> 
       
   499      was returned to Last Call Working Draft because of 
       
   500      <a href="https://www.w3.org/2010/webevents/track/">issues</a> 
       
   501      found during the implementation and interoperability testing phases.
       
   502 
       
   503      The WG will complete its
       
   504      <a href="http://w3c-test.org/webevents/tests/touch-events-v1/">test suite</a> 
       
   505      and two or more independent implementations must pass each test before 
       
   506      the specification is published as a Proposed Recommendation. 
       
   507      The group will also create an Implementation Report.
       
   508     
       
   509         <p>
       
   510           This document was published by the <a href="http://www.w3.org/2010/webevents/">Web Events Working Group</a> as a Last Call Working Draft.
       
   511           
       
   512             This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
       
   513           
       
   514           
       
   515           If you wish to make comments regarding this document, please send them to 
       
   516           <a href="mailto:public-webevents@w3.org">public-webevents@w3.org</a> 
       
   517           (<a href="mailto:public-webevents-request@w3.org?subject=subscribe">subscribe</a>,
       
   518           <a href="http://lists.w3.org/Archives/Public/public-webevents/">archives</a>).
       
   519           
       
   520           The Last Call period ends 14 February 2013.
       
   521           
       
   522           
       
   523         All comments are welcome.
       
   524         
       
   525         
       
   526           </p><p>
       
   527             Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
       
   528             This is a draft document and may be updated, replaced or obsoleted by other documents at 
       
   529             any time. It is inappropriate to cite this document as other than work in progress.
       
   530           </p>
       
   531         
       
   532         
       
   533           <p>
       
   534             This is a Last Call Working Draft and thus the Working Group has determined that this document has satisfied the
       
   535             relevant technical requirements and is sufficiently stable to advance through the Technical Recommendation process.
       
   536           </p>
       
   537         
       
   538         <p>
       
   539           
       
   540             This document was produced by a group operating under the 
       
   541             <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
       
   542           
       
   543           
       
   544           
       
   545             
       
   546               <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/45559/status" rel="disclosure">public list of any patent disclosures</a> 
       
   547             
       
   548             made in connection with the deliverables of the group; that page also includes instructions for 
       
   549             disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
       
   550             <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
       
   551             information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
       
   552             6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
       
   553           
       
   554           
       
   555         </p>
       
   556         
       
   557       
       
   558     
       
   559   
       
   560 </section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a></li><li class="tocline"><a href="#touch-interface" class="tocxref"><span class="secno">3. </span><span class="formerLink"><code>Touch</code></span> Interface</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#touchlist-interface" class="tocxref"><span class="secno">4. </span><span class="formerLink"><code>TouchList</code></span> Interface</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.2 </span>Methods</a></li></ul></li><li class="tocline"><a href="#touchevent-interface" class="tocxref"><span class="secno">5. </span><span class="formerLink"><code>TouchEvent</code></span> Interface</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#usage-examples" class="tocxref"><span class="secno">5.2 </span>Usage Examples</a><ul class="toc"><li class="tocline"><a href="#touches-and-targettouches-of-a-touchevent" class="tocxref"><span class="secno">5.2.1 </span>touches and targetTouches of a <span class="formerLink"><code>TouchEvent</code></span></a></li><li class="tocline"><a href="#changedtouches-of-a-touchevent" class="tocxref"><span class="secno">5.2.2 </span>changedTouches of a <span class="formerLink"><code>TouchEvent</code></span></a></li></ul></li><li class="tocline"><a href="#list-of-touchevent-types" class="tocxref"><span class="secno">5.3 </span>List of <span class="formerLink"><code>TouchEvent</code></span> types</a></li><li class="tocline"><a href="#the-touchstart-event" class="tocxref"><span class="secno">5.4 </span>The <span class="event">touchstart</span>
       
   561         event</a></li><li class="tocline"><a href="#the-touchend-event" class="tocxref"><span class="secno">5.5 </span>The <span class="event">touchend</span> event</a></li><li class="tocline"><a href="#the-touchmove-event" class="tocxref"><span class="secno">5.6 </span>The <span class="event">touchmove</span> event</a></li><li class="tocline"><a href="#the-touchcancel-event" class="tocxref"><span class="secno">5.7 </span>The <span class="event">touchcancel</span> event</a></li></ul></li><li class="tocline"><a href="#extensions-to-the-document-interface" class="tocxref"><span class="secno">6. </span>Extensions to the <span class="formerLink"><code>Document</code></span> Interface</a><ul class="toc"><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#mouse-events" class="tocxref"><span class="secno">7. </span>Interaction with Mouse Events</a></li><li class="tocline"><a href="#glossary" class="tocxref"><span class="secno">8. </span>Glossary</a></li><li class="tocline"><a href="#issues" class="tocxref"><span class="secno">9. </span>Issues</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li></ul></li></ul></section>
       
   562 
       
   563     <section id="introduction" class="informative">
       
   564       <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
   109 
   565 
   110       <p>
   566       <p>
   111         User Agents that run on terminals which provide touch input to use web
   567         User Agents that run on terminals which provide touch input to use web
   112         applications typically use interpreted mouse events to allow users
   568         applications typically use interpreted mouse events to allow users
   113         to access interactive web applications. However, these interpreted
   569         to access interactive web applications. However, these interpreted
   128         specifying interfaces to allow web applications to directly handle touch
   584         specifying interfaces to allow web applications to directly handle touch
   129         events, and multiple touch points for capable devices.
   585         events, and multiple touch points for capable devices.
   130       </p>
   586       </p>
   131     </section>
   587     </section>
   132 
   588 
   133     <section id='conformance'>
   589     <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2>
       
   590 <p>
       
   591   As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
       
   592   and notes in this specification are non-normative. Everything else in this specification is
       
   593   normative.
       
   594 </p>
       
   595 <p>
       
   596   The key words <em class="rfc2119" title="must">must</em>, <em class="rfc2119" title="must not">must not</em>, <em class="rfc2119" title="required">required</em>, <em class="rfc2119" title="should">should</em>, <em class="rfc2119" title="should not">should not</em>, <em class="rfc2119" title="recommended">recommended</em>, <em class="rfc2119" title="may">may</em>,
       
   597   and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
       
   598 </p>
       
   599 
   134       <p>
   600       <p>
   135         This specification defines conformance criteria that apply to a single
   601         This specification defines conformance criteria that apply to a single
   136         product: the <dfn id="dfn-user-agent">user agent</dfn> that implements
   602         product: the <dfn id="dfn-user-agent">user agent</dfn> that implements
   137         the interfaces that it contains.
   603         the interfaces that it contains.
   138       </p>
   604       </p>
   139 
   605 
   140       <p>
   606       <p>
   141         Implementations that use ECMAScript to implement the APIs defined in
   607         Implementations that use ECMAScript to implement the APIs defined in
   142         this specification must implement them in a manner consistent with the
   608         this specification must implement them in a manner consistent with the
   143         ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]] as
   609         ECMAScript Bindings defined in the Web IDL specification [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>] as
   144         this specification uses that specification and terminology.
   610         this specification uses that specification and terminology.
   145       </p>
   611       </p>
   146 
   612 
   147       <p>
   613       <p>
   148         A conforming implementation is required to implement all fields
   614         A conforming implementation is required to implement all fields
   149         defined in this specification.
   615         defined in this specification.
   150       </p>
   616       </p>
   151     </section>
   617     </section>
   152 
   618 
   153     <section>
   619     <section id="touch-interface">
   154       <h2><a>Touch</a> Interface</h2>
   620       <!--OddPage--><h2><span class="secno">3. </span><a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> Interface</h2>
   155       <p>
   621       <p>
   156         This interface defines an individual point of contact for a touch
   622         This interface describes an individual <a href="#dfn-touch-point" class="internalDFN">touch point</a> for a touch
   157         event.
   623         event.  <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> objects are immutable; after one is created, its
   158       </p>
   624         attributes must not change.
   159 
   625       </p>
   160       <dl title='interface Touch' class='idl'>
   626 
   161         <dt>readonly attribute long identifier</dt>
   627       <pre class="idl"><span class="idlInterface" id="idl-def-Touch">interface <span class="idlInterfaceID">Touch</span> {
   162         <dd>
   628 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-identifier">identifier</a></span>;</span>
   163           An identification number for each <a>touch point</a>, unique to that
   629 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>EventTarget</a></span> <span class="idlAttrName"><a href="#widl-Touch-target">target</a></span>;</span>
   164           <a>touch point</a> per session.
   630 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-screenX">screenX</a></span>;</span>
   165 
   631 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-screenY">screenY</a></span>;</span>
       
   632 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-clientX">clientX</a></span>;</span>
       
   633 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-clientY">clientY</a></span>;</span>
       
   634 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-pageX">pageX</a></span>;</span>
       
   635 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>long</a></span>        <span class="idlAttrName"><a href="#widl-Touch-pageY">pageY</a></span>;</span>
       
   636 };</span></pre><section id="attributes"><h3><span class="secno">3.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-Touch-clientX"><code>clientX</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   637           The horizontal coordinate of point relative to the viewport in pixels,
       
   638           excluding any scroll offset
       
   639         </dd><dt id="widl-Touch-clientY"><code>clientY</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   640           The vertical coordinate of point relative to the viewport in pixels,
       
   641           excluding any scroll offset
       
   642         </dd><dt id="widl-Touch-identifier"><code>identifier</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   643           An identification number for each <a href="#dfn-touch-point" class="internalDFN">touch point</a>.
       
   644 
       
   645           When a touch point becomes active, it must be assigned an
       
   646           <a>identifier</a> that is distinct from any other <a href="#dfn-active-touch-point" class="internalDFN">active touch
       
   647           point</a>.  While the touch point remains active, all events that
       
   648           refer to it must assign it the same <a>identifier</a>.
       
   649         </dd><dt id="widl-Touch-pageX"><code>pageX</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   650           The horizontal coordinate of point relative to the viewport in pixels,
       
   651           including any scroll offset
       
   652         </dd><dt id="widl-Touch-pageY"><code>pageY</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   653           The vertical coordinate of point relative to the viewport in pixels,
       
   654           including any scroll offset
       
   655         </dd><dt id="widl-Touch-screenX"><code>screenX</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   656           The horizontal coordinate of point relative to the screen in pixels
       
   657         </dd><dt id="widl-Touch-screenY"><code>screenY</code> of type <span class="idlAttrType"><a>long</a></span>, readonly</dt><dd>
       
   658           The vertical coordinate of point relative to the screen in pixels
       
   659         </dd><dt id="widl-Touch-target"><code>target</code> of type <span class="idlAttrType"><a>EventTarget</a></span>, readonly</dt><dd>
       
   660           The <a>Element</a> on which the <a href="#dfn-touch-point" class="internalDFN">touch point</a> started when it
       
   661           was first placed on the surface, even if the <a href="#dfn-touch-point" class="internalDFN">touch point</a> has
       
   662           since moved outside the interactive area of that element.
       
   663         </dd></dl></section>
       
   664     </section>
       
   665 
       
   666     <section id="touchlist-interface">
       
   667       <!--OddPage--><h2><span class="secno">4. </span><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> Interface</h2>
       
   668       <p>
       
   669         This interface defines a list of individual points of contact for a
       
   670         touch event.  <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> objects are immutable; after one is
       
   671         created, its contents must not change.
       
   672       </p>
       
   673 
       
   674       <pre class="idl"><span class="idlInterface" id="idl-def-TouchList">interface <span class="idlInterfaceID">TouchList</span> {
       
   675 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>unsigned long</a></span> <span class="idlAttrName"><a href="#widl-TouchList-length">length</a></span>;</span>
       
   676 <span class="idlMethod">    <span class="idlMethType"><a>getter Touch</a></span> <span class="idlMethName"><a href="#widl-TouchList-item-getter-Touch-unsigned-long-index">item</a></span> (<span class="idlParam"><span class="idlParamType"><a>unsigned long</a></span> <span class="idlParamName">index</span></span>);</span>
       
   677 };</span></pre><section id="attributes-1"><h3><span class="secno">4.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-TouchList-length"><code>length</code> of type <span class="idlAttrType"><a>unsigned long</a></span>, readonly</dt><dd>
       
   678           returns the number of <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a>es in the list
       
   679         </dd></dl></section><section id="methods"><h3><span class="secno">4.2 </span>Methods</h3><dl class="methods"><dt id="widl-TouchList-item-getter-Touch-unsigned-long-index"><code>item</code></dt><dd>
       
   680           returns the <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> at the specified index in the list
       
   681         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">index</td><td class="prmType"><code><a>unsigned long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>getter Touch</a></code></div></dd></dl></section>
       
   682     </section>
       
   683 
       
   684     <section id="touchevent-interface">
       
   685       <!--OddPage--><h2><span class="secno">5. </span><a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a> Interface</h2>
       
   686       <p>
       
   687         This interface defines the <a href="#dfn-touchstart" class="internalDFN">touchstart</a>, <a href="#dfn-touchend" class="internalDFN">touchend</a>,
       
   688         <a href="#dfn-touchmove" class="internalDFN">touchmove</a>, and <a href="#dfn-touchcancel" class="internalDFN">touchcancel</a> event types.
       
   689         <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a> objects are immutable; after one is created and
       
   690         initialized, its attributes must not change.
       
   691       </p>
       
   692 
       
   693       <pre class="idl"><span class="idlInterface" id="idl-def-TouchEvent">interface <span class="idlInterfaceID">TouchEvent</span> : <span class="idlSuperclass"><a>UIEvent</a></span> {
       
   694 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span> <span class="idlAttrName"><a href="#widl-TouchEvent-touches">touches</a></span>;</span>
       
   695 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span> <span class="idlAttrName"><a href="#widl-TouchEvent-targetTouches">targetTouches</a></span>;</span>
       
   696 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span> <span class="idlAttrName"><a href="#widl-TouchEvent-changedTouches">changedTouches</a></span>;</span>
       
   697 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>   <span class="idlAttrName"><a href="#widl-TouchEvent-altKey">altKey</a></span>;</span>
       
   698 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>   <span class="idlAttrName"><a href="#widl-TouchEvent-metaKey">metaKey</a></span>;</span>
       
   699 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>   <span class="idlAttrName"><a href="#widl-TouchEvent-ctrlKey">ctrlKey</a></span>;</span>
       
   700 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>   <span class="idlAttrName"><a href="#widl-TouchEvent-shiftKey">shiftKey</a></span>;</span>
       
   701 };</span></pre><section id="attributes-2"><h3><span class="secno">5.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-TouchEvent-altKey"><code>altKey</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
       
   702           <code>true</code> if the alt (Alternate) key modifier is activated;
       
   703           otherwise <code>false</code>
       
   704         </dd><dt id="widl-TouchEvent-changedTouches"><code>changedTouches</code> of type <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span>, readonly</dt><dd>
   166           <p>
   705           <p>
   167             The algorithm for determining the <a>identifier</a> value is as
   706             a list of <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a>es for every point of contact which contributed
   168             follows:
   707             to the event.
   169           </p>
       
   170           <ol>
       
   171             <li>
       
   172               if there are no other <a>active touch event session</a>s, the
       
   173               value of <a>identifier</a> must be <code>0</code>
       
   174             </li>
       
   175             <li>
       
   176               if there is at least one <a>active touch event session</a>, the
       
   177               value of <a>identifier</a> must be the lowest integer not
       
   178               currently used by any active <a>Touch</a> object in any
       
   179               <a>active touch event session</a>
       
   180             </li>
       
   181           </ol>
       
   182         </dd>
       
   183 
       
   184         <dt>readonly attribute long screenX</dt>
       
   185         <dd>
       
   186           x-coordinate of point relative to the screen
       
   187         </dd>
       
   188         <dt>readonly attribute long screenY</dt>
       
   189         <dd>
       
   190           y-coordinate of point relative to the screen
       
   191         </dd>
       
   192 
       
   193         <dt>readonly attribute long clientX</dt>
       
   194         <dd>
       
   195           x-coordinate of point relative to the viewport, excluding any scroll
       
   196           offset
       
   197         </dd>
       
   198         <dt>readonly attribute long clientY</dt>
       
   199         <dd>
       
   200           y-coordinate of point relative to the viewport, excluding any scroll
       
   201           offset
       
   202         </dd>
       
   203 
       
   204         <dt>readonly attribute long pageX</dt>
       
   205         <dd>
       
   206           x-coordinate of point relative to the viewport, including any scroll
       
   207           offset
       
   208         </dd>
       
   209         <dt>readonly attribute long pageY</dt>
       
   210         <dd>
       
   211           y-coordinate of point relative to the viewport, including any scroll
       
   212           offset
       
   213         </dd>
       
   214 
       
   215         <dt>readonly attribute long radiusX</dt>
       
   216         <dd>
       
   217           the radius of the ellipse which most closely circumscribes the
       
   218           touching area (e.g. finger, stylus) along the x-axis, in pixels of
       
   219           the same scale as <a>screenX</a>; <code>1</code> if no value is
       
   220           known.  The value must be positive.
       
   221           <p class="issue" id="issue-units"><strong>Issue:</strong> What are
       
   222           units of radiusX/radiusY?  CSS Pixels?</p>
       
   223         </dd>
       
   224         <dt>readonly attribute long radiusY</dt>
       
   225         <dd>
       
   226           the radius of the ellipse which most closely circumscribes the
       
   227           touching area (e.g. finger, stylus) along the y-axis, in pixels of
       
   228           the same scale as <a>screenY</a>; <code>1</code> if no value is
       
   229           known.  The value must be positive.
       
   230         </dd>
       
   231 
       
   232         <dt>readonly attribute float rotationAngle</dt>
       
   233         <dd>
       
   234           <p>
       
   235             the angle (in degrees) that the ellipse described by <a>radiusX</a>
       
   236             and <a>radiusY</a> is rotated clockwise about its center;
       
   237             <code>0</code> if no value is known.  The value must be greater
       
   238             than or equal to <code>0</code> and less than <code>90</code>.
       
   239           </p>
   708           </p>
   240           <p>
   709           <p>
   241             If the ellipse described by <a>radiusX</a> and <a>radiusY</a> is
   710             For the <a href="#dfn-touchstart" class="internalDFN">touchstart</a> event this must be a list of the touch
   242             circular, then <a>rotationAngle</a> has no effect.  The user agent
   711             points that just became active with the current event.  For the
   243             may use <code>0</code> as the value in this case, or it may use any
   712             <a href="#dfn-touchmove" class="internalDFN">touchmove</a> event this must be a list of the touch points that
   244             other value in the allowed range.  (For example, the user agent may
   713             have moved since the last event.  For the <a href="#dfn-touchend" class="internalDFN">touchend</a> and 
   245             use the <a>rotationAngle</a> value from the previous touch event,
   714 			<a href="#dfn-touchcancel" class="internalDFN">touchcancel</a> events this must be a list of the touch points 
   246             to avoid sudden changes.)
   715 			that have just been removed from the surface.
   247           </p>
   716           </p>
   248         </dd>
   717         </dd><dt id="widl-TouchEvent-ctrlKey"><code>ctrlKey</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
   249 
   718           <code>true</code> if the ctrl (Control) key modifier is activated;
   250         <dt>readonly attribute float force</dt>
       
   251         <dd>
       
   252           a relative value of pressure applied, in the range <code>0</code> to
       
   253           <code>1</code>, where <code>0</code> is no pressure, and
       
   254           <code>1</code> is the highest level of pressure the touch device is
       
   255           capable of sensing; <code>0</code> if no value is known.  In
       
   256           environments where <a>force</a> is known, the absolute pressure
       
   257           represented by the <a>force</a> attribute, and the sensitivity in
       
   258           levels of pressure, may vary.
       
   259 
       
   260           <p class="issue" id="issue-inkml">
       
   261             <strong>Issue:</strong>
       
   262             Consider aligning with other "channels" and values from
       
   263             <a href="http://www.w3.org/TR/InkML/#channelContents">Ink Markup
       
   264             Language (InkML)</a>, in addition to <a>force</a>, e.g. adding
       
   265             <a>angle</a>, <a>clientZ</a>, <a>rotation</a>, etc.
       
   266           </p>
       
   267         </dd>
       
   268       </dl>
       
   269     </section>
       
   270 
       
   271     <section>
       
   272       <h2><a>TouchList</a> Interface</h2>
       
   273       <p>
       
   274         This interface defines a list of individual points of contact for a
       
   275         touch event.
       
   276       </p>
       
   277 
       
   278       <dl title='interface TouchList' class='idl'>
       
   279         <dt>readonly attribute unsigned long length</dt>
       
   280         <dd>
       
   281           returns the number of <a>Touch</a>es in the list
       
   282         </dd>
       
   283         <dt>getter <a>Touch</a> item (in unsigned long <a>index</a>)</dt>
       
   284         <dd>
       
   285           returns the <a>Touch</a> with index <a>index</a> from the list,
       
   286           sorted in order from latest to earliest
       
   287         </dd>
       
   288         <dt><a>Touch</a> identifiedTouch (in long <a>identifier</a>)</dt>
       
   289         <dd>
       
   290           returns the first <a>Touch</a> with long <a>identifier</a> from the
       
   291           list
       
   292         </dd>
       
   293       </dl>
       
   294     </section>
       
   295 
       
   296     <section>
       
   297       <h2><a>TouchEvent</a> Interface</h2>
       
   298       <p>
       
   299         This interface defines the <a>touchstart</a>, <a>touchend</a>,
       
   300         <a>touchmove</a>, <a>touchenter</a>, <a>touchleave</a>, and
       
   301         <a>touchcancel</a> event types.
       
   302       </p>
       
   303 
       
   304       <dl title='interface TouchEvent : UIEvent' class='idl'>
       
   305         <dt>readonly attribute <a>TouchList</a> touches</dt>
       
   306         <dd>
       
   307           a list of <a>Touch</a>es for every point of contact currently
       
   308           touching the surface
       
   309         </dd>
       
   310         <dt>readonly attribute <a>TouchList</a> targetTouches</dt>
       
   311         <dd>
       
   312           a list of <a>Touch</a>es for every point of contact currently
       
   313           touching the surface, which started on the same target
       
   314         </dd>
       
   315         <dt>readonly attribute <a>TouchList</a> changedTouches</dt>
       
   316         <dd>
       
   317           a list of <a>Touch</a>es for every point of contact which contributed
       
   318           to the event
       
   319         </dd>
       
   320 
       
   321         <dt>readonly attribute boolean altKey</dt>
       
   322         <dd>
       
   323           <code>true</code> if the alt (Alternate) key modifier is activated;
       
   324           otherwise <code>false</code>
   719           otherwise <code>false</code>
   325         </dd>
   720         </dd><dt id="widl-TouchEvent-metaKey"><code>metaKey</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
   326         <dt>readonly attribute boolean metaKey</dt>
       
   327         <dd>
       
   328           <code>true</code> if the meta (Meta) key modifier is activated;
   721           <code>true</code> if the meta (Meta) key modifier is activated;
   329           otherwise <code>false</code>.  On some platforms this attribute may
   722           otherwise <code>false</code>.  On some platforms this attribute may
   330           map to a differently-named key modifier.
   723           map to a differently-named key modifier.
   331         </dd>
   724         </dd><dt id="widl-TouchEvent-shiftKey"><code>shiftKey</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
   332         <dt>readonly attribute boolean ctrlKey</dt>
       
   333         <dd>
       
   334           <code>true</code> if the ctrl (Control) key modifier is activated;
       
   335           otherwise <code>false</code>
       
   336         </dd>
       
   337         <dt>readonly attribute boolean shiftKey</dt>
       
   338         <dd>
       
   339           <code>true</code> if the shift (Shift) key modifier is activated;
   725           <code>true</code> if the shift (Shift) key modifier is activated;
   340           otherwise <code>false</code>
   726           otherwise <code>false</code>
   341         </dd>
   727         </dd><dt id="widl-TouchEvent-targetTouches"><code>targetTouches</code> of type <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span>, readonly</dt><dd>
   342         <dt>readonly attribute EventTarget? relatedTarget</dt>
   728           a list of <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a>es for every point of contact that is touching
   343         <dd>
   729           the surface <em>and</em> started on the element that is the
   344           identifies a secondary EventTarget related to a touch event.  This
   730           <a>target</a> of the current event.
   345           attribute is used with the <a>touchenter</a> event to indicate the
   731         </dd><dt id="widl-TouchEvent-touches"><code>touches</code> of type <span class="idlAttrType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span>, readonly</dt><dd>
   346           <a>EventTarget</a> the touch point exited, and with the
   732           a list of <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a>es for every point of contact currently
   347           <a>touchleave</a> event to indicate the <a>EventTarget</a> the touch
   733           touching the surface.
   348           point entered.  For other event types, this attribute must be
   734         </dd></dl></section>
   349           <code>null</code>.
   735       
   350         </dd>
   736       <section class="informative" id="usage-examples">
   351 
   737           <h3><span class="secno">5.2 </span>Usage Examples</h3><p><em>This section is non-normative.</em></p>
   352         <!-- Methods -->
   738           
   353         <dt>void initTouchEvent()</dt>
   739           <p>
   354         <dd>
   740             The examples below demonstrate the relations between the different
   355           initializes a TouchEvent created through the <a>DocumentEvent</a>
   741             <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> members defined in a <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a>.
   356           interface.
   742           </p>
   357           <dl class='parameters'>
   743           
   358             <dt>DOMString type</dt> <dd></dd>
   744           <section id="touches-and-targettouches-of-a-touchevent">
   359             <dt>boolean canBubble</dt> <dd></dd>
   745               <h4><span class="secno">5.2.1 </span>touches and targetTouches of a <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></h4><p><em>This section is non-normative.</em></p>
   360             <dt>boolean cancelable</dt> <dd></dd>
   746               
   361             <dt>AbstractView view</dt> <dd></dd>
   747               <p>
   362             <dt>long detail</dt> <dd></dd>
   748                 This example demonstrates the utility and relations between the
   363             <dt>boolean ctrlKey</dt> <dd></dd>
   749                 touches and targetTouches members defined in the <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a>
   364             <dt>boolean altKey</dt> <dd></dd>
   750                 interface. The following code will generate different output based
   365             <dt>boolean shiftKey</dt> <dd></dd>
   751                 on the number of touch points on the touchable element and the document:
   366             <dt>boolean metaKey</dt> <dd></dd>
   752               </p>
   367             <dt>TouchList touches</dt> <dd></dd>
   753       
   368             <dt>TouchList targetTouches</dt> <dd></dd>
   754               <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example">&lt;div id='touchable'&gt;
   369             <dt>TouchList changedTouches</dt> <dd></dd>
   755     This element is touchable.
   370           </dl>
   756 &lt;/div&gt;
   371         </dd>
   757           
   372       </dl>
   758 document.getElementById('touchable').addEventListener('touchstart', function(ev) {
   373 
   759 
   374       <section>
   760     if (ev.touches.item(0) == ev.targetTouches.item(0))
   375         <h3 id="event-touchstart">The <dfn class="event">touchstart</dfn>
   761     {
       
   762         /**
       
   763          * If the first touch on the surface is also targeting the
       
   764          * "touchable" element, the code below should execute.
       
   765          * Since targetTouches is a subset of touches which covers the
       
   766          * entire surface, TouchEvent.touches &gt;= TouchEvents.targetTouches
       
   767          * is always true.
       
   768          */
       
   769 
       
   770         document.write('Hello Touch Events!');
       
   771     }
       
   772 
       
   773     if (ev.touches.length == ev.targetTouches.length)
       
   774     {
       
   775         /**
       
   776          * If all of the active touch points are on the "touchable"
       
   777          * element, the length properties should be the same.
       
   778          */
       
   779 
       
   780         document.write('All points are on target element')
       
   781     }
       
   782 
       
   783     if (ev.touches.length &gt; 1)
       
   784     {
       
   785         /**
       
   786          * On a single touch input device, there can only be one point
       
   787          * of contact on the surface, so the following code can only
       
   788          * execute when the terminal supports multiple touches.
       
   789          */
       
   790 
       
   791         document.write('Hello Multiple Touch!');
       
   792     }
       
   793 
       
   794 }, false);</pre></div>
       
   795           </section>
       
   796           
       
   797           <section id="changedtouches-of-a-touchevent">
       
   798               <h4><span class="secno">5.2.2 </span>changedTouches of a <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></h4>
       
   799               
       
   800               <p>
       
   801                 This example demonstrates the utility of changedTouches and it's relation
       
   802                 with the other <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> members of the <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a> interface.
       
   803                 The code is a example which triggers whenever a touch point is removed
       
   804                 from the defined touchable element:
       
   805               </p>
       
   806               
       
   807               <div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example">&lt;div id='touchable'&gt;
       
   808     This element is touchable.
       
   809 &lt;/div&gt;
       
   810               
       
   811 document.getElementById('touchable').addEventListener('touchend', function(ev) {
       
   812 
       
   813     /**
       
   814      * Example output when three touch points are on the surface,
       
   815      * two of them being on the "touchable" element and one point
       
   816      * in the "touchable" element is lifted from the surface:
       
   817      *
       
   818      * Touch points removed: 1
       
   819      * Touch points left on element: 1
       
   820      * Touch points left on document: 2
       
   821      */
       
   822 
       
   823     document.write('Removed: ' + ev.changedTouches.length);
       
   824     document.write('Remaining on element: ' + ev.targetTouches.length);
       
   825     document.write('Remaining on document: ' + ev.touches.length);
       
   826 
       
   827 }, false);</pre></div>
       
   828           </section>
       
   829               
       
   830       </section>
       
   831 
       
   832       <section class="informative" id="list-of-touchevent-types">
       
   833           <h3><span class="secno">5.3 </span>List of <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a> types</h3><p><em>This section is non-normative.</em></p>
       
   834 
       
   835           <p>
       
   836             The following table provides a summary of the types of possible
       
   837             <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a> types defined in this specification. All events
       
   838             should accomplish the bubbling phase. Some events are not cancelable
       
   839             (see <a href="#dfn-preventdefault" class="internalDFN">preventDefault</a>).
       
   840           </p>
       
   841           
       
   842           <!--
       
   843           // FIXME: As of the time of writing, respec.js doesn't have support for
       
   844           // tables like this - we're just piggybacking on a existing class, with
       
   845           // raw markup as a quick and dirty workaround.
       
   846           -->
       
   847 
       
   848           <table class="parameters" id="table-event-summary">
       
   849           <tbody><tr>
       
   850               <th>Event Type</th>
       
   851               <th>Sync / Async</th>
       
   852               <th>Bubbling phase</th>
       
   853               <th>Trusted proximal event target types</th>
       
   854               <th>DOM interface</th>
       
   855               <th>Cancelable</th>
       
   856               <th>Default Action</th>
       
   857           </tr>
       
   858           <tr> 
       
   859               <td><a href="#dfn-touchstart" class="internalDFN">touchstart</a></td> 
       
   860               <td>Sync</td> 
       
   861               <td>Yes</td> 
       
   862               <td><code>Document, Element</code></td> 
       
   863               <td><a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></td> 
       
   864               <td>Yes</td> 
       
   865               <td>undefined</td> 
       
   866           </tr>
       
   867           <tr> 
       
   868               <td><a href="#dfn-touchend" class="internalDFN">touchend</a></td> 
       
   869               <td>Sync</td> 
       
   870               <td>Yes</td> 
       
   871               <td><code>Document, Element</code></td> 
       
   872               <td><a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></td> 
       
   873               <td>Yes</td> 
       
   874               <td>
       
   875                 Varies: mousemove (If point has been moved), mousedown, 
       
   876                 mouseup, click
       
   877               </td> 
       
   878           </tr>
       
   879           <tr> 
       
   880               <td><a href="#dfn-touchmove" class="internalDFN">touchmove</a></td> 
       
   881               <td>Sync</td> 
       
   882               <td>Yes</td> 
       
   883               <td><code>Document, Element</code></td> 
       
   884               <td><a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></td> 
       
   885               <td>Yes</td> 
       
   886               <td>undefined</td> 
       
   887           </tr>
       
   888           <tr> 
       
   889               <td><a href="#dfn-touchcancel" class="internalDFN">touchcancel</a></td> 
       
   890               <td>Sync</td> 
       
   891               <td>Yes</td> 
       
   892               <td><code>Document, Element</code></td> 
       
   893               <td><a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a></td> 
       
   894               <td>No</td> 
       
   895               <td>none</td> 
       
   896           </tr>
       
   897           </tbody></table>
       
   898       </section>
       
   899  
       
   900       <section id="the-touchstart-event">
       
   901         <h3 id="event-touchstart"><span class="secno">5.4 </span>The <dfn class="event" id="dfn-touchstart">touchstart</dfn>
   376         event</h3>
   902         event</h3>
   377         <p>
   903         <p>
   378           A user agent must dispatch this event type to indicate when the user
   904           A user agent must dispatch this event type to indicate when the user
   379           places a <a>touch point</a> on the touch surface.
   905           places a <a href="#dfn-touch-point" class="internalDFN">touch point</a> on the touch surface.
   380         </p>
   906         </p>
   381 
   907 
   382         <p>
   908         <p>
   383           The target of this event must be an <a>Element</a>.
   909           The target of this event must be an <a>Element</a>.  If the touch
       
   910           point is within a frame, the event should be dispatched to an element
       
   911           in the <a>child browsing context</a> of that frame.
       
   912         </p>
       
   913 
       
   914         <p>
       
   915           If the <a href="#dfn-preventdefault" class="internalDFN">preventDefault</a> method is called on this event, it
       
   916           should prevent any default actions caused by any touch events
       
   917           associated with the same <a href="#dfn-active-touch-point" class="internalDFN">active touch point</a>, including mouse
       
   918           events or scrolling.
   384         </p>
   919         </p>
   385       </section>
   920       </section>
   386 
   921 
   387       <section>
   922       <section id="the-touchend-event">
   388         <h3 id="event-touchend">The <dfn class="event">touchend</dfn> event</h3>
   923         <h3 id="event-touchend"><span class="secno">5.5 </span>The <dfn class="event" id="dfn-touchend">touchend</dfn> event</h3>
   389         <p>
   924         <p>
   390           A user agent must dispatch this event type to indicate when the user
   925           A user agent must dispatch this event type to indicate when the user
   391           removes a <a>touch point</a> from the touch surface, also including
   926           removes a <a href="#dfn-touch-point" class="internalDFN">touch point</a> from the touch surface, also including
   392           cases where the touch point physically leaves the touch surface, such
   927           cases where the touch point physically leaves the touch surface, such
   393           as being dragged off of the screen.
   928           as being dragged off of the screen.
   394         </p>
   929         </p>
   395 
   930 
   396         <p>
   931         <p>
   397           The <a>target</a> of this event must be the same <a>Element</a> that
   932           The <a>target</a> of this event must be the same <a>Element</a> on 
   398           received the <a>touchstart</a> event when this <a>touch point</a> was
   933 		  which the <a href="#dfn-touch-point" class="internalDFN">touch point</a> started when it was first
   399           placed on the surface, even if the <a>touch point</a> has since moved
   934           placed on the surface, even if the <a href="#dfn-touch-point" class="internalDFN">touch point</a> has since moved
   400           outside the interactive area of the <a>target</a> element.
   935           outside the interactive area of the <a>target</a> element.
   401         </p>
   936         </p>
   402 
   937 
   403         <p>
   938         <p>
   404           The <a>touch point</a> or points that were removed must be included
   939           The <a href="#dfn-touch-point" class="internalDFN">touch point</a> or points that were removed must be included
   405           in the <a>changedTouches</a> attribute of the <a>TouchEvent</a>, and
   940           in the <a>changedTouches</a> attribute of the <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a>, and
   406           must not be included in the <a>touches</a> and <a>targetTouches</a>
   941           must not be included in the <a>touches</a> and <a>targetTouches</a>
   407           attributes.
   942           attributes.
   408         </p>
   943         </p>
   409       </section>
   944       </section>
   410 
   945 
   411       <section>
   946       <section id="the-touchmove-event">
   412         <h3 id="event-touchmove">The <dfn class="event">touchmove</dfn> event</h3>
   947         <h3 id="event-touchmove"><span class="secno">5.6 </span>The <dfn class="event" id="dfn-touchmove">touchmove</dfn> event</h3>
   413         <p>
   948         <p>
   414           A user agent must dispatch this event type to indicate when the user
   949           A user agent must dispatch this event type to indicate when the user
   415           moves a <a>touch point</a> along the touch surface.
   950           moves a <a href="#dfn-touch-point" class="internalDFN">touch point</a> along the touch surface.
   416         </p>
   951         </p>
   417 
   952 
   418         <p>
   953         <p>
   419           The <a>target</a> of this event must be the same <a>Element</a> that
   954           The <a>target</a> of this event must be the same <a>Element</a> on 
   420           received the <a>touchstart</a> event when this <a>touch point</a> was
   955 		  which the <a href="#dfn-touch-point" class="internalDFN">touch point</a> started when it was first
   421           placed on the surface, even if the <a>touch point</a> has since moved
   956           placed on the surface, even if the <a href="#dfn-touch-point" class="internalDFN">touch point</a> has since moved
   422           outside the interactive area of the <a>target</a> element.
   957           outside the interactive area of the <a>target</a> element.
   423         </p>
   958         </p>
   424 
   959 
   425         <p>
   960         <p>
   426           If the values of <a>radiusX</a>, <a>radiusY</a>,
   961           Note that the rate at which the user agent sends <a href="#dfn-touchmove" class="internalDFN">touchmove</a>
   427           <a>rotationAngle</a>, or <a>force</a> are known, then the user agent
       
   428           also must dispatch this event type to indicate when any of these
       
   429           attributes of a <a>touch point</a> have changed.
       
   430         </p>
       
   431 
       
   432         <p>
       
   433           Note that the rate at which the user agent sends <a>touchmove</a>
       
   434           events is implementation-defined, and may depend on hardware
   962           events is implementation-defined, and may depend on hardware
   435           capabilities and other implementation details.
   963           capabilities and other implementation details.
   436         </p>
   964         </p>
       
   965 
       
   966         <p>
       
   967           If the <a href="#dfn-preventdefault" class="internalDFN">preventDefault</a> method is called on the <em>first</em>
       
   968           <a href="#dfn-touchmove" class="internalDFN">touchmove</a> event of an <a href="#dfn-active-touch-point" class="internalDFN">active touch point</a>, it should
       
   969           prevent any default action caused by any <a href="#dfn-touchmove" class="internalDFN">touchmove</a> event
       
   970           associated with the same <a href="#dfn-active-touch-point" class="internalDFN">active touch point</a>, such as scrolling.
       
   971         </p>
   437       </section>
   972       </section>
   438 
   973 
   439       <section>
   974       <section id="the-touchcancel-event">
   440         <h3 id="event-touchenter">The <dfn class="event">touchenter</dfn> event</h3>
   975         <h3 id="event-touchcancel"><span class="secno">5.7 </span>The <dfn class="event" id="dfn-touchcancel">touchcancel</dfn> event</h3>
   441         <p>
       
   442           A user agent must dispatch this event type to indicate when a
       
   443           <a>touch point</a> moves onto the interactive area defined by a DOM
       
   444           element.  Events of this type must not bubble.
       
   445         </p>
       
   446       </section>
       
   447 
       
   448       <section>
       
   449         <h3 id="event-touchleave">The <dfn class="event">touchleave</dfn> event</h3>
       
   450         <p>
       
   451           A user agent must dispatch this event type to indicate when a
       
   452           <a>touch point</a> moves off the interactive area defined by a DOM
       
   453           element.  Events of this type must not bubble.
       
   454         </p>
       
   455       </section>
       
   456 
       
   457       <section>
       
   458         <h3 id="event-touchcancel">The <dfn class="event">touchcancel</dfn> event</h3>
       
   459         <p>
   976         <p>
   460           A user agent must dispatch this event type to indicate when a touch
   977           A user agent must dispatch this event type to indicate when a touch
   461           point has been disrupted in an implementation-specific manner, such as
   978           point has been disrupted in an implementation-specific manner, such as
   462           a synchronous event or action originating from the UA canceling the
   979           a synchronous event or action originating from the UA canceling the
   463           touch, or the touch point leaving the document window into a
   980           touch, or the touch point leaving the document window into a
   464           non-document area which is capable of handling user interactions.
   981           non-document area which is capable of handling user interactions.
   465           (e.g. The UA's native user interface, plug-ins)  A user agent may
   982           (e.g. The UA's native user interface, plug-ins)  A user agent may
   466           also dispatch this event type when the user places more <a>touch
   983           also dispatch this event type when the user places more <a href="#dfn-touch-point" class="internalDFN">touch
   467           point</a>s on the touch surface than the device or implementation is
   984           point</a>s on the touch surface than the device or implementation is
   468           configured to store, in which case the earliest <a>Touch</a> object
   985           configured to store, in which case the earliest <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> object
   469           in the <a>TouchList</a> should be removed.
   986           in the <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> should be removed.
       
   987         </p>
       
   988 
       
   989         <p>
       
   990           The <a>target</a> of this event must be the same <a>Element</a> on 
       
   991 		  which the <a href="#dfn-touch-point" class="internalDFN">touch point</a> started when it was first
       
   992           placed on the surface, even if the <a href="#dfn-touch-point" class="internalDFN">touch point</a> has since moved
       
   993           outside the interactive area of the <a>target</a> element.
       
   994         </p>
       
   995 
       
   996         <p>
       
   997           The <a href="#dfn-touch-point" class="internalDFN">touch point</a> or points that were removed must be included
       
   998           in the <a>changedTouches</a> attribute of the <a href="#idl-def-TouchEvent" class="idlType"><code>TouchEvent</code></a>, and
       
   999           must not be included in the <a>touches</a> and <a>targetTouches</a>
       
  1000           attributes.
   470         </p>
  1001         </p>
   471       </section>
  1002       </section>
   472     </section>
  1003     </section>
   473 
  1004 
   474     <section>
  1005     <section id="extensions-to-the-document-interface">
   475       <h2><a>DocumentTouch</a> Interface</h2>
  1006       <!--OddPage--><h2><span class="secno">6. </span>Extensions to the <a href="#idl-def-Document" class="idlType"><code>Document</code></a> Interface</h2>
   476       <p>
  1007       <p>
   477         The <a>DocumentTouch</a> interface provides a mechanism by which the
  1008         The <a href="#idl-def-Document" class="idlType"><code>Document</code></a> interface [<cite><a class="bibref" href="#bib-DOM-LEVEL-3-CORE">DOM-LEVEL-3-CORE</a></cite>] contains methods
   478         user can create <a>Touch</a> and <a>TouchList</a> objects. The
  1009         by which the user can create <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> and <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a>
   479         <a>DocumentTouch</a> interface must be implemented on the
  1010         objects.
   480         <a>Document</a> object.
  1011       </p>
   481       </p>
  1012 
   482 
  1013       <pre class="idl"><span class="idlInterface" id="idl-def-Document">partial interface <span class="idlInterfaceID">Document</span> {
   483       <dl title='interface DocumentTouch' class='idl'>
  1014 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-Touch" class="idlType"><code>Touch</code></a></span>     <span class="idlMethName"><a href="#widl-Document-createTouch-Touch-AbstractView-view-EventTarget-target-long-identifier-long-pageX-long-pageY-long-screenX-long-screenY">createTouch</a></span> (<span class="idlParam"><span class="idlParamType"><a>AbstractView</a></span> <span class="idlParamName">view</span></span>, <span class="idlParam"><span class="idlParamType"><a>EventTarget</a></span> <span class="idlParamName">target</span></span>, <span class="idlParam"><span class="idlParamType"><a>long</a></span> <span class="idlParamName">identifier</span></span>, <span class="idlParam"><span class="idlParamType"><a>long</a></span> <span class="idlParamName">pageX</span></span>, <span class="idlParam"><span class="idlParamType"><a>long</a></span> <span class="idlParamName">pageY</span></span>, <span class="idlParam"><span class="idlParamType"><a>long</a></span> <span class="idlParamName">screenX</span></span>, <span class="idlParam"><span class="idlParamType"><a>long</a></span> <span class="idlParamName">screenY</span></span>);</span>
   484         <dt>Touch createTouch()</dt>
  1015 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></span> <span class="idlMethName"><a href="#widl-Document-createTouchList-TouchList-Touch-touches">createTouchList</a></span> (<span class="idlParam">optional <span class="idlParamType"><a href="#idl-def-Touch" class="idlType"><code>Touch</code></a>...</span> <span class="idlParamName">touches</span></span>);</span>
   485         <dd>
  1016 };</span></pre><section id="methods-1"><h3><span class="secno">6.1 </span>Methods</h3><dl class="methods"><dt id="widl-Document-createTouch-Touch-AbstractView-view-EventTarget-target-long-identifier-long-pageX-long-pageY-long-screenX-long-screenY"><code>createTouch</code></dt><dd>
   486           Creates a <a>Touch</a> object with the specified attributes.
  1017           Creates a <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> object with the specified attributes.
   487           <dl class='parameters'>
  1018           
   488             <dt>AbstractView view</dt> <dd></dd>
  1019         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">view</td><td class="prmType"><code><a>AbstractView</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">target</td><td class="prmType"><code><a>EventTarget</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">identifier</td><td class="prmType"><code><a>long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">pageX</td><td class="prmType"><code><a>long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">pageY</td><td class="prmType"><code><a>long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">screenX</td><td class="prmType"><code><a>long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">screenY</td><td class="prmType"><code><a>long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-Touch" class="idlType"><code>Touch</code></a></code></div></dd><dt id="widl-Document-createTouchList-TouchList-Touch-touches"><code>createTouchList</code></dt><dd>
   489             <dt>EventTarget target</dt> <dd></dd>
  1020           Creates a <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> object consisting of zero or more <a href="#idl-def-Touch" class="idlType"><code>Touch</code></a> objects.
   490             <dt>long identifier</dt> <dd></dd>
  1021           Calling this method with no arguments creates a <a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a> with no objects in it 
   491             <dt>long pageX</dt> <dd></dd>
  1022           and length 0 (zero). 
   492             <dt>long pageY</dt> <dd></dd>
  1023           
   493             <dt>long screenX</dt> <dd></dd>
  1024         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">touches</td><td class="prmType"><code><a href="#idl-def-Touch" class="idlType"><code>Touch</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-TouchList" class="idlType"><code>TouchList</code></a></code></div></dd></dl></section>
   494             <dt>long screenY</dt> <dd></dd>
       
   495             <dt>optional long clientX</dt> <dd></dd>
       
   496             <dt>optional long clientY</dt> <dd></dd>
       
   497             <dt>optional long radiusX</dt> <dd></dd>
       
   498             <dt>optional long radiusY</dt> <dd></dd>
       
   499             <dt>optional float rotationAngle</dt> <dd></dd>
       
   500             <dt>optional float force</dt> <dd></dd>
       
   501           </dl>
       
   502         </dd>
       
   503 
       
   504         <dt>TouchList createTouchList()</dt>
       
   505         <dd>
       
   506           Creates a <a>TouchList</a> object containing the specified
       
   507           <a>Touch</a> objects.
       
   508           <dl class='parameters'>
       
   509             <dt>Touch[] touches</dt> <dd></dd>
       
   510           </dl>
       
   511         </dd>
       
   512 
       
   513         <dt>TouchList createTouchList()</dt>
       
   514         <dd>
       
   515           Creates a <a>TouchList</a> object containing a single <a>Touch</a>.
       
   516           <dl class='parameters'>
       
   517             <dt>Touch touch</dt> <dd></dd>
       
   518           </dl>
       
   519         </dd>
       
   520       </dl>
       
   521 
       
   522       <p class="issue" id="issue-createTouch-pageXY">
       
   523         <strong>Issue:</strong>
       
   524         Does <a>createTouch</a> need to take both pageX/pageY <em>and</em>
       
   525         clientX/clientY as parameters?  If not, which pair should be removed?
       
   526       </p>
       
   527     </section>
  1025     </section>
   528 
  1026 
   529     <section id="mouse-events">
  1027     <section id="mouse-events">
   530       <h2>Interaction with Mouse Events</h2>
  1028       <!--OddPage--><h2><span class="secno">7. </span>Interaction with Mouse Events</h2>
   531       <p>
  1029       <p>
   532         The user agent may dispatch both touch events and mouse events
  1030         The user agent may dispatch both touch events and mouse events
   533         [[!DOM-LEVEL-2-EVENTS]] in response to the same user input.  If the
  1031         [<cite><a class="bibref" href="#bib-DOM-LEVEL-2-EVENTS">DOM-LEVEL-2-EVENTS</a></cite>] in response to the same user input.  If the
   534         user agent dispatches both touch events and mouse events in response to
  1032         user agent dispatches both touch events and mouse events in response to
   535         a single user action, then the <a>touchstart</a> event type must be
  1033         a single user action, then the <a href="#dfn-touchstart" class="internalDFN">touchstart</a> event type must be
   536         dispatched before any mouse event types for that action.  If the
  1034         dispatched before any mouse event types for that action.  If the
   537         <a>preventDefault</a> method of <a>touchstart</a> or <a>touchmove</a>
  1035         <a href="#dfn-preventdefault" class="internalDFN">preventDefault</a> method of <a href="#dfn-touchstart" class="internalDFN">touchstart</a> or <a href="#dfn-touchmove" class="internalDFN">touchmove</a>
   538         is called, the user agent should not dispatch any mouse event that
  1036         is called, the user agent should not dispatch any mouse event that
   539         would be a consequential result of the the prevented touch event.
  1037         would be a consequential result of the the prevented touch event.
   540       </p>
  1038       </p>
   541 
  1039 
       
  1040       <div class="note"><div class="note-title"><span>Note</span></div><p class="">
       
  1041         If a Web application can process touch events, it can intercept them, 
       
  1042         and no corresponding mouse events would need to be dispatched by the 
       
  1043         user agent. If the Web application is not specifically written for 
       
  1044         touch input devices, it can react to the subsequent mouse events instead.
       
  1045       </p></div>
       
  1046 
       
  1047       <p>
       
  1048         If the user agent intreprets a sequence of touch events as a click,
       
  1049         then it should dispatch <a>mousemove</a>, <a>mousedown</a>,
       
  1050         <a>mouseup</a>, and <a>click</a> events (in that order) at the location
       
  1051         of the <a href="#dfn-touchend" class="internalDFN">touchend</a> event for the corresponding touch input.  If the
       
  1052         contents of the document have changed during processing of the touch
       
  1053         events, then the user agent may dispatch the mouse events to a
       
  1054         different target than the touch events.
       
  1055       </p>
       
  1056 
   542       <p>
  1057       <p>
   543         The default actions and ordering of any further touch and mouse events
  1058         The default actions and ordering of any further touch and mouse events
   544         are implementation-defined, except as specified elsewhere.
  1059         are implementation-defined, except as specified elsewhere.
   545       </p>
  1060       </p>
   546     </section>
  1061     </section>
   547 
  1062 
   548     <section>
  1063     <section id="glossary">
   549       <h2>Glossary</h2>
  1064       <!--OddPage--><h2><span class="secno">8. </span>Glossary</h2>
   550 
  1065 
   551       <dl>
  1066       <dl>
   552         <dt><dfn>active touch event session</dfn></dt>
  1067         <dt><dfn id="dfn-active-touch-point">active touch point</dfn></dt>
   553         <dd>
  1068         <dd>
   554           A conceptual state in which there is at least one instance of a
  1069           A <a href="#dfn-touch-point" class="internalDFN">touch point</a> which is currently on the screen and is being
   555           <a>TouchEvent</a> event with at least one non-empty <a>TouchList</a>.
  1070           tracked by the user agent.  The touch point becomes active when the
   556           <!-- <pre class='example'>
  1071           user agent first dispatches a <a href="#dfn-touchstart" class="internalDFN">touchstart</a> event indicating its
   557           </pre> -->
  1072           appearance.  It ceases to be active after the user agent dispatches a
       
  1073           <a href="#dfn-touchend" class="internalDFN">touchend</a> or <a href="#dfn-touchcancel" class="internalDFN">touchcancel</a> event indicating that the touch
       
  1074           point is removed from the surface or no longer tracked.
   558         </dd>
  1075         </dd>
   559 
  1076 
   560         <dt><dfn>touch point</dfn></dt>
  1077         <dt><dfn id="dfn-touch-point">touch point</dfn></dt>
   561         <dd>
  1078         <dd>
   562           The coordinate point at which a pointer (e.g finger or stylus)
  1079           The coordinate point at which a pointer (e.g finger or stylus)
   563           intersects the target surface of an interface.  This may apply to a
  1080           intersects the target surface of an interface.  This may apply to a
   564           finger touching a touch-screen, or an digital pen writing on a piece
  1081           finger touching a touch-screen, or an digital pen writing on a piece
   565           of paper.
  1082           of paper.
   566         </dd>
  1083         </dd>
       
  1084         
       
  1085         <dt><dfn id="dfn-preventdefault">preventDefault</dfn></dt>
       
  1086         <dd>
       
  1087           If a event is cancelable, the preventDefault method is used to signify
       
  1088           that the event is to be canceled, and any default actions defined in the
       
  1089           user agent as a result of this event, or consequential events from the
       
  1090           canceled event will not occur. Calling this method on non-cancelable
       
  1091           events will have no effect.
       
  1092         </dd>        
   567       </dl>
  1093       </dl>
   568     </section>
  1094     </section>
   569 
  1095 
   570     <section id='issues' class='informative'>
  1096     <section id="issues" class="informative">
   571       <h2>Issues</h2>
  1097       <!--OddPage--><h2><span class="secno">9. </span>Issues</h2><p><em>This section is non-normative.</em></p>
   572       <p>
  1098       <p>
   573         The working group maintains <a
  1099         The working group maintains <a href="http://www.w3.org/2010/webevents/track/products/2">a list of open issues in this specification</a>.  These issues may be
   574          href='http://www.w3.org/2010/webevents/track/products/2'
       
   575         >a list of open issues in this specification</a>.  These issues may be
       
   576         addressed in future revisions of the specification.
  1100         addressed in future revisions of the specification.
   577       </p>
  1101       </p>
   578     </section>
  1102     </section>
   579 
  1103 
   580     <section class='appendix informative'>
  1104     <section class="appendix informative" id="acknowledgements">
   581       <h2>Acknowledgements</h2>
  1105       <!--OddPage--><h2><span class="secno">A. </span>Acknowledgements</h2><p><em>This section is non-normative.</em></p>
   582       <p>
  1106       <p>
   583         Many thanks to the WebKit engineers for developing the model used as a
  1107         Many thanks to the WebKit engineers for developing the model used as a
   584         basis for this spec, Neil Roberts (SitePen) for his summary of WebKit
  1108         basis for this spec, Neil Roberts (SitePen) for his summary of WebKit
   585         touch events, Peter-Paul Koch (PPK) for his write-ups and suggestions,
  1109         touch events, Peter-Paul Koch (PPK) for his write-ups and suggestions,
   586         Robin Berjon for developing the <a
  1110         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
   587           href="http://dev.w3.org/2009/dap/ReSpec.js/documentation.html"
       
   588         >ReSpec.js spec authoring tool</a>, and the WebEvents WG for their many
       
   589         contributions.
  1111         contributions.
   590       </p>
  1112       </p>
   591 
  1113 
   592       <p>
  1114       <p>
   593         Many others have made additional comments as the spec developed, which
  1115         Many others have made additional comments as the spec developed, which
   594         have led to steady improvements.  Among them are Matthew Schinckel,
  1116         have led to steady improvements.  Among them are Matthew Schinckel,
   595         Andrew Grieve, and Cathy Chan. If I inadvertently omitted your name,
  1117         Andrew Grieve, and Cathy Chan. If I inadvertently omitted your name,
   596         please let me know.
  1118         please let me know.
   597       </p>
  1119       </p>
   598     </section>
  1120     </section>
   599   </body>
  1121   
   600 </html>
  1122 
       
  1123 <section id="references" class="appendix"><!--OddPage--><h2><span class="secno">B. </span>References</h2><section id="normative-references"><h3><span class="secno">B.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-DOM-LEVEL-2-EVENTS">[DOM-LEVEL-2-EVENTS]</dt><dd>Tom Pixley. <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113"><cite>Document Object Model (DOM) Level 2 Events Specification.</cite></a> 13 November 2000. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113">http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113</a> 
       
  1124 </dd><dt id="bib-DOM-LEVEL-3-CORE">[DOM-LEVEL-3-CORE]</dt><dd>Gavin Nicol; et al. <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407"><cite>Document Object Model (DOM) Level 3 Core Specification.</cite></a> 7 April 2004. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407">http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407</a> 
       
  1125 </dd><dt id="bib-RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119.  URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a> 
       
  1126 </dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd>Cameron McCormack. <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/"><cite>Web IDL.</cite></a> 27 September 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a> 
       
  1127 </dd></dl></section></section></body></html>
       
  1128