<?xml version="1.0" encoding="us-ascii"?>
<spec w3c-doctype="wd" role="public">
<?command-options --map Copyright-Notice copyright-notice
--map Introduction     introduction
--map TOC              expanded-toc
--map Core             core
--map Events           events
--map idl              idl-definitions
--map ecma-binding     ecma-script-binding
--map java-binding     java-binding
--map Index            def-index
--map Objects          object-index
--map References       references
--map Errors           errors
--map Level-3-AS       abstract-schemas
--map Load-Save        load-save
--map XPath            xpath
--map KeySet           keyset
?>
<?command-options --map -IndexFile-       def-index
--map -OjbectIndexFile- object-index
--strip-references
--strip-glossary
?>
<?command-options --map-type ECMAScript void void
--map-type ECMAScript "unsigned short" Number
--map-type ECMAScript "unsigned int" Number
--map-type ECMAScript "unsigned long" Number
--map-type ECMAScript short Number
--map-type ECMAScript long Number
--map-type ECMAScript float Number
--map-type ECMAScript double Number
--map-type ECMAScript boolean Boolean
--map-type ECMAScript Object Object
--map-type ECMAScript DOMString String
--map-type ECMAScript DOMTimeStamp Number
--map-type ECMAScript DOMObject Object
--map-type ECMAScript DOMUserData "any type"
--map-type ECMAScript LSInputStream Object
--map-type ECMAScript LSOutputStream Object
--map-type ECMAScript LSReader "this is an error and shouldn't be used."
--map-type ECMAScript LSWriter "this is an error and shouldn't be used."
--map-type ECMAScript DOMSystemException Object

--map-type Java void void
--map-type Java Object Object
--map-type Java DOMString String
--map-type Java "unsigned short" short
--map-type Java "unsigned int" int
--map-type Java "unsigned long" int
--map-type Java long int
--map-type Java short short
--map-type Java float float
--map-type Java double double
--map-type Java boolean boolean
--map-type Java DOMTimeStamp long
--map-type Java DOMObject Object
--map-type Java DOMUserData Object
--map-type Java LSInputStream java.io.InputStream
--map-type Java LSOutputStream java.io.OutputStream
--map-type Java LSReader java.io.Reader
--map-type Java LSWriter java.io.Writer
--map-type Java DOMSystemException Exception
?>
 <header>
  <title>
   Document Object Model (DOM) Level 3 Events Specification
  </title>

  <version>
   1.0
  </version>

  <w3c-designation>WD-DOM-Level-3-Events-20060413</w3c-designation>

  <w3c-doctype>W3C Working Draft</w3c-doctype>

  <pubdate>
   <day>13</day>

   <month>April</month>

   <year>2006</year>
  </pubdate>

  <publoc>
   <loc href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413</loc>
  </publoc>

  <altlocs>
   <loc role="html" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/xml-source.xml" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">XML
   file</loc>
   <loc role="postscript" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/DOM3-Events.ps" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">PostScript
   file</loc>
   <loc role="pdf" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/DOM3-Events.pdf" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">PDF
   file</loc>
   <loc role="html" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/DOM3-Events.html" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">single
   HTML file</loc>
   <loc role="zip" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/DOM3-Events.zip" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">ZIP
   file</loc>
  </altlocs>

  <latestloc>
   <loc href="http://www.w3.org/TR/DOM-Level-3-Events" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/TR/DOM-Level-3-Events</loc>
  </latestloc>

  <prevlocs>
   <loc href="http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/</loc>
  </prevlocs>

  <authlist>
   <author role="editor">
    <name>Bj&#246;rn H&#246;hrmann</name>

    <email href="mailto:bjoern@hoehrmann.de" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">bjoern@hoehrmann.de</email>
   </author>

   <author role="editor">
    <name>Philippe Le H&#233;garet</name>

    <affiliation>W3C (until November 2003)</affiliation>
   </author>

   <author role="editor">
    <name>Tom Pixley</name>

    <affiliation>Netscape Communications Corporation (until July 2002)</affiliation>
   </author>
  </authlist>

  <abstract id="id-abstract">
   <p>
    This specification defines the Document Object Model Events Level 3,
    a generic platform- and language-neutral event system which allows
    registration of event handlers, describes event flow through a tree
    structure, and provides basic contextual information for each event.
    The Document Object Model Events Level 3 builds on the Document
    Object Model Events Level 2
    <bibref role="normative" ref="DOM2Events"></bibref>.
   </p>
  </abstract>

  <status id="Level-3-status">
   <p>
    <emph>This section describes the status of this document at the time
    of its publication. Other documents may supersede this document. A
    list of current W3C publications and the latest revision of this
    technical report can be found in the
    <loc href="http://www.w3.org/TR/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">W3C
    technical reports index</loc> at http://www.w3.org/TR/. </emph>
   </p>

   <p>
    This document is the 13 April 2006
    <loc href="http://www.w3.org/2005/10/Process-20051014/tr.html#RecsWD" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Working
    Draft</loc> of the DOM Level 3 Events specification. This document
    has been produced by the
    <loc href="http://www.w3.org/2006/webapi/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Web
    API Working Group</loc>, part of the
    <loc href="http://www.w3.org/2006/rwc/Activity" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Rich
    Web Clients Activity</loc> in the
    <loc href="http://www.w3.org/Interaction/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Interaction
    Domain</loc>. The previous version of this document was a
    <loc href="http://www.w3.org/2005/10/Process-20051014/tr.html#WGNote" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Working
    Group Note</loc> published by the
    <loc href="http://www.w3.org/DOM/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">DOM
    Working Group</loc> in November 2003. This version moves the
    specification back onto the W3C Recommendation Track.
   </p>

   <p>
    Feedback on this document is welcome and comments should be sent to
    the
    <loc href="http://lists.w3.org/Archives/Public/public-webapi/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">publicly
    archived</loc> mailing list
    <loc href="mailto:public-webapi@w3.org" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">public-webapi@w3.org</loc>
    (see
    <loc href="http://www.w3.org/Mail/Request" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">instructions</loc>).
    Please send a separate mail for each issue and use the prefix
    'DOM3EV:' in the subject. For more information refer to the
    <loc href="http://www.w3.org/2006/webapi/track/products/2" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">list
    of open issues</loc> under consideration by the Working Group and
    <loc href="changes.html#Changes" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Appendix
    B: Changes</loc>.
   </p>

   <p>
    Publication as a Working Draft does not imply endorsement by the W3C
    Membership. This is a draft document and may be updated, replaced or
    obsoleted by other documents at any time. It is inappropriate to
    cite this document as other than work in progress.
   </p>

   <p>
    This document was produced by a group operating under the
    <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">5
    February 2004 W3C Patent Policy</loc>. W3C maintains a
    <loc role="disclosure" href="http://www.w3.org/2004/01/pp-impl/38482/status" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">public
    list of any patent disclosures</loc> made in connection with the
    deliverables of the group; that page also includes instructions for
    disclosing a patent. An individual who has actual knowledge of a
    patent which the individual believes contains
    <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Essential
    Claim(s)</loc> must disclose the information in accordance with
    <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">section
    6 of the W3C Patent Policy</loc>.
   </p>
  </status>

  <sourcedesc>
   <p>
    Created in electronic form.
   </p>
  </sourcedesc>

  <langusage>
   <language id="en">English</language>
  </langusage>

  <revisiondesc>
   <p>
    $Revision: 1.2 $
   </p>
  </revisiondesc>
<?GENERATE-TOC?>
 </header>

 <front>
  <div1 id="TOC">
   <head>
    Expanded Table of Contents
   </head>
<?GENERATE-EXPANDED-TOC?>
  </div1>

  <div1 id="Copyright-Notice">
   <head>
    W3C Copyright Notices and Licenses
   </head>

   <p role="important">
    Copyright &#169; 2006
    <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
    Wide Web Consortium</loc>,
    (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
    Institute of Technology</loc>,
    <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
    Research Consortium for Informatics and Mathematics</loc>,
    <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
    University</loc>). All Rights Reserved.
   </p>

   <p>
    This document is published under the
    <specref ref="Copyright-notice-document"></specref>. The bindings
    within this document are published under the
    <specref ref="Copyright-notice-software"></specref>. The software
    license requires "Notice of any changes or modifications to the W3C
    files, including the date changes were made." Consequently, modified
    versions of the DOM bindings must document that they do not conform
    to the W3C standard; in the case of the IDL definitions, the pragma
    prefix can no longer be 'w3c.org'; in the case of the Java language
    binding, the package names can no longer be in the 'org.w3c'
    package.
   </p>

   <div2 id="Copyright-notice-document">
    <head>
     W3C<sup>&#174;</sup> Document Copyright Notice and License
    </head>

    <note>
     <p>
      This section is a copy of the W3C<sup>&#174;</sup> Document Notice
      and License and could be found at
      <loc href="http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231</loc>.
     </p>
    </note>

    <p role="important">
     Copyright &#169; 2006
     <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
     Wide Web Consortium</loc>,
     (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
     Institute of Technology</loc>,
     <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
     Research Consortium for Informatics and Mathematics</loc>,
     <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
     University</loc>). All Rights Reserved.
    </p>

    <p role="important">
     http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
    </p>

    <p>
     Public documents on the W3C site are provided by the copyright
     holders under the following license. By using and/or copying this
     document, or the W3C document from which this statement is linked,
     you (the licensee) agree that you have read, understood, and will
     comply with the following terms and conditions:
    </p>

    <p>
     Permission to copy, and distribute the contents of this document,
     or the W3C document from which this statement is linked, in any
     medium for any purpose and without fee or royalty is hereby
     granted, provided that you include the following on
     <emph>ALL</emph> copies of the document, or portions thereof, that
     you use:
    </p>

    <olist>
     <item>
      <p>
       A link or URL to the original W3C document.
      </p>
     </item>

     <item>
      <p>
       The pre-existing copyright notice of the original author, or if
       it doesn't exist, a notice (hypertext is preferred, but a textual
       representation is permitted) of the form: "Copyright &#169;
       [$date-of-document]
       <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
       Wide Web Consortium</loc>,
       (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
       Institute of Technology</loc>,
       <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
       Research Consortium for Informatics and Mathematics</loc>,
       <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
       University</loc>). All Rights Reserved.
       <loc href="http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231</loc>"
      </p>
     </item>

     <item>
      <p>
       <emph>If it exists</emph>, the STATUS of the W3C document.
      </p>
     </item>
    </olist>

    <p>
     When space permits, inclusion of the full text of this
     <emph role="important">NOTICE</emph> should be provided. We request
     that authorship attribution be provided in any software, documents,
     or other items or products that you create pursuant to the
     implementation of the contents of this document, or any portion
     thereof.
    </p>

    <p>
     No right to create modifications or derivatives of W3C documents is
     granted pursuant to this license. However, if additional
     requirements (documented in the
     <loc href="http://www.w3.org/Consortium/Legal/IPR-FAQ" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Copyright
     FAQ</loc>) are satisfied, the right to create modifications or
     derivatives is sometimes granted by the W3C to individuals
     complying with those requirements.
    </p>

    <p>
     THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
     REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT
     NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
     PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
     OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
     IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
     PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
    </p>

    <p>
     COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
     SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
     DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS
     THEREOF.
    </p>

    <p>
     The name and trademarks of copyright holders may NOT be used in
     advertising or publicity pertaining to this document or its
     contents without specific, written prior permission. Title to
     copyright in this document will at all times remain with copyright
     holders.
    </p>
   </div2>

   <div2 id="Copyright-notice-software">
    <head>
     W3C<sup>&#174;</sup> Software Copyright Notice and License
    </head>

    <note>
     <p>
      This section is a copy of the W3C<sup>&#174;</sup> Software
      Copyright Notice and License and could be found at
      <loc href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</loc>
     </p>
    </note>

    <p role="important">
     Copyright &#169; 2006
     <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
     Wide Web Consortium</loc>,
     (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
     Institute of Technology</loc>,
     <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
     Research Consortium for Informatics and Mathematics</loc>,
     <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
     University</loc>). All Rights Reserved.
    </p>

    <p role="important">
     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
    </p>

    <p>
     This work (and included software, documentation such as READMEs, or
     other related items) is being provided by the copyright holders
     under the following license. By obtaining, using and/or copying
     this work, you (the licensee) agree that you have read, understood,
     and will comply with the following terms and conditions.
    </p>

    <p>
     Permission to copy, modify, and distribute this software and its
     documentation, with or without modification, for any purpose and
     without fee or royalty is hereby granted, provided that you include
     the following on ALL copies of the software and documentation or
     portions thereof, including modifications:
    </p>

    <olist>
     <item>
      <p>
       The full text of this NOTICE in a location viewable to users of
       the redistributed or derivative work.
      </p>
     </item>

     <item>
      <p>
       Any pre-existing intellectual property disclaimers, notices, or
       terms and conditions. If none exist, the
       <specref ref="Copyright-short-notice"></specref> should be
       included (hypertext is preferred, text is permitted) within the
       body of any redistributed or derivative code.
      </p>
     </item>

     <item>
      <p>
       Notice of any changes or modifications to the files, including
       the date changes were made. (We recommend you provide URIs to the
       location from which the code is derived.)
      </p>
     </item>
    </olist>

    <p>
     THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
     HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
     INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR
     FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE
     OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
     COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
    </p>

    <p>
     COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
     SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
     SOFTWARE OR DOCUMENTATION.
    </p>

    <p>
     The name and trademarks of copyright holders may NOT be used in
     advertising or publicity pertaining to the software without
     specific, written prior permission. Title to copyright in this
     software and any associated documentation will at all times remain
     with copyright holders.
    </p>
   </div2>

   <div2 id="Copyright-short-notice">
    <head>
     W3C<sup>&#174;</sup> Short Software Notice
    </head>

    <note>
     <p>
      This section is a copy of the W3C<sup>&#174;</sup> Short Software
      Notice and could be found at
      <loc href="http://www.w3.org/Consortium/Legal/2002/copyright-software-short-notice-20021231" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">http://www.w3.org/Consortium/Legal/2002/copyright-software-short-notice-20021231</loc>
     </p>
    </note>

    <p role="important">
     Copyright &#169; 2006
     <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
     Wide Web Consortium</loc>,
     (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
     Institute of Technology</loc>,
     <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
     Research Consortium for Informatics and Mathematics</loc>,
     <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
     University</loc>). All Rights Reserved.
    </p>

    <p>
     Copyright &#169; [$date-of-software]
     <loc href="http://www.w3.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">World
     Wide Web Consortium</loc>,
     (<loc href="http://www.lcs.mit.edu/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Massachusetts
     Institute of Technology</loc>,
     <loc href="http://www.ercim.org/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">European
     Research Consortium for Informatics and Mathematics</loc>,
     <loc href="http://www.keio.ac.jp/" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">Keio
     University</loc>). All Rights Reserved. This work is distributed
     under the W3C<sup>&#174;</sup> Software License [1] in the hope
     that it will be useful, but WITHOUT ANY WARRANTY; without even the
     implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.
    </p>

    <p>
     [1]
     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
    </p>
   </div2>
  </div1>
 </front>

 <body>
  <div1 id="Events">
   <head>
    Document Object Model Events
   </head>

   <orglist role="editors">
    <member>
     <name>Bj&#246;rn H&#246;hrmann</name>
    </member>

    <member>
     <name>Philippe Le H&#233;garet</name>

     <affiliation>W3C (until November 2003)</affiliation>
    </member>

    <member>
     <name>Tom Pixley</name>

     <affiliation>Netscape Communications Corporation (until July 2002)</affiliation>
    </member>
   </orglist>
<?GENERATE-MINI-TOC?>
   <div2 id="Events-overview">
    <head>
     Introduction
    </head>

    <p>
     DOM Events is designed with two main goals. The first goal is the
     design of an <termref def="dt-event">event</termref> system which
     allows registration of event listeners and describes event flow
     through a tree structure. Additionally, the specification will
     provide standard modules of events for user interface control and
     document mutation notifications, including defined contextual
     information for each of these event modules.
    </p>

    <p>
     The second goal of the DOM Events is to provide a common subset of
     the current event systems used in <termref def="dt-DOM-Level-0">DOM
     Level 0</termref> browsers. This is intended to foster
     interoperability of existing scripts and content. It is not
     expected that this goal will be met with full backwards
     compatibility. However, the specification attempts to achieve this
     when possible.
    </p>

    <p>
     The following sections of the specification define both the
     specification for the DOM Event Model and a number of conformant
     event modules designed for use within the model. The DOM Event
     Model consists of:
    </p>

    <ulist>
     <item>
      <p>
       The <specref ref="Events-flow"></specref>, which describe the
       flow of events in a tree-based structure.
      </p>
     </item>

     <item>
      <p>
       A set of interfaces to access contextual information on events
       and to register event listeners.
      </p>
     </item>
    </ulist>

    <div3 id="Events-flows">
     <head>
      Event flows
     </head>

     <p>
      This document specifies an event flow for tree-based structures:
      <specref ref="Events-flow"></specref>. While it is expected that
      HTML and XML applications will follow this event flow,
      applications might reuse the interfaces defined in this document
      for non tree-based structures. In that case, it is the
      responsibility of such applications to define their event flow and
      how it relates to the <specref ref="Events-flow"></specref>. An
      example of such use can be found in
      <bibref role="informative" ref="DOMLS"></bibref>.
     </p>
    </div3>

    <div3 id="Conformance">
     <head>
      Conformance
     </head>

     <p>
      An implementation is DOM Level 3 Events conformant if it supports
      the Core module defined in <bibref ref="DOM2Core"></bibref>, the
      <specref ref="Events-flow"></specref> and the interfaces with
      their associated semantics defined in
      <specref ref="Events-interface"></specref>. An implementation
      conforms to a DOM Level 3 Events module if it conforms to DOM
      Level 3 Events and the event types defined in the module. An
      implementation conforms to an event type if it conforms to its
      associated semantics and DOM interfaces. For example, an
      implementation conforms to the DOM Level 3 User Interface Events
      module (see
      <specref ref="Events-eventgroupings-uievents"></specref>) if it
      conforms to DOM Level 3 Events (i.e. implements all the basic
      interfaces), can generate the event types
      <termref def="event-DOMActivate">DOMActivate</termref>,
      <termref def="event-DOMFocusIn">DOMFocusIn</termref>,
      <termref def="event-DOMFocusOut">DOMFocusOut</termref>,
      <termref def="event-focus">focus</termref>, and
      <termref def="event-blur">blur</termref> accordingly to their
      semantics, supports the <code>UIEvent</code> interface, and
      conforms to the DOM Level 2 Core module.
     </p>

     <note>
      <p>
       An implementation which does not conform to an event module can
       still implement the DOM interfaces associated with it. The DOM
       application can then create an event object using the
       <code>DocumentEvent.createEvent()</code> method and dispatch an
       event type associated with this interface using the
       <code>EventTarget.dispatchEvent()</code> method.
      </p>
     </note>

     <p>
      A DOM application may use the <code>hasFeature(feature,
      version)</code> method of the <code>DOMImplementation</code>
      interface with parameter values <code>"Events"</code> and
      <code>"3.0"</code> (respectively) to determine whether or not DOM
      Level 3 Events is supported by the implementation. In order to
      fully support DOM Level 3 Events, an implementation must also
      support the "Core" feature defined in the DOM Level 2 Core
      specification <bibref ref="DOM2Core"></bibref> and use the
      <specref ref="Events-flow"></specref>. For additional information
      about
      <xspecref href="http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">conformance</xspecref>,
      please see the DOM Level 3 Core specification
      <bibref ref="DOMCore"></bibref>. DOM Level 3 Events is built on
      top of DOM Level 2 Events <bibref ref="DOM2Events"></bibref>, i.e.
      a DOM Level 3 Events implementation where
      <code>hasFeature("Events", "3.0")</code> returns <code>true</code>
      must also return <code>true</code> when the <code>version</code>
      number is <code>"2.0"</code>, <code>""</code> or,
      <code>null</code>.
     </p>

     <p>
      Each event module describes its own feature string in the event
      module listing.
     </p>

     <note>
      <p>
       This specification is to be understood in the context of the DOM
       Level 3 Core specification <bibref ref="DOMCore"></bibref> and
       the general considerations for DOM implementations apply. For
       example, handling of <termref def="dt-namespaceURI">namespace
       URIs</termref> is discussed in
       <xspecref href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">XML
       Namespaces</xspecref>, and behavior in exceptional circumstances
       (such as when a <code>null</code> argument is passed when
       <code>null</code> was not expected) is discussed under
       <xspecref href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-17189187" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">DOMException</xspecref>.
      </p>
     </note>
    </div3>
   </div2>

   <div2 id="Events-flow">
    <head>
     DOM event flow
    </head>

    <p>
     <termdef id="dt-event-flow" term="DOM event flow">
      The DOM event flow is the process through which the
      <termref def="dt-event">event</termref> originates from the DOM
      Events implementation and is dispatched into a tree.
     </termdef>
     Each event has an <termref def="dt-event-target">event
     target</termref>, a targeted node in the case of the DOM Event
     flow, toward which the event is dispatched by the DOM Events
     implementation.
    </p>

    <div3 id="Events-phases">
     <head>
      Phases
     </head>

     <p>
      The event is dispatched following a path from the root of the tree
      to this <termref def="dt-target-node">target node</termref>. It
      can then be handled locally at the target node level or from any
      target's ancestors higher in the tree. The event dispatching (also
      called event propagation) occurs in three phases and the following
      order:
     </p>

     <olist>
      <item>
       <p>
        The <termref def="dt-capture-phase">capture phase</termref>: the
        event is dispatched to the target's ancestors from the root of
        the tree to the direct parent of the
        <termref def="dt-target-node">target node</termref>.
       </p>
      </item>

      <item>
       <p>
        The <termref def="dt-target-phase">target phase</termref>: the
        event is dispatched to the <termref def="dt-target-node">target
        node</termref>.
       </p>
      </item>

      <item>
       <p>
        The <termref def="dt-bubbling-phase">bubbling phase</termref>:
        the event is dispatched to the target's ancestors from the
        direct parent of the <termref def="dt-target-node">target
        node</termref> to the root of the tree.
       </p>
      </item>
     </olist>

     <graphic source="images/eventflow.png" alt="graphical representation of an event dispatched in a DOM tree using the DOM event flow" xlink:actuate="onLoad" xlink:show="embed" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink"></graphic>

     <p>
      The target's ancestors are determined before the initial dispatch
      of the event. If the target node is removed during the
      dispatching, or a target's ancestor is added or removed, the event
      propagation will always be based on the target node and the
      target's ancestors determined before the dispatch.
     </p>

     <p>
      Some events may not necessarily accomplish the three phases of the
      DOM event flow, e.g. the event could only be defined for one or
      two phases. As an example, events defined in this specification
      will always accomplish the capture and target phases but some will
      not accomplish the bubbling phase ("bubbling events" versus
      "non-bubbling events", see also the <code>Event.bubbles</code>
      attribute).
     </p>
    </div3>

    <div3 id="Events-listeners">
     <head>
      Event listeners
     </head>

     <p>
      Each node encountered during the dispatch of the event may contain
      event listeners.
     </p>

     <div4 id="Events-listeners-registration">
      <head>
       Registration of event listeners
      </head>

      <p>
       Event listeners can be registered on all nodes in the tree for a
       specific type of event (<specref ref="Event-types"></specref>) or
       event category
       (<specref ref="Events-EventTypes-category"></specref>), phase,
       and group (<specref ref="Event-groups"></specref>).
      </p>

      <p>
       If the event listener is being registered on a node while an
       event gets processed on this node, the event listener will not be
       triggered during the current phase but may be triggered during a
       later phase in the event flow, i.e. the
       <termref def="dt-bubbling-phase">bubbling phase</termref>.
      </p>
     </div4>

     <div4 id="Event-groups">
      <head>
       Event groups
      </head>

      <p>
       An event listener is always part of a group. It is either
       explicitly in a group if a group has been specified at the
       registration or implicitly in the default group if no group has
       been specified. Within a group, event listeners are ordered in
       their order of registration. If two event listeners {A1, A2},
       which are part of the same group, are registered one after the
       other (A1, then A2) for the same phase, the DOM event flow
       guarantees their triggering order (A1, then A2). If the two
       listeners are not part of the same group, no specification is
       made as to the order in which they will be triggered.
      </p>

      <p>
       In general, a DOM application does not need to define and use a
       separate group unless other event listeners, external to the DOM
       application, may change the event propagation (e.g. from a
       concurrent DOM application, from imported functionalities that
       rely on the event system, etc.).
      </p>

      <note>
       <p>
        While this specification does not specify a full ordering (i.e.
        groups are still unordered), it does specify ordering within a
        group. This implies that if the event listeners {A1, A2, B1,
        B2}, with A and B being two different groups, are registered for
        the same phase in the order A1, A2, B1, and B2, the following
        triggering orders are possible and conform to the DOM event
        flow:
       </p>

       <ulist>
        <item>
         <p>
          {A1, A2, B1, B2}
         </p>
        </item>

        <item>
         <p>
          {A1, B1, A2, B2}
         </p>
        </item>

        <item>
         <p>
          {B1, A1, A2, B2}
         </p>
        </item>

        <item>
         <p>
          {A1, B1, B2, A2}
         </p>
        </item>

        <item>
         <p>
          {B1, A1, B2, A2}
         </p>
        </item>

        <item>
         <p>
          {B1, B2, A1, A2}
         </p>
        </item>
       </ulist>

       <p>
        DOM Events implementations may impose priorities on groups but
        DOM applications must not rely on it. Unlike this specification,
        <bibref ref="DOM2Events"></bibref> did not specify any
        triggering order for event listeners.
       </p>
      </note>
     </div4>

     <div4 id="Events-listeners-activation">
      <head>
       Triggering an event listener
      </head>

      <p>
       When the event is dispatched through the tree, from node to node,
       event listeners registered on the node are triggered if the
       following three conditions are all met:
      </p>

      <olist>
       <item>
        <p>
         they were registered for the same type of event, or the same
         category.
        </p>
       </item>

       <item>
        <p>
         they were registered for the same phase;
        </p>
       </item>

       <item>
        <p>
         the event propagation has not been stopped for the group.
        </p>
       </item>
      </olist>
     </div4>

     <div4 id="Events-listeners-removal">
      <head>
       Removing an event listener
      </head>

      <p>
       If an event listener is removed from a node while an event is
       being processed on the node, it will not be triggered by the
       current actions. Once removed, the event listener is never
       invoked again (unless registered again for future processing).
      </p>
     </div4>

     <div4 id="Events-listeners-reentrance">
      <head>
       Reentrance
      </head>

      <p>
       It is expected that actions taken by an event listener may cause
       additional events to be dispatched. Additional events should be
       handled in a synchronous manner and may cause reentrance into the
       event model. If an event listener fires a new event using
       <code>EventTarget.dispatchEvent()</code>, the event propagation
       that causes the event listener to be triggered will resume only
       after the event propagation of the new event is completed.
      </p>

      <p>
       Since implementations may have restrictions such as stack-usage
       or other memory requirements, applications should not depend on
       how many synchronous events may be triggered.
      </p>
     </div4>

     <div4 id="Events-propagation-and-groups">
      <head>
       Event propagation and event groups
      </head>

      <p>
       All event listeners are part of a group (see
       <specref ref="Events-listeners-registration"></specref>). An
       event listener may prevent event listeners that are part of a
       same group from being triggered. The effect can be:
      </p>

      <ulist>
       <item>
        <p>
         immediate: no more event listeners from the same group will be
         triggered by the event object (see
         <code>Event.stopImmediatePropagation()</code>);
        </p>
       </item>

       <item>
        <p>
         deferred until all event listeners from the same group have
         been triggered on the current node, i.e. the event listeners of
         the same group attached on other nodes will not be triggered
         (see <code>Event.stopPropagation()</code>).
        </p>
       </item>
      </ulist>

      <p>
       If two event listeners are registered for two different groups,
       one cannot prevent the other from being triggered.
      </p>
     </div4>
    </div3>
   </div2>

   <div2 id="Events-flow-cancelation">
    <head>
     Default actions and cancelable events
    </head>

    <p>
     Implementations may have a default action associated with an event
     type. An example is the
     <bibref ref="HTML40" role="informative"></bibref> form element.
     When the user submits the form (e.g. by pressing on a submit
     button), the event <termref def="event-submit">submit</termref> is
     dispatched to the element and the default action for this event
     type is generally to send a request to a Web server with the
     parameters from the form.
    </p>

    <p>
     The default actions are not part of the DOM Event flow. Before
     invoking a default action, the implementation must first dispatch
     the event as described in the
     <specref ref="Events-flow"></specref>.
    </p>

    <p>
     <termdef id="dt-cancelable-event" term="cancelable event">
      A <term>cancelable event</term> is an event associated with a
      default action which is allowed to be canceled during the DOM
      event flow.
     </termdef>
     At any phase during the event flow, the triggered event listeners
     have the option of canceling the default action or allowing the
     default action to proceed. In the case of the hyperlink in the
     browser, canceling the action would have the result of not
     activating the hyperlink. Not all events defined in this
     specification are cancelable events. See also
     <specref ref="cancelable_keys"></specref>.
    </p>

    <p>
     Different implementations will specify their own default actions,
     if any, associated with each event. The DOM Events specification
     does not attempt to specify these actions.
    </p>

    <p>
     This specification does not provide mechanisms for accessing
     default actions or adding new ones.
    </p>

    <p>
     Implementations could react to an event before dispatching it and
     do changes on the display and the DOM tree. In such case, if a DOM
     attribute is changed before the event is fired, cancelling the
     device event type will also reverse the change. A good example is
     the attribute <code>HTMLInputElement.checked</code>: as described
     in <bibref role="informative" ref="DOM2HTML"></bibref>, the value
     of this property may be changed before the dispatch of the event;
     the user clicks on the radio button, the radio button is being
     checked (or unchecked) on the display, the attribute
     <code>HTMLInputElement.checked</code> is changed as well, and then
     the device event type <termref def="event-click">click</termref> is
     being dispatched. If the default action of the device event type is
     prevented, or if the default action attached to the
     <termref def="event-DOMActivate">DOMActivate</termref> event type
     is prevented, the property <code>HTMLInputElement.checked</code>
     will need to be changed back to its original value.
    </p>
   </div2>

   <div2 id="Events-flow-activation">
    <head>
     Activation requests and behavior
    </head>

    <p>
     Event targets may have associated <term>activation behavior</term>
     that implementations perform in response to an <term>activation
     request</term>. As an example, the typical activiation behavior
     associated with hyperlinks is to follow the link. Activation
     requests are typically initiated by users through an input device.
    </p>

    <p>
     In terms of this specification, the activation behavior of the
     event target is the default action of the event type
     <termref def="event-DOMActivate">DOMActivate</termref>. DOM
     applications should use this event type whenever they wish to make
     or react to an activation request.
    </p>

    <p>
     Implementations dispatch the <code>DOMActivate</code> event as
     default action of a <termref def="event-click">click</termref>
     event. This click event is either part of the activation request
     (e.g., a user requests activiation using a mouse), or synthesized
     by the implementation to accomodate legacy applications. Context
     information of such a <code>click</code> event is implementation
     dependent.
    </p>

    <p>
     When implementations dispatch a synthesized <code>click</code>
     event, the expectation is that they do so as default action of
     another event type. For example, when a user activates a hyperlink
     using a keyboard, the <code>click</code> event would be dispatched
     as default action of respective keyboard event.
    </p>

    <p>
     Implementations are, however, required to dispatch the synthesized
     <code>click</code> event as described above even if they do not
     dispatch such an event (e.g., when activation is requested by a
     voice command since this specification does not address event types
     for voice input).
    </p>

    <note>
     <p>
      The activation of an event target is device dependent but is also
      application dependent, e.g. a link in a document can be activated
      using a mouse click or a mouse double click.
     </p>
    </note>
   </div2>

   <div2 id="Event-types">
    <head>
     Event types
    </head>

    <p>
     Each event is associated with a type, called <term>event
     type</term>. The event type is composed of a
     <termref def="dt-localname">local name</termref> and a
     <termref def="dt-namespaceURI">namespace URI</termref> as used in
     <bibref ref="DOMCore"></bibref>. All events defined in this
     specification are in no namespace.
    </p>

    <div3 id="Events-EventTypes-category">
     <head>
      Event types and event categories
     </head>

     <p>
      An event type could be part of one or more categories. A category
      is represented using a <termref def="dt-localname">local
      name</termref> and a <termref def="dt-namespaceURI">namespace
      URI</termref> as defined in <bibref ref="Namespaces11"></bibref>.
      The event types defined in this specification are not associated
      with one or more event categories and this specification does not
      provide methods to associate them. Other specifications may create
      and associate event categories with event listeners but in such
      case would need to inform the dispatch mechanism of those event
      categories. An example of the use of categories is given at
      <specref ref="Events-registration-voicexmlevents"></specref>.
     </p>
    </div3>

    <div3 id="Events-EventTypes-complete">
     <head>
      Complete list of event types
     </head>

     <p>
      Depending on the level of DOM support, or the devices used for
      display (e.g. screen) or interaction (e.g., mouse, keyboard, touch
      screen, and voice), these event types can be generated by the
      implementation. When used with an
      <bibref ref="XML" role="informative"></bibref> or
      <bibref ref="HTML40" role="informative"></bibref> application, the
      specifications of those languages may restrict the semantics and
      scope (in particular the possible target nodes) associated with an
      event type. Refer to the specification defining the language used
      in order to find those restrictions or to find event types that
      are not defined in this document.
     </p>

     <p>
      The following table provides a non-normative summary of the event
      types defined in this specification. All event types are in no
      namespace and this specification refers to them by their local
      name only. All events will accomplish the capture and target
      phases, but not all of them will accomplish the bubbling phase
      (see also <specref ref="Events-flow"></specref>). Some events are
      not <termref def="dt-cancelable-event">cancelable</termref> (see
      <specref ref="Events-flow-cancelation"></specref>). Some events
      will only be dispatched to a specific set of possible targets,
      specified using node types. Contextual information related to the
      event type is accessible using DOM interfaces.
     </p>

     <table summary="This table contains the complete list of event types  defined by DOM Level 3 Events. The first column contains the  local name of the event type. The second column indicates if  the event accomplish the bubbling phase or not (all events  accomplish the capture and target phases). The third column  indicates if the default action associated with the event can be  canceled. The fourth column indicates the nodes that can be  target of the event. the fifth (and last) column indicates the  DOM interface implemented by the event object." cellpadding="0" cellspacing="0">
      <tbody>
       <tr>
        <th colspan="1" rowspan="1">
         type
        </th>

        <th colspan="1" rowspan="1">
         Bubbling phase
        </th>

        <th colspan="1" rowspan="1">
         Cancelable
        </th>

        <th colspan="1" rowspan="1">
         Target node types
        </th>

        <th colspan="1" rowspan="1">
         DOM interface
        </th>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMActivate">DOMActivate</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMFocusIn">DOMFocusIn</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMFocusOut">DOMFocusOut</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-focus">focus</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-blur">blur</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-textInput">textInput</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>TextEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-click">click</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-mousedown">mousedown</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-mouseup">mouseup</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-mouseover">mouseover</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-mousemove">mousemove</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-mouseout">mouseout</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MouseEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-keydown">keydown</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>KeyboardEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-keyup">keyup</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>KeyboardEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMSubtreeModified">DOMSubtreeModified</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Document</code>, <code>DocumentFragment</code>,
         <code>Element</code>, <code>Attr</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMNodeInserted">DOMNodeInserted</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>, <code>Attr</code>, <code>Text</code>,
         <code>Comment</code>, <code>CDATASection</code>,
         <code>DocumentType</code>, <code>EntityReference</code>,
         <code>ProcessingInstruction</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMNodeRemoved">DOMNodeRemoved</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>, <code>Attr</code>, <code>Text</code>,
         <code>Comment</code>, <code>CDATASection</code>,
         <code>DocumentType</code>, <code>EntityReference</code>,
         <code>ProcessingInstruction</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMNodeRemovedFromDocument">DOMNodeRemovedFromDocument</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>, <code>Attr</code>, <code>Text</code>,
         <code>Comment</code>, <code>CDATASection</code>,
         <code>DocumentType</code>, <code>EntityReference</code>,
         <code>ProcessingInstruction</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMNodeInsertedIntoDocument">DOMNodeInsertedIntoDocument</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>, <code>Attr</code>, <code>Text</code>,
         <code>Comment</code>, <code>CDATASection</code>,
         <code>DocumentType</code>, <code>EntityReference</code>,
         <code>ProcessingInstruction</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMAttrModified">DOMAttrModified</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMCharacterDataModified">DOMCharacterDataModified</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Text</code>, <code>Comment</code>,
         <code>CDATASection</code>, <code>ProcessingInstruction</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMElementNameChanged">DOMElementNameChanged</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationNameEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-DOMAttributeNameChanged">DOMAttributeNameChanged</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>MutationNameEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-load">load</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Document</code>, <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-unload">unload</termref>
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Document</code>, <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-abort">abort</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-error">error</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-select">select</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-change">change</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-submit">submit</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-reset">reset</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>Event</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-resize">resize</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Document</code>, <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>

       <tr>
        <td colspan="1" rowspan="1">
         <termref def="event-scroll">scroll</termref>
        </td>

        <td colspan="1" rowspan="1">
         Yes
        </td>

        <td colspan="1" rowspan="1">
         No
        </td>

        <td colspan="1" rowspan="1">
         <code>Document</code>, <code>Element</code>
        </td>

        <td colspan="1" rowspan="1">
         <code>UIEvent</code>
        </td>
       </tr>
      </tbody>
     </table>

     <p>
      As an example, the event <termref def="event-load">load</termref>
      will trigger event listeners attached on <code>Element</code>
      nodes for that event and on the capture and target phases. This
      event cannot be cancelled. If an event listener for the
      <termref def="event-load">load</termref> event is attached to a
      node other than <code>Document</code> or <code>Element</code>
      nodes, or if it is attached to the bubbling phase only, this event
      listener cannot be triggered.
     </p>

     <p>
      The event objects associated with the event types described above
      may contain context information. Refer to the description of the
      DOM interfaces for further information.
     </p>
    </div3>

    <div3 id="Events-dom2-compatibility">
     <head>
      Compatibility with DOM Level 2 Events
     </head>

     <p>
      <termref def="dt-namespaceURI">Namespace URIs</termref> were only
      introduced in DOM Level 3 Events and were not part of DOM Level 2
      Events. All event types in this specification are defined to be in
      no namespace, DOM Level 2 methods have been modified to refer to
      event types in no namespace when adding or removing event
      listeners and initializing event objects, and new methods have
      been added to provide equivalent functionality for event types in
      a namespace. A future draft of this document will provide
      guidelines on defining new event types.
     </p>

     <p>
      DOM Level 3 Events considers the <code>Event.type</code> attribute
      to be case-sensitive, while DOM Level 2 Events considers
      <code>Event.type</code> to be case-insensitive.
     </p>
    </div3>
   </div2>

   <div2 id="Events-registration">
    <head>
     Event listener registration
    </head>

    <note>
     <p>
      This section is non-normative.
     </p>
    </note>

    <p>
     There are mainly two ways to associate an event listener to a node
     in the tree:
    </p>

    <olist>
     <item>
      <p>
       at the programming level using the <code>EventTarget</code>
       methods.
      </p>
     </item>

     <item>
      <p>
       at the document level using
       <bibref role="informative" ref="XMLEvents"></bibref> or an ad-hoc
       syntax, as the ones provided in
       <bibref role="informative" ref="XHTML10"></bibref> or
       <bibref role="informative" ref="SVG1"></bibref>.
      </p>
     </item>
    </olist>

    <div3 id="Events-Registration-interfaces">
     <head>
      Using the <code>EventTarget</code> methods
     </head>

     <p>
      The user can attach an event listener using the methods on the
      <code>EventTarget</code> interface:
     </p>
<eg xml:space="preserve">aCircle.addEventListener("DOMActivate", aListener, false);</eg>
     <p>
      The methods do not provide the ability to register the same event
      listener more than once for the same event type and the same
      phase. It is not possible to register an event listener:
     </p>

     <ulist>
      <item>
       <p>
        for only one of the
        <termref def="dt-target-phase">target</termref> and
        <termref def="dt-bubbling-phase">bubbling</termref> phases since
        those phases are coupled during the registration (but the
        listener itself could ignore events during one of these phases
        if desired).
       </p>
      </item>

      <item>
       <p>
        for a specific event category.
       </p>
      </item>
     </ulist>

     <p>
      To register an event listener, DOM applications use the methods
      <code>EventTarget.addEventListener()</code> and
      <code>EventTarget.addEventListenerNS()</code>.
     </p>

     <p>
      An <code>EventListener</code> being registered on an
      <code>EventTarget</code> may choose to have that
      <code>EventListener</code> triggered during the capture phase by
      specifying the <code>useCapture</code> parameter of the
      <code>EventTarget.addEventListener()</code> or
      <code>EventTarget.addEventListenerNS()</code> methods to be
      <code>true</code>. If <code>false</code>, the
      <code>EventListener</code> will be triggered during the target and
      bubbling phases.
     </p>
    </div3>

    <div3 id="Events-registration-xmlevents">
     <head>
      Using XML Events
     </head>

     <p>
      In <bibref role="informative" ref="XMLEvents"></bibref>, event
      listeners are attached using elements and attributes:
     </p>
<eg xml:space="preserve">&lt;listener event="DOMActivate" observer="aCircle" handler="#aListener"
          phase="default" propagate="stop"/&gt;</eg>
     <p>
      Event listeners can only be registered on <code>Element</code>
      nodes, other <code>Node</code> types are not addressable, and
      cannot be registered for a specific group either, they are always
      attached to the default group. The
      <termref def="dt-target-phase">target phase</termref> and the
      <termref def="dt-bubbling-phase">bubbling phase</termref> are
      coupled during the registration.
      <bibref role="informative" ref="XMLEvents"></bibref> does not
      address namespaces in event types.
     </p>
    </div3>

    <div3 id="Events-registration-voicexmlevents">
     <head>
      Using VoiceXML Events
     </head>

     <p>
      In <bibref role="informative" ref="VoiceXML20"></bibref>, event
      listeners are attached using elements:
     </p>
<eg xml:space="preserve">&lt;form&gt;
  &lt;field&gt;
    &lt;prompt&gt;Please say something&lt;/prompt&gt;
    &lt;catch event="error.noauthorization"&gt;
     &lt;prompt&gt;You don't have the authorization!&lt;/prompt&gt;
    &lt;/catch&gt;
    &lt;catch event="connection.disconnect.hangup"&gt;
     &lt;prompt&gt;Connection error&lt;/prompt&gt;
    &lt;/catch&gt;
    &lt;catch event="connection.disconnect"&gt;
     &lt;prompt&gt;Connection error&lt;/prompt&gt;
    &lt;/catch&gt;
  &lt;/field&gt;
  &lt;catch event="error"&gt;
    &lt;prompt&gt;Unknown error&lt;/prompt&gt;
  &lt;/catch&gt;
&lt;/form&gt;</eg>
     <p>
      Event listeners can only be registered on <code>Element</code>
      nodes, other <code>Node</code> types are not addressable, and
      cannot be registered for a specific group either, they are always
      attached to the default group. The
      <termref def="dt-target-phase">target phase</termref> and the
      <termref def="dt-bubbling-phase">bubbling phase</termref> are
      coupled during the registration.
      <bibref role="informative" ref="VoiceXML20"></bibref> does not
      address namespaces in event types but uses the notion of event
      categories. The event type
      <code>"connection.disconnect.hangup"</code> could be associated to
      the event categories
      <code>{"http://www.example.org/2003/voicexml",
      "connection"}</code> and
      <code>{"http://www.example.org/2003/voicexml",
      "connection.disconnect"}</code>.
     </p>
    </div3>

    <div3 id="Events-registration-html40">
     <head>
      Using XML or HTML attributes
     </head>

     <p>
      In languages such as
      <bibref role="informative" ref="HTML40"></bibref>,
      <bibref role="informative" ref="XHTML10"></bibref>, or
      <bibref role="informative" ref="SVG1"></bibref>, event listeners
      are specified as attributes:
     </p>
<eg xml:space="preserve">&lt;circle id="aCircle" onactivate="aListener(evt)"
        cx="300" cy="225" r="100" fill="red"/&gt;</eg>
     <p>
      Since only one attribute with the same name can appear on an
      element, it is not possible to register more than one event
      listener on a single <code>EventTarget</code> for the event type.
      Also, event listeners can only be registered on
      <code>Element</code> nodes for the
      <termref def="dt-target-phase">target phase</termref> and
      <termref def="dt-bubbling-phase">bubbling phase</termref>, other
      <code>Node</code> types and the
      <termref def="dt-capture-phase">capture phase</termref> are not
      addressable with these languages. Event listeners cannot be
      registered for a specific group either, they are always attached
      to the default group.
     </p>
    </div3>
   </div2>

   <div2 id="Events-interface">
    <head>
     Basic interfaces
    </head>

    <p>
     The interfaces described in this section are fundamental to DOM
     Level 3 Events and must always be supported by the implementation.
    </p>

    <definitions>
     <interface name="Event" id="Events-Event" since="DOM Level 2">
      <descr>
       <p>
        The <code>Event</code> interface is used to provide contextual
        information about an event to the listener processing the event.
        An object which implements the <code>Event</code> interface is
        passed as the parameter to an <code>EventListener</code>. More
        specific context information is passed to event listeners by
        deriving additional interfaces from <code>Event</code> which
        contain information directly relating to the type of event they
        represent. These derived interfaces are also implemented by the
        object passed to the event listener.
       </p>

       <p>
        To create an instance of the <code>Event</code> interface, use
        the <code>DocumentEvent.createEvent("Event")</code> method call.
       </p>
      </descr>

      <group id="Events-Event-eventPhaseType" name="PhaseType">
       <descr>
        <p>
         An integer indicating which phase of the event flow is being
         processed as defined in <specref ref="Events-flow"></specref>.
        </p>
       </descr>

       <constant name="CAPTURING_PHASE" id="CAPTURING_PHASE" type="unsigned short" value="1">
        <descr>
         <p>
          The current event phase is the
          <termref def="dt-capture-phase">capture phase</termref>.
         </p>
        </descr>
       </constant>

       <constant name="AT_TARGET" id="AT_TARGET" type="unsigned short" value="2">
        <descr>
         <p>
          The current event is in the
          <termref def="dt-capture-phase">target phase</termref>, i.e.
          it is being evaluated at the
          <termref def="dt-event-target">event target</termref>.
         </p>
        </descr>
       </constant>

       <constant name="BUBBLING_PHASE" id="BUBBLING_PHASE" type="unsigned short" value="3">
        <descr>
         <p>
          The current event phase is the
          <termref def="dt-bubbling-phase">bubbling phase</termref>.
         </p>
        </descr>
       </constant>
      </group>

      <attribute type="DOMString" name="type" readonly="yes" id="Events-Event-type">
       <descr>
        <p>
         The <termref def="dt-localname">local name</termref> of the
         event type. The name must be an
         <loc href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-NCName" xlink:actuate="onRequest" xlink:show="replace" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">NCName</loc>
         as defined in <bibref ref="Namespaces11"></bibref> and is
         case-sensitive.
        </p>
       </descr>
      </attribute>

      <attribute type="EventTarget" name="target" readonly="yes" id="Events-Event-target">
       <descr>
        <p>
         Used to indicate the <termref def="dt-event-target">event
         target</termref>. This attribute contains the
         <termref def="dt-target-node">target node</termref> when used
         with the <specref ref="Events-flow"></specref>.
        </p>
       </descr>
      </attribute>

      <attribute type="EventTarget" name="currentTarget" readonly="yes" id="Events-Event-currentTarget">
       <descr>
        <p>
         Used to indicate the <code>EventTarget</code> whose
         <code>EventListeners</code> are currently being processed. This
         is particularly useful during the capture and bubbling phases.
         This attribute could contain the
         <termref def="dt-target-node">target node</termref> or a target
         ancestor when used with the
         <specref ref="Events-flow"></specref>.
        </p>
       </descr>
      </attribute>

      <attribute type="unsigned short" name="eventPhase" readonly="yes" id="Events-Event-eventPhase">
       <descr>
        <p>
         Used to indicate which phase of event flow is currently being
         accomplished.
        </p>
       </descr>
      </attribute>

      <attribute type="boolean" name="bubbles" readonly="yes" id="Events-Event-canBubble">
       <descr>
        <p>
         Used to indicate whether or not an event is a bubbling event.
         If the event can bubble the value is <code>true</code>,
         otherwise the value is <code>false</code>.
        </p>
       </descr>
      </attribute>

      <attribute type="boolean" name="cancelable" readonly="yes" id="Events-Event-canCancel">
       <descr>
        <p>
         Used to indicate whether or not an event can have its default
         action prevented (see also
         <specref ref="Events-flow-cancelation"></specref>). If the
         default action can be prevented the value is <code>true</code>,
         otherwise the value is <code>false</code>.
        </p>
       </descr>
      </attribute>

      <attribute type="DOMTimeStamp" name="timeStamp" readonly="yes" id="Events-Event-timeStamp">
       <descr>
        <p>
         Used to specify the time at which the event was created in
         milliseconds relative to 1970-01-01T00:00:00Z. Due to the fact
         that some systems may not provide this information the value of
         <code>timeStamp</code> may be not available for all events.
         When not available, the value is <code>0</code>.
        </p>
       </descr>
      </attribute>

      <method name="stopPropagation" id="Events-Event-stopPropagation">
       <descr>
        <p>
         This method is used to prevent event listeners of the same
         group to be triggered but its effect is deferred until all
         event listeners attached on the
         <code>Event.currentTarget</code> have been triggered (see
         <specref ref="Events-propagation-and-groups"></specref>). Once
         it has been called, further calls to that method have no
         additional effect.
        </p>

        <note>
         <p>
          This method does not prevent the default action from being
          invoked; use <code>Event.preventDefault()</code> for that
          effect.
         </p>
        </note>
       </descr>

       <parameters></parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <method name="preventDefault" id="Events-Event-preventDefault">
       <descr>
        <p>
         If an event is cancelable, the <code>preventDefault</code>
         method is used to signify that the event is to be canceled,
         meaning any default action normally taken by the implementation
         as a result of the event will not occur (see also
         <specref ref="Events-flow-cancelation"></specref>), and thus
         independently of event groups. Calling this method for a
         non-cancelable event has no effect.
        </p>

        <note>
         <p>
          This method does not stop the event propagation; use
          <code>Event.stopPropagation()</code> or
          <code>Event.stopImmediatePropagation()</code> for that effect.
         </p>
        </note>
       </descr>

       <parameters></parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <method name="initEvent" id="Events-Event-initEvent">
       <descr>
        <p>
         The <code>initEvent</code> method is used to initialize the
         value of an <code>Event</code> created through the
         <code>DocumentEvent.createEvent</code> method. This method may
         only be called before the <code>Event</code> has been
         dispatched via the <code>EventTarget.dispatchEvent()</code>
         method. If the method is called several times before invoking
         <code>EventTarget.dispatchEvent</code>, only the final
         invocation takes precedence. This method has no effect if
         called after the event has been dispatched. If called from a
         subclass of the <code>Event</code> interface only the values
         specified in this method are modified, all other attributes are
         left unchanged.
        </p>

        <p>
         This method sets the <code>Event.type</code> attribute to
         <code>eventTypeArg</code>, and <code>Event.namespaceURI</code>
         to <code>null</code>. To initialize an event with a namespace
         URI, use the <code>Event.initEventNS()</code> method.
        </p>
       </descr>

       <parameters>
        <param name="eventTypeArg" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies <code>Event.type</code>, the
           <termref def="dt-localname">local name</termref> of the event
           type.
          </p>
         </descr>
        </param>

        <param name="canBubbleArg" type="boolean" attr="in">
         <descr>
          <p>
           Specifies <code>Event.bubbles</code>. This parameter
           overrides the intrinsic bubbling behavior of the event.
          </p>
         </descr>
        </param>

        <param name="cancelableArg" type="boolean" attr="in">
         <descr>
          <p>
           Specifies <code>Event.cancelable</code>. This parameter
           overrides the intrinsic cancelable behavior of the event.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <attribute readonly="yes" type="DOMString" name="namespaceURI" id="Events-Event-namespaceURI" since="DOM Level 3">
       <descr>
        <p>
         The <termref def="dt-namespaceURI">namespace URI</termref>
         associated with this event at creation time, or
         <code>null</code> if it is unspecified.
        </p>

        <p>
         For events initialized with a DOM Level 2 Events method, such
         as <code>Event.initEvent()</code>, this is always
         <code>null</code>.
        </p>
       </descr>
      </attribute>

      <method name="stopImmediatePropagation" id="Events-Event-stopImmediatePropagation" since="DOM Level 3">
       <descr>
        <p>
         This method is used to prevent event listeners of the same
         group to be triggered and, unlike
         <code>Event.stopPropagation()</code> its effect is immediate
         (see <specref ref="Events-propagation-and-groups"></specref>).
         Once it has been called, further calls to that method have no
         additional effect.
        </p>

        <note>
         <p>
          This method does not prevent the default action from being
          invoked; use <code>Event.preventDefault()</code> for that
          effect.
         </p>
        </note>
       </descr>

       <parameters></parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <attribute type="boolean" name="defaultPrevented" id="Events-Event-defaultPrevented" readonly="yes" since="DOM Level 3">
       <descr>
        <p>
         Used to indicate whether <code>Event.preventDefault()</code>
         has been called for this event.
        </p>
       </descr>
      </attribute>

      <method name="initEventNS" id="Events-Event-initEventNS" since="DOM Level 3">
       <descr>
        <p>
         The <code>initEventNS</code> method is used to initialize the
         value of an <code>Event</code> object and has the same behavior
         as <code>Event.initEvent()</code>.
        </p>
       </descr>

       <parameters>
        <param name="namespaceURIArg" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies <code>Event.namespaceURI</code>, the
           <termref def="dt-namespaceURI">namespace URI</termref>
           associated with this event, or <code>null</code> if no
           namespace.
          </p>
         </descr>
        </param>

        <param name="eventTypeArg" type="DOMString" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEvent()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="canBubbleArg" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEvent()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="cancelableArg" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEvent()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>
     </interface>

     <interface name="CustomEvent" inherits="Event" id="Events-CustomEvent" since="DOM Level 3">
      <descr>
       <p>
        The CustomEvent interface is the recommended interface for
        application-specific event types. Unlike the <code>Event</code>
        interface, it allows applications to provide contextual
        information about the event type. Application-specific event
        types should have an associated namespace to avoid clashes with
        future general-purpose event types.
       </p>

       <p>
        To create an instance of the <code>CustomEvent</code> interface,
        use the <code>DocumentEvent.createEvent("CustomEvent")</code>
        method call.
       </p>
      </descr>

      <attribute id="Events-CustomEvent-detail" name="detail" type="DOMObject" readonly="yes">
       <descr>
        <p>
         Specifies some detail information about the <code>Event</code>.
        </p>
       </descr>
      </attribute>

      <method name="initCustomEventNS" id="Events-Event-initCustomEventNS">
       <descr>
        <p>
         The <code>initCustomEventNS</code> method is used to initialize
         the value of a <code>CustomEvent</code> object and has the same
         behavior as <code>Event.initEventNS()</code>.
        </p>
       </descr>

       <parameters>
        <param name="namespaceURI" type="DOMString" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEventNS()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="typeArg" type="DOMString" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEventNS()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="canBubbleArg" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEventNS()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="cancelableArg" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>Event.initEventNS()</code> method for a
           description of this parameter.
          </p>
         </descr>
        </param>

        <param name="detailArg" type="DOMObject" attr="in">
         <descr>
          <p>
           Specifies <code>CustomEvent.detail</code>. This value may be
           <code>null</code>.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>
     </interface>

     <interface name="EventTarget" id="Events-EventTarget" since="DOM Level 2">
      <descr>
       <p>
        The <code>EventTarget</code> interface is implemented by all the
        objects which could be <termref def="dt-event-target">event
        targets</termref> in an implementation which supports the
        <specref ref="Events-flows"></specref>. The interface allows
        registration and removal of event listeners, and dispatch of
        events to an event target.
       </p>

       <p>
        When used with <specref ref="Events-flow"></specref>, this
        interface is implemented by all
        <termref def="dt-target-node">target nodes</termref> and target
        ancestors, i.e. all DOM <code>Nodes</code> of the tree support
        this interface when the implementation conforms to DOM Level 3
        Events and, therefore, this interface can be obtained by using
        binding-specific casting methods on an instance of the
        <code>Node</code> interface.
       </p>

       <p>
        Invoking <code>addEventListener</code> or
        <code>addEventListenerNS</code> repeatedly on the same
        <code>EventTarget</code> with the same values for the parameters
        <code>namespaceURI</code>, <code>type</code>,
        <code>listener</code>, and <code>useCapture</code> has no
        effect. Doing so does not cause the <code>EventListener</code>
        to be called more than once and does not cause a change in the
        triggering order. In order to register a listener for a
        different event group (<specref ref="Event-groups"></specref>)
        the previously registered listener has to be removed first.
       </p>
      </descr>

      <method name="addEventListener" id="Events-EventTarget-addEventListener">
       <descr>
        <p>
         This method allows the registration of an event listener in the
         default group and, depending on the <code>useCapture</code>
         parameter, on the capture phase of the DOM event flow or its
         target and bubbling phases. Invoking this method is equivalent
         to invoking <code>addEventListenerNS</code> with the same
         values for the parameters <code>type</code>,
         <code>listener</code>, and <code>useCapture</code>, and the
         value <code>null</code> for the parameters
         <code>namespaceURI</code> and <code>evtGroup</code>.
        </p>
       </descr>

       <parameters>
        <param name="type" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies the <code>Event.type</code> associated with the
           event for which the user is registering.
          </p>
         </descr>
        </param>

        <param name="listener" type="EventListener" attr="in">
         <descr>
          <p>
           The <code>listener</code> parameter takes an object
           implemented by the user which implements the
           <code>EventListener</code> interface and contains the method
           to be called when the event occurs.
          </p>
         </descr>
        </param>

        <param name="useCapture" type="boolean" attr="in">
         <descr>
          <p>
           If true, <code>useCapture</code> indicates that the user
           wishes to add the event listener for the
           <termref def="dt-capture-phase">capture phase</termref> only,
           i.e. this event listener will not be triggered during the
           <termref def="dt-target-phase">target</termref> and
           <termref def="dt-bubbling-phase">bubbling</termref> phases.
           If <code>false</code>, the event listener will only be
           triggered during the target and bubbling phases.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <method name="removeEventListener" id="Events-EventTarget-removeEventListener">
       <descr>
        <p>
         This method allows the removal of event listeners from the
         default group. Calling <code>removeEventListener</code> with
         arguments which do not identify any currently registered
         <code>EventListener</code> on the <code>EventTarget</code> has
         no effect. The <code>Event.namespaceURI</code> for which the
         user registered the event listener is implied and is
         <code>null</code>.
        </p>

        <note>
         <p>
          Event listeners registered for other event groups than the
          default group cannot be removed using this method; see
          <code>EventTarget.removeEventListenerNS()</code> for that
          effect.
         </p>
        </note>
       </descr>

       <parameters>
        <param name="type" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies the <code>Event.type</code> for which the user
           registered the event listener.
          </p>
         </descr>
        </param>

        <param name="listener" type="EventListener" attr="in">
         <descr>
          <p>
           The <code>EventListener</code> to be removed.
          </p>
         </descr>
        </param>

        <param name="useCapture" type="boolean" attr="in">
         <descr>
          <p>
           Specifies whether the <code>EventListener</code> being
           removed was registered for the capture phase or not. If a
           listener was registered twice, once for the capture phase and
           once for the target and bubbling phases, each must be removed
           separately. Removal of an event listener registered for the
           capture phase does not affect the same event listener
           registered for the target and bubbling phases, and vice
           versa.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>

      <method name="dispatchEvent" id="Events-EventTarget-dispatchEvent" version="DOM Level 3">
       <descr>
        <p>
         This method allows the dispatch of events into the
         implementation's event model. The
         <termref def="dt-event-target">event target</termref> of the
         event is the <code>EventTarget</code> object on which
         <code>dispatchEvent</code> is called.
        </p>
       </descr>

       <parameters>
        <param name="evt" type="Event" attr="in">
         <descr>
          <p>
           The event to be dispatched.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="boolean">
        <descr>
         <p>
          Indicates whether any of the listeners which handled the event
          called <code>Event.preventDefault()</code>. If
          <code>Event.preventDefault()</code> was called the returned
          value is <code>false</code>, else it is <code>true</code>.
         </p>
        </descr>
       </returns>

       <raises>
        <exception name="EventException">
         <descr>
          <p>
           UNSPECIFIED_EVENT_TYPE_ERR: Raised if the
           <code>Event.type</code> was not specified by initializing the
           event before <code>dispatchEvent</code> was called.
           Specification of the <code>Event.type</code> as
           <code>null</code> or an empty string will also trigger this
           exception.
          </p>

          <p>
           DISPATCH_REQUEST_ERR: Raised if the <code>Event</code> object
           is already being dispatched.
          </p>
         </descr>
        </exception>

        <exception name="DOMException">
         <descr>
          <p>
           NOT_SUPPORTED_ERR: Raised if the <code>Event</code> object
           has not been created using
           <code>DocumentEvent.createEvent()</code>.
          </p>

          <p>
           INVALID_CHARACTER_ERR: Raised if <code>Event.type</code> is
           not an
           <xspecref href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-NCName" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">NCName</xspecref>
           as defined in <bibref ref="Namespaces11"></bibref>.
          </p>
         </descr>
        </exception>
       </raises>
      </method>

      <method name="addEventListenerNS" id="Events-EventTargetGroup-addEventListenerNS" since="DOM Level 3">
       <descr>
        <p>
         This method allows the registration of an event listener in a
         specified group or the default group and, depending on the
         <code>useCapture</code> parameter, on the capture phase of the
         DOM event flow or its target and bubbling phases.
        </p>
       </descr>

       <parameters>
        <param name="namespaceURI" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies the <code>Event.namespaceURI</code> associated with
           the event for which the user is registering.
          </p>
         </descr>
        </param>

        <param name="type" type="DOMString" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.addEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>

        <param name="listener" type="EventListener" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.addEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>

        <param name="useCapture" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.addEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>

        <param name="evtGroup" type="DOMObject" attr="in">
         <descr>
          <p>
           The object that represents the event group to associate with
           the <code>EventListener</code> (see also
           <specref ref="Events-propagation-and-groups"></specref>). Use
           <code>null</code> to attach the event listener to the default
           group.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr></descr>
       </returns>

       <raises></raises>
      </method>

      <method name="removeEventListenerNS" id="Events-EventTargetGroup-removeEventListenerNS" since="DOM Level 3">
       <descr>
        <p>
         This method allows the removal of an event listener,
         independently of the associated event group. Calling
         <code>removeEventListenerNS</code> with arguments which do not
         identify any currently registered <code>EventListener</code> on
         the <code>EventTarget</code> has no effect.
        </p>
       </descr>

       <parameters>
        <param name="namespaceURI" type="DOMString" attr="in">
         <descr>
          <p>
           Specifies the <code>Event.namespaceURI</code> associated with
           the event for which the user registered the event listener.
          </p>
         </descr>
        </param>

        <param name="type" type="DOMString" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.removeEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>

        <param name="listener" type="EventListener" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.removeEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>

        <param name="useCapture" type="boolean" attr="in">
         <descr>
          <p>
           Refer to the <code>EventTarget.removeEventListener()</code>
           method for a description of this parameter.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>
     </interface>

     <interface id="Events-EventListener" name="EventListener" since="DOM Level 2" role="ecmascript-function">
      <descr>
       <p>
        The <code>EventListener</code> interface is the primary way for
        handling events. Users implement the <code>EventListener</code>
        interface and register their event listener on an
        <code>EventTarget</code>. The users should also remove their
        <code>EventListener</code> from its <code>EventTarget</code>
        after they have completed using the listener.
       </p>

       <p>
        Copying a <code>Node</code>, with methods such as
        <code>Node.cloneNode</code> or <code>Range.cloneContents</code>,
        does not copy the event listeners attached to it. Event
        listeners must be attached to the newly created
        <code>Node</code> afterwards if so desired.
       </p>

       <p>
        Moving a <code>Node</code>, with methods
        <code>Document.adoptNode</code>, <code>Node.appendChild</code>,
        or <code>Range.extractContents</code>, does not affect the event
        listeners attached to it.
       </p>
      </descr>

      <method name="handleEvent" id="Events-EventListener-handleEvent">
       <descr>
        <p>
         This method is called whenever an event occurs of the event
         type for which the <code>EventListener</code> interface was
         registered.
        </p>
       </descr>

       <parameters>
        <param name="evt" type="Event" attr="in">
         <descr>
          <p>
           The <code>Event</code> contains contextual information about
           the <termref def="dt-event">event</termref>.
          </p>
         </descr>
        </param>
       </parameters>

       <returns type="void">
        <descr>
         <p></p>
        </descr>
       </returns>

       <raises></raises>
      </method>
     </interface>

     <exception id="Events-EventException" name="EventException" since="DOM Level 2">
      <descr>
       <p>
        Event operations may throw an <code>EventException</code> as
        specified in their method descriptions.
       </p>
      </descr>

      <component id="Events-EventException-code" name="code">
       <typename>unsigned short</typename>
      </component>
     </exception>

     <group id="Events-EventException-EventExceptionCode" name="EventExceptionCode" since="DOM Level 2">
      <descr>
       <p>
        An integer indicating the type of error generated.
       </p>
      </descr>

      <constant name="UNSPECIFIED_EVENT_TYPE_ERR" id="UNSPECIFIED_EVENT_TYPE_ERR" type="unsigned short" value="0">
       <descr>
        <p>
         If the <code>Event.type</code> was not specified by
         initializing the event before the method was called.
         Specification of the <code>Event.type</code> as
         <code>null</code> or an empty string will also trigger this
         exception.
        </p>
       </descr>
      </constant>

      <constant name="DISPATCH_REQUEST_ERR" id="DISPATCH_REQUEST_ERR" type="unsigned short" value="1" since="DOM Level 3">
       <descr>
        <p>
         If the <code>Event</code> object is already dispatched in the
         tree.
        </p>
       </descr>
      </constant>
     </group>
    </definitions>

    <div3 id="Events-document">
     <head>
      Event creation
     </head>

     <p>
      In most cases, the events dispatched by the DOM Events
      implementation are also created by the implementation. It is
      however possible to simulate events such as mouse events by
      creating the <code>Event</code> objects and dispatch them using
      the DOM Events implementation.
     </p>

     <p>
      Creating <code>Event</code> objects that are known to the DOM
      Events implementation is done using
      <code>DocumentEvent.createEvent()</code>. The application must
      then initialize the object by calling the appropriate
      initialization method before invoking
      <code>EventTarget.dispatchEvent()</code>. The <code>Event</code>
      objects created must be known by the DOM Events implementation;
      otherwise an event exception is thrown.
     </p>

     <definitions>
      <interface name="DocumentEvent" id="Events-DocumentEvent" since="DOM Level 2">
       <descr>
        <p>
         The <code>DocumentEvent</code> interface provides a mechanism
         by which the user can create an <code>Event</code> object of a
         type supported by the implementation. If the feature "Events"
         is supported by the <code>Document</code> object, the
         <code>DocumentEvent</code> interface must be implemented on the
         same object. If the feature "+Events" is supported by the
         <code>Document</code> object, an object that supports the
         <code>DocumentEvent</code> interface must be returned by
         invoking the method <code>Node.getFeature("+Events",
         "3.0")</code> on the <code>Document</code> object.
        </p>
       </descr>

       <method name="createEvent" id="Events-DocumentEvent-createEvent">
        <descr>
         <p></p>
        </descr>

        <parameters>
         <param name="eventType" type="DOMString" attr="in">
          <descr>
           <p>
            The <code>eventType</code> parameter specifies the name of
            the DOM Events interface to be supported by the created
            event object, e.g. <code>"Event"</code>,
            <code>"MouseEvent"</code>, <code>"MutationEvent"</code> and
            so on. If the <code>Event</code> is to be dispatched via the
            <code>EventTarget.dispatchEvent()</code> method the
            appropriate event init method must be called after creation
            in order to initialize the <code>Event</code>'s values.
           </p>

           <p>
            As an example, a user wishing to synthesize some kind of
            <code>UIEvent</code> would invoke
            <code>DocumentEvent.createEvent("UIEvent")</code>. The
            <code>UIEvent.initUIEventNS()</code> method could then be
            called on the newly created <code>UIEvent</code> object to
            set the specific type of user interface event to be
            dispatched,
            <termref def="event-DOMActivate">DOMActivate</termref> for
            example, and set its context information, e.g.
            <code>UIEvent.detail</code> in this example.
           </p>

           <note>
            <p>
             For backward compatibility reason, "UIEvents",
             "MouseEvents", "MutationEvents", and "HTMLEvents" feature
             names are valid values for the parameter
             <code>eventType</code> and represent respectively the
             interfaces "UIEvent", "MouseEvent", "MutationEvent", and
             "Event".
            </p>
           </note>
          </descr>
         </param>
        </parameters>

        <returns type="Event">
         <descr>
          <p>
           The newly created event object.
          </p>
         </descr>
        </returns>

        <raises>
         <exception name="DOMException">
          <descr>
           <p>
            NOT_SUPPORTED_ERR: Raised if the implementation does not
            support the <code>Event</code> interface requested.
           </p>
          </descr>
         </exception>
        </raises>
       </method>

       <method name="canDispatch" id="Events-DocumentEvent-canDispatch" since="DOM Level 3">
        <descr>
         <p>
          Test if the implementation can generate events of a specified
          type.
         </p>
        </descr>

        <parameters>
         <param name="namespaceURI" type="DOMString" attr="in">
          <descr>
           <p>
            Specifies the <code>Event.namespaceURI</code> of the event.
           </p>
          </descr>
         </param>

         <param name="type" type="DOMString" attr="in">
          <descr>
           <p>
            Specifies the <code>Event.type</code> of the event.
           </p>
          </descr>
         </param>
        </parameters>

        <returns type="boolean">
         <descr>
          <p>
           <code>true</code> if the implementation can generate and
           dispatch this event type, <code>false</code> otherwise.
          </p>
         </descr>
        </returns>

        <raises></raises>
       </method>
      </interface>
     </definitions>
    </div3>
   </div2>

   <div2 id="Events-eventgroupings">
    <head>
     Event module definitions
    </head>

    <p>
     The DOM Event Model allows a DOM implementation to support multiple
     modules of events. The model has been designed to allow addition of
     new event modules if required. The DOM will not attempt to define
     all possible events. For purposes of interoperability, the DOM
     defines a module of user interface events including lower level
     device dependent events and a module of document mutation events.
    </p>

    <div3 id="Events-eventgroupings-uievents">
     <head>
      User Interface event types
     </head>

     <p>
      The User Interface event module contains basic event types
      associated with user interfaces.
     </p>

     <definitions>
      <interface name="UIEvent" inherits="Event" id="Events-UIEvent" since="DOM Level 2">
       <descr>
        <p>
         The <code>UIEvent</code> interface provides specific contextual
         information associated with User Interface events.
        </p>

        <p>
         To create an instance of the <code>UIEvent</code> interface,
         use the <code>DocumentEvent.createEvent("UIEvent")</code>
         method call.
        </p>
       </descr>

       <attribute type="views::AbstractView" name="view" readonly="yes" id="Events-UIEvent-view">
        <descr>
         <p>
          The <code>view</code> attribute identifies the
          <code>AbstractView</code> from which the event was generated.
         </p>
        </descr>
       </attribute>

       <attribute id="Events-UIEvent-detail" name="detail" type="long" readonly="yes">
        <descr>
         <p>
          Specifies some detail information about the
          <code>Event</code>, depending on the type of event.
         </p>
        </descr>
       </attribute>

       <method name="initUIEvent" id="Events-Event-initUIEvent">
        <descr>
         <p>
          The <code>initUIEvent</code> method is used to initialize the
          value of a <code>UIEvent</code> object and has the same
          behavior as <code>Event.initEvent()</code>.
         </p>
        </descr>

        <parameters>
         <param name="typeArg" type="DOMString" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEvent()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="canBubbleArg" type="boolean" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEvent()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="cancelableArg" type="boolean" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEvent()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="viewArg" type="views::AbstractView" attr="in">
          <descr>
           <p>
            Specifies <code>UIEvent.view</code>. This value may be
            <code>null</code>.
           </p>
          </descr>
         </param>

         <param name="detailArg" type="long" attr="in">
          <descr>
           <p>
            Specifies <code>UIEvent.detail</code>.
           </p>
          </descr>
         </param>
        </parameters>

        <returns type="void">
         <descr>
          <p></p>
         </descr>
        </returns>

        <raises></raises>
       </method>

       <method name="initUIEventNS" id="Events-Event-initUIEventNS" since="DOM Level 3">
        <descr>
         <p>
          The <code>initUIEventNS</code> method is used to initialize
          the value of a <code>UIEvent</code> object and has the same
          behavior as <code>Event.initEventNS()</code>.
         </p>
        </descr>

        <parameters>
         <param name="namespaceURI" type="DOMString" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEventNS()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="typeArg" type="DOMString" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEventNS()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="canBubbleArg" type="boolean" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEventNS()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="cancelableArg" type="boolean" attr="in">
          <descr>
           <p>
            Refer to the <code>Event.initEventNS()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="viewArg" type="views::AbstractView" attr="in">
          <descr>
           <p>
            Refer to the <code>UIEvent.initUIEvent()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>

         <param name="detailArg" type="long" attr="in">
          <descr>
           <p>
            Refer to the <code>UIEvent.initUIEvent()</code> method for a
            description of this parameter.
           </p>
          </descr>
         </param>
        </parameters>

        <returns type="void">
         <descr>
          <p></p>
         </descr>
        </returns>

        <raises></raises>
       </method>
      </interface>
     </definitions>

     <p>
      The User Interface event types are listed below. A DOM application
      may use the <code>hasFeature(feature, version)</code> method of
      the <code>DOMImplementation</code> interface with parameter values
      <code>"UIEvents"</code> and <code>"3.0"</code> (respectively) to
      determine whether or not the DOM Level 3 User Interface event
      module are supported by the implementation. In order to fully
      support this module, an implementation must also support the
      <code>"Events"</code> feature defined in this specification and
      the <code>"Views"</code> feature defined in the DOM Level 2 Views
      specification <bibref ref="DOM2Views"></bibref>. For additional
      information about
      <xspecref href="http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance" xlink:actuate="onRequest" xlink:show="new" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">conformance</xspecref>,
      please see the DOM Level 3 Core specification
      <bibref role="informative" ref="DOMCore"></bibref>. The DOM Level
      3 User Interface Events module is built on top of the DOM Level 2
      User Interface Events <bibref ref="DOM2Events"></bibref> module,
      i.e. a DOM Level 3 User Interface Events implementation where
      <code>hasFeature("UIEvents", "3.0")</code> returns
      <code>true</code> must also return <code>true</code> when the
      <code>version</code> number is <code>"2.0"</code>, <code>""</code>
      or, <code>null</code>.
     </p>

     <glist role="event-definition">
      <gitem>
       <label id="event-DOMActivate"><termref def="event-DOMActivate">DOMActivate</termref></label>

       <def>
        <table summary="This table contains information about the semantics of the given event type" border="0" cellspacing="0" cellpadding="2">
         <tbody>
          <tr>
           <th colspan="1" rowspan="1">
            Type
           </th>

           <td colspan="1" rowspan="1">
            <code>DOMActivate</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Namespace
           </th>

           <td colspan="1" rowspan="1">
            <code>None</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Interface
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Cancelable
           </th>

           <td colspan="1" rowspan="1">
            Yes
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Bubbles
           </th>

           <td colspan="1" rowspan="1">
            Yes
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Target
           </th>

           <td colspan="1" rowspan="1">
            <code>Element</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Context info
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent.view</code> is in use.
           </td>
          </tr>
         </tbody>
        </table>

        <p>
         Refer to <specref ref="Events-flow-activation"></specref>.
        </p>
       </def>
      </gitem>
     </glist>

     <glist role="event-definition">
      <gitem>
       <label id="event-DOMFocusIn"><termref def="event-DOMFocusIn">DOMFocusIn</termref></label>

       <def>
        <table summary="This table contains information about the semantics of the given event type" border="0" cellspacing="0" cellpadding="2">
         <tbody>
          <tr>
           <th colspan="1" rowspan="1">
            Type
           </th>

           <td colspan="1" rowspan="1">
            <code>DOMFocusIn</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Namespace
           </th>

           <td colspan="1" rowspan="1">
            <code>http://www.w3.org/2001/xml-events</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Interface
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Cancelable
           </th>

           <td colspan="1" rowspan="1">
            No
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Bubbles
           </th>

           <td colspan="1" rowspan="1">
            Yes
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Target
           </th>

           <td colspan="1" rowspan="1">
            <code>Element</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Context info
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent.view</code> is in use.
           </td>
          </tr>
         </tbody>
        </table>

        <p>
         An <termref def="dt-event-target">event target</termref>
         receives focus. The focus is given to the element before the
         dispatch of this event type. This event type is dispatched
         after the event type
         <termref def="event-focus">focus</termref>.
        </p>
       </def>
      </gitem>
     </glist>

     <glist role="event-definition">
      <gitem>
       <label id="event-DOMFocusOut"><termref def="event-DOMFocusOut">DOMFocusOut</termref></label>

       <def>
        <table summary="This table contains information about the semantics of the given event type" border="0" cellspacing="0" cellpadding="2">
         <tbody>
          <tr>
           <th colspan="1" rowspan="1">
            Type
           </th>

           <td colspan="1" rowspan="1">
            <code>DOMFocusOut</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Namespace
           </th>

           <td colspan="1" rowspan="1">
            <code>http://www.w3.org/2001/xml-events</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Interface
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Cancelable
           </th>

           <td colspan="1" rowspan="1">
            No
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Bubbles
           </th>

           <td colspan="1" rowspan="1">
            Yes
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Target
           </th>

           <td colspan="1" rowspan="1">
            Element
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Context info
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent.view</code> is in use.
           </td>
          </tr>
         </tbody>
        </table>

        <p>
         An <termref def="dt-event-target">event target</termref> loses
         focus. The focus is taken from the element before the dispatch
         of this event type. This event type is dispatched after the
         event type <termref def="event-blur">blur</termref>.
        </p>
       </def>
      </gitem>
     </glist>

     <glist role="event-definition">
      <gitem>
       <label id="event-focus"><termref def="event-focus">focus</termref></label>

       <def>
        <table summary="This table contains information about the semantics of the given event type" border="0" cellspacing="0" cellpadding="2">
         <tbody>
          <tr>
           <th colspan="1" rowspan="1">
            Type
           </th>

           <td colspan="1" rowspan="1">
            <code>focus</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Namespace
           </th>

           <td colspan="1" rowspan="1">
            <code>None</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Interface
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Cancelable
           </th>

           <td colspan="1" rowspan="1">
            No
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Bubbles
           </th>

           <td colspan="1" rowspan="1">
            No
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Target
           </th>

           <td colspan="1" rowspan="1">
            <code>Element</code>
           </td>
          </tr>

          <tr>
           <th colspan="1" rowspan="1">
            Context info
           </th>

           <td colspan="1" rowspan="1">
            <code>UIEvent.view</code> is in use.
           </td>
          </tr>
         </tbody>
        </table>

        <p>
         An <termref def="dt-event-target">event target</termref>
         receives focus. The focus is given to the element before the
         dispatch of this event type.
        </p>
       </def>
      </gitem>
     </glist>

     <glist role="event-definition">
      <gitem>
       <label id="event-blur"><termref def="event-blur">blur</termref></label>

       <def>
        <table summary="This table contains information about the semantics of the given event type" border="0" cellspacing="0" cellpadding="2">
         <tbody>
          <tr>
           <th colspan="1" rowspan="1">
            Type
           </th>

           <td colspan="1" rowspan="1">
            <code>blur</code>
           