--- a/html/WD-DOM3-Events-20131004.html Sun Nov 03 21:27:29 2013 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9383 +0,0 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<html lang="en-US" data-bug-product="WebAppsWG" data-bug-component="DOM3 Events" typeof="bibo:Document " about="" property="dcterms:language" content="en">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Document Object Model (DOM) Level 3 Events Specification</title>
- <style>/* --- ISSUES/NOTES --- */
-div.issue-title, div.note-title {
- padding-right: 1em;
- min-width: 7.5em;
- color: #b9ab2d;
-}
-div.issue-title { color: #e05252; }
-div.note-title { color: #2b2; }
-div.issue-title span, div.note-title span {
- text-transform: uppercase;
-}
-div.note, div.issue {
- margin-top: 1em;
- margin-bottom: 1em;
-}
-.note > p:first-child, .issue > p:first-child { margin-top: 0 }
-.issue, .note {
- padding: .5em;
- border-left-width: .5em;
- border-left-style: solid;
-}
-div.issue, div.note {
- padding: 1em 1.2em 0.5em;
- margin: 1em 0;
- position: relative;
- clear: both;
-}
-span.note, span.issue { padding: .1em .5em .15em; }
-
-.issue {
- border-color: #e05252;
- background: #fbe9e9;
-}
-.note {
- border-color: #52e052;
- background: #e9fbe9;
-}
-
-
-</style><style>/* --- WEB IDL --- */
-pre.idl {
- border-top: 1px solid #90b8de;
- border-bottom: 1px solid #90b8de;
- padding: 1em;
- line-height: 120%;
-}
-
-pre.idl::before {
- content: "WebIDL";
- display: block;
- width: 150px;
- background: #90b8de;
- color: #fff;
- font-family: initial;
- padding: 3px;
- font-weight: bold;
- margin: -1em 0 1em -1em;
-}
-
-.idlType {
- color: #ff4500;
- font-weight: bold;
- text-decoration: none;
-}
-
-/*.idlModule*/
-/*.idlModuleID*/
-/*.idlInterface*/
-.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
- font-weight: bold;
- color: #005a9c;
-}
-a.idlEnumItem {
- color: #000;
- border-bottom: 1px dotted #ccc;
- text-decoration: none;
-}
-
-.idlSuperclass {
- font-style: italic;
- color: #005a9c;
-}
-
-/*.idlAttribute*/
-.idlAttrType, .idlFieldType, .idlMemberType {
- color: #005a9c;
-}
-.idlAttrName, .idlFieldName, .idlMemberName {
- color: #ff4500;
-}
-.idlAttrName a, .idlFieldName a, .idlMemberName a {
- color: #ff4500;
- border-bottom: 1px dotted #ff4500;
- text-decoration: none;
-}
-
-/*.idlMethod*/
-.idlMethType, .idlCallbackType {
- color: #005a9c;
-}
-.idlMethName {
- color: #ff4500;
-}
-.idlMethName a {
- color: #ff4500;
- border-bottom: 1px dotted #ff4500;
- text-decoration: none;
-}
-
-/*.idlCtor*/
-.idlCtorName {
- color: #ff4500;
-}
-.idlCtorName a {
- color: #ff4500;
- border-bottom: 1px dotted #ff4500;
- text-decoration: none;
-}
-
-/*.idlParam*/
-.idlParamType {
- color: #005a9c;
-}
-.idlParamName, .idlDefaultValue {
- font-style: italic;
-}
-
-.extAttr {
- color: #666;
-}
-
-/*.idlSectionComment*/
-.idlSectionComment {
- color: gray;
-}
-
-/*.idlConst*/
-.idlConstType {
- color: #005a9c;
-}
-.idlConstName {
- color: #ff4500;
-}
-.idlConstName a {
- color: #ff4500;
- border-bottom: 1px dotted #ff4500;
- text-decoration: none;
-}
-
-/*.idlException*/
-.idlExceptionID {
- font-weight: bold;
- color: #c00;
-}
-
-.idlTypedefID, .idlTypedefType {
- color: #005a9c;
-}
-
-.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
- color: #c00;
- font-weight: normal;
-}
-
-.excName a {
- font-family: monospace;
-}
-
-.idlRaises a.idlType, .excName a.idlType {
- border-bottom: 1px dotted #c00;
-}
-
-.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
- width: 45px;
- text-align: center;
-}
-.excGetSetTrue, .prmNullTrue, .prmOptTrue { color: #0c0; }
-.excGetSetFalse, .prmNullFalse, .prmOptFalse { color: #c00; }
-
-.idlImplements a {
- font-weight: bold;
-}
-
-dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
- margin-left: 2em;
-}
-
-.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
- font-weight: normal;
-}
-
-.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
- font-weight: bold;
- color: #000;
- font-family: monospace;
-}
-
-.attributes dt code, .fields dt code, .dictionary-members dt code {
- background: #ffffd2;
-}
-
-.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
- color: #005a9c;
- background: transparent;
- font-family: inherit;
- font-weight: normal;
- font-style: italic;
-}
-
-.methods dt code {
- background: #d9e6f8;
-}
-
-.constants dt code {
- background: #ddffd2;
-}
-
-.constructors dt code {
- background: #cfc;
-}
-
-.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
- margin-bottom: 1em;
-}
-
-table.parameters, table.exceptions {
- border-spacing: 0;
- border-collapse: collapse;
- margin: 0.5em 0;
- width: 100%;
-}
-table.parameters { border-bottom: 1px solid #90b8de; }
-table.exceptions { border-bottom: 1px solid #deb890; }
-
-.parameters th, .exceptions th {
- color: #fff;
- padding: 3px 5px;
- text-align: left;
- font-family: initial;
- font-weight: normal;
- text-shadow: #666 1px 1px 0;
-}
-.parameters th { background: #90b8de; }
-.exceptions th { background: #deb890; }
-
-.parameters td, .exceptions td {
- padding: 3px 10px;
- border-top: 1px solid #ddd;
- vertical-align: top;
-}
-
-.parameters tr:first-child td, .exceptions tr:first-child td {
- border-top: none;
-}
-
-.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
- width: 100px;
-}
-
-.parameters td.prmType {
- width: 120px;
-}
-
-table.exceptions table {
- border-spacing: 0;
- border-collapse: collapse;
- width: 100%;
-}
-</style><link rel="author" href="mailto:www-dom@w3.org">
- <link rel="help" href="http://www.w3.org/DOM/">
- <link rel="alternate stylesheet" type="text/css" media="screen" title="geek" href="geek.css">
- <link rel="stylesheet" type="text/css" href="spec-WD.css">
- <link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/w3c-tr.css">
- <link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/W3C-WD">
- <link rel="stylesheet" type="text/css" href="override.css">
-
- <script type="text/javascript" src="key-table-builder.js"></script>
- <script type="text/javascript" src="fixup.js"></script>
- <script src="bug-assist.js"></script>
- <script type="text/javascript">
- var respecConfig = {
- specStatus: "ED",
- shortName: "DOM-Level-3-Events",
- editors: [
- {
- name: "Gary Kacmarcik",
- company: "Google, Inc.",
- url: "mailto:garykac@google.com?subject=%5BDOM3-event%5D%20Spec%20Feedback",
- companyURL: "http://www.google.com",
- note: "Jun 2013 - present",
- },
- {
- name: "Travis Leithead",
- company: "Microsoft Corp.",
- url: "mailto:travis.leithead@microsoft.com?subject=%5BDOM3-event%5D%20Spec%20Feedback",
- companyURL: "http://www.microsoft.com",
- note: "Feb 2012 - present",
- },
- {
- name: "Jacob Rossi",
- company: "Microsoft Corp.",
- note: "Mar 2011 - Oct 2011",
- },
- {
- name: "Doug Schepers",
- company: "W3C",
- note: "Mar 2008 - May 2011",
- },
- {
- name: "Björn Höhrmann",
- company: "Invited Expert",
- note: "until Jan 2008",
- },
- {
- name: "Philippe Le Hégaret",
- company: "W3C",
- note: "until Nov 2003",
- },
- {
- name: "Tom Pixley",
- company: "Netscape Communications Corporation",
- note: "until Jul 2002",
- }
- ],
- //publishDate: "2012-09-06",
- edDraftURI: "https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html",
- previousPublishDate: "2012-09-06",
- previousMaturity: "WD",
- noIDLIn: true,
- inlineCSS: true,
- //noRecTrack: true,
- wg: ["Web Applications Working Group"],
- wgURI: ["http://www.w3.org/2008/webapps/"],
- wgPublicList: "www-dom",
- wgPatentURI: ["http://www.w3.org/2004/01/pp-impl/42538/status"],
- maxTocLevel: 3
- };
- </script>
-<style>/*****************************************************************
- * ReSpec 3 CSS
- * Robin Berjon - http://berjon.com/
- *****************************************************************/
-
-/* --- INLINES --- */
-em.rfc2119 {
- text-transform: lowercase;
- font-variant: small-caps;
- font-style: normal;
- color: #900;
-}
-
-h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
-h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
- border: none;
-}
-
-dfn {
- font-weight: bold;
-}
-
-a.internalDFN {
- color: inherit;
- border-bottom: 1px solid #99c;
- text-decoration: none;
-}
-
-a.externalDFN {
- color: inherit;
- border-bottom: 1px dotted #ccc;
- text-decoration: none;
-}
-
-a.bibref {
- text-decoration: none;
-}
-
-cite .bibref {
- font-style: normal;
-}
-
-code {
- color: #ff4500;
-}
-
-/* --- TOC --- */
-.toc a, .tof a {
- text-decoration: none;
-}
-
-a .secno, a .figno {
- color: #000;
-}
-
-ul.tof, ol.tof {
- list-style: none outside none;
-}
-
-.caption {
- margin-top: 0.5em;
- font-style: italic;
-}
-
-/* --- TABLE --- */
-table.simple {
- border-spacing: 0;
- border-collapse: collapse;
- border-bottom: 3px solid #005a9c;
-}
-
-.simple th {
- background: #005a9c;
- color: #fff;
- padding: 3px 5px;
- text-align: left;
-}
-
-.simple th[scope="row"] {
- background: inherit;
- color: inherit;
- border-top: 1px solid #ddd;
-}
-
-.simple td {
- padding: 3px 10px;
- border-top: 1px solid #ddd;
-}
-
-.simple tr:nth-child(even) {
- background: #f0f6ff;
-}
-
-/* --- DL --- */
-.section dd > p:first-child {
- margin-top: 0;
-}
-
-.section dd > p:last-child {
- margin-bottom: 0;
-}
-
-.section dd {
- margin-bottom: 1em;
-}
-
-.section dl.attrs dd, .section dl.eldef dd {
- margin-bottom: 0;
-}
-</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="ui/save-html" src="https://raw.github.com/darobin/respec/gh-pages/js/ui/save-html.js"></script></head>
-<body class="h-entry" style="" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader">
- <p>
-
- <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C" /></a>
-
- </p>
- <h1 class="title p-name" id="title" property="dcterms:title">Document Object Model (DOM) Level 3 Events Specification</h1>
-
- <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-11-04T11:43:19.000Z" id="w3c-editor-s-draft-04-november-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2013-11-04">04 November 2013</time></h2>
- <dl>
-
- <dt>This version:</dt>
- <dd><a class="u-url" href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html">https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html</a></dd>
- <dt>Latest published version:</dt>
- <dd><a href="http://www.w3.org/TR/DOM-Level-3-Events/">http://www.w3.org/TR/DOM-Level-3-Events/</a></dd>
-
-
- <dt>Latest editor's draft:</dt>
- <dd><a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html">https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html</a></dd>
-
-
-
-
-
-
-
-
- <dt>Editors:</dt>
- <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Gary Kacmarcik" href="mailto:garykac@google.com?subject=%5BDOM3-event%5D%20Spec%20Feedback">Gary Kacmarcik</a>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com">Google, Inc.</a> (Jun 2013 - present)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Travis Leithead" href="mailto:travis.leithead@microsoft.com?subject=%5BDOM3-event%5D%20Spec%20Feedback">Travis Leithead</a>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.microsoft.com">Microsoft Corp.</a> (Feb 2012 - present)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Jacob Rossi</span>, Microsoft Corp. (Mar 2011 - Oct 2011)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Doug Schepers</span>, <abbr title="World Wide Web Consortium">W3C</abbr> (Mar 2008 - May 2011)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Björn Höhrmann</span>, Invited Expert (until Jan 2008)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Philippe Le Hégaret</span>, <abbr title="World Wide Web Consortium">W3C</abbr> (until Nov 2003)</span>
-</dd>
-<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Tom Pixley</span>, Netscape Communications Corporation (until Jul 2002)</span>
-</dd>
-
-
-
- </dl>
-
-
-
-
-
- <p class="copyright">
- <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
- 2013
-
- <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
- (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
- <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
- <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>),
-
- All Rights Reserved.
-
- <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
- <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
-
- <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
-
- rules apply.
- </p>
-
-
- <hr>
-</div>
- <!-- Section: Abstract ========================================================-->
- <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2>
- <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 [<a href="#references-DOM2Events">DOM2 Events</a>].</p>
- </section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2>
-
-
-
- <p>
- <em>This section describes the status of this document at the time of its publication. Other
- documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
- of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
- index</a> at http://www.w3.org/TR/.</em>
- </p>
-
- <p>This document is a Last Call Working Draft of the Document Object Model Level 3 Events (DOM3 Events) specification. This document was previously
- published as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, pending further feedback from implementers, and is now being revised to reflect the current state of implementation. It is expected that
- this specification will progress to <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation status after review and refinement.</p>
-
- <p>The <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> (WebApps WG) believes this specification to be feature complete, subject to further
- feedback during the Last Call period. The Last Call period extends through 27 September 2012. The public is encouraged to send comments to the WebApps Working Group's
- public mailing list for DOM specifications <a href="mailto:www-dom@w3.org">www-dom@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-dom/">archive</a>)
- with subject tag prefix <em>DOM3Events</em> (e.g., [DOM3Events] comment...).
- See <a href="http://www.w3.org/Mail/"><abbr title="World Wide Web Consortium">W3C</abbr> mailing list and archive usage guidelines</a>.</p>
-
- <p id="this-document-is-produced-by-the-web-app">This document is produced by the <a href="http://www.w3.org/2008/webapps/">Web Applications WG</a>, part of the <a href="http://www.w3.org/2006/rwc/Activity">Rich Web Clients Activity</a> in the <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Interaction/">Interaction Domain</a>. It is expected
- that this document will progress along the <abbr title="World Wide Web Consortium">W3C</abbr>'s Recommendation track. Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership. This is
- a draft document and <em class="rfc2119" title="MAY">MAY</em> 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 id="latest-editors-draft"><strong>You can find the latest
- <a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html">Editor's Draft</a>
- of this document in the
- <a href="https://dvcs.w3.org/hg/"><abbr title="World Wide Web Consortium">W3C</abbr>'s Mercurial repository</a>,
- which is updated on a regular basis.</strong></p>
-
- <p id="unstable"><strong class="redNote">Implementers should be aware that this document is not stable.</strong> Implementers who are not
- taking part in the discussions are likely to find the specification changing out from under them in incompatible ways. Vendors interested in implementing this document
- before it eventually reaches the Candidate Recommendation stage should join the aforementioned mailing lists and take part in the discussions.</p>
-
- <p>
- This document was published by the <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> as an Editor's Draft.
-
-
- If you wish to make comments regarding this document, please send them to
- <a href="mailto:www-dom@w3.org">www-dom@w3.org</a>
- (<a href="mailto:www-dom-request@w3.org?subject=subscribe">subscribe</a>,
- <a href="http://lists.w3.org/Archives/Public/www-dom/">archives</a>).
-
-
-
-
- All comments are welcome.</p>
-
-
- <p>
- Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> 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
-
- <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
-
-
-
-
-
- <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent disclosures</a>
-
- 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
- <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
- information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
- 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
-
-
- </p>
-
-
-
-
-</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#dom-events" class="tocxref"><span class="secno">1. </span>Document Object Model Events</a><ul class="toc"><li class="tocline"><a href="#dom-events-overview" class="tocxref"><span class="secno">1.1 </span>Introduction</a></li><li class="tocline"><a href="#dom-events-conformance" class="tocxref"><span class="secno">1.2 </span>Conformance</a></li><li class="tocline"><a href="#style-conventions" class="tocxref"><span class="secno">1.3 </span>Stylistic Conventions</a></li></ul></li><li class="tocline"><a href="#glossary" class="tocxref"><span class="secno">2. </span>Glossary</a></li><li class="tocline"><a href="#dom-event-architecture" class="tocxref"><span class="secno">3. </span>DOM Event Architecture</a><ul class="toc"><li class="tocline"><a href="#event-flow" class="tocxref"><span class="secno">3.1 </span>Event dispatch and DOM event flow</a></li><li class="tocline"><a href="#event-flow-default-cancel" class="tocxref"><span class="secno">3.2 </span>Default actions and cancelable events</a></li><li class="tocline"><a href="#sync-async" class="tocxref"><span class="secno">3.3 </span>Synchronous and asynchronous events</a><ul class="toc"><li class="tocline"><a href="#event-order-and-loops" class="tocxref"><span class="secno">3.3.1 </span>Event order and event loops</a></li></ul></li><li class="tocline"><a href="#trusted-events" class="tocxref"><span class="secno">3.4 </span>Trusted events</a></li><li class="tocline"><a href="#event-flow-activation" class="tocxref"><span class="secno">3.5 </span>Activation triggers and behavior</a><ul class="toc"><li class="tocline"><a href="#click-synthesis" class="tocxref"><span class="secno">3.5.1 </span>Activation event synthesis</a></li><li class="tocline"><a href="#events-activation-event-order" class="tocxref"><span class="secno">3.5.2 </span>Activation event order</a></li></ul></li><li class="tocline"><a href="#event-exceptions" class="tocxref"><span class="secno">3.6 </span>Event exceptions</a></li></ul></li><li class="tocline"><a href="#event-interfaces" class="tocxref"><span class="secno">4. </span>Basic Event Interfaces</a><ul class="toc"><li class="tocline"><a href="#interface-Event" class="tocxref"><span class="secno">4.1 </span>Interface Event</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">4.1.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1.2 </span>Methods</a></li><li class="tocline"><a href="#constants" class="tocxref"><span class="secno">4.1.3 </span>Constants</a></li></ul></li><li class="tocline"><a href="#interface-CustomEvent" class="tocxref"><span class="secno">4.2 </span>Interface CustomEvent</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">4.2.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#interface-EventTarget" class="tocxref"><span class="secno">4.3 </span>Interface EventTarget</a><ul class="toc"><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">4.3.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#interface-EventListener" class="tocxref"><span class="secno">4.4 </span>Interface EventListener</a><ul class="toc"><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">4.4.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#interface-DocumentEvent" class="tocxref"><span class="secno">4.5 </span>Interface DocumentEvent</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">4.5.1 </span>Methods</a></li></ul></li></ul></li><li class="tocline"><a href="#events-module" class="tocxref"><span class="secno">5. </span>Events Module</a><ul class="toc"><li class="tocline"><a href="#event-types" class="tocxref"><span class="secno">5.1 </span>Event Types</a><ul class="toc"><li class="tocline"><a href="#event-types-list" class="tocxref"><span class="secno">5.1.1 </span>List of DOM3 Event Types</a></li></ul></li><li class="tocline"><a href="#event-definitions" class="tocxref"><span class="secno">5.2 </span>Event Module Definitions</a><ul class="toc"><li class="tocline"><a href="#events-uievents" class="tocxref"><span class="secno">5.2.1 </span>User Interface Event Types</a></li><li class="tocline"><a href="#events-focusevent" class="tocxref"><span class="secno">5.2.2 </span>Focus Event Types</a></li><li class="tocline"><a href="#events-mouseevents" class="tocxref"><span class="secno">5.2.3 </span>Mouse Event Types</a></li><li class="tocline"><a href="#events-wheelevents" class="tocxref"><span class="secno">5.2.4 </span>Wheel Event Types</a></li><li class="tocline"><a href="#events-inputevents" class="tocxref"><span class="secno">5.2.5 </span>Input Event Types</a></li><li class="tocline"><a href="#events-keyboardevents" class="tocxref"><span class="secno">5.2.6 </span>Keyboard Event Types</a></li><li class="tocline"><a href="#events-compositionevents" class="tocxref"><span class="secno">5.2.7 </span>Composition Event Types</a></li></ul></li></ul></li><li class="tocline"><a href="#keys" class="tocxref"><span class="secno">6. </span>Keyboard events and key values</a><ul class="toc"><li class="tocline"><a href="#keyboard-input" class="tocxref"><span class="secno">6.1 </span>Keyboard Input</a><ul class="toc"><li class="tocline"><a href="#key-legends" class="tocxref"><span class="secno">6.1.1 </span>Key Legends</a></li><li class="tocline"><a href="#keyboard-layout" class="tocxref"><span class="secno">6.1.2 </span>Keyboard Layout</a></li></ul></li><li class="tocline"><a href="#keys-keyvalues" class="tocxref"><span class="secno">6.2 </span>Key Values</a><ul class="toc"><li class="tocline"><a href="#keys-unicode" class="tocxref"><span class="secno">6.2.1 </span>Key Values and Unicode</a></li><li class="tocline"><a href="#keys-Modifiers" class="tocxref"><span class="secno">6.2.2 </span>Modifier keys</a></li><li class="tocline"><a href="#keys-DeadKeys" class="tocxref"><span class="secno">6.2.3 </span>Dead keys</a></li><li class="tocline"><a href="#keys-IME" class="tocxref"><span class="secno">6.2.4 </span>Input Method Editors</a></li><li class="tocline"><a href="#keys-cancelable_keys" class="tocxref"><span class="secno">6.2.5 </span>Default actions and cancelable keyboard events</a></li><li class="tocline"><a href="#keys-Guide" class="tocxref"><span class="secno">6.2.6 </span>Guidelines for selecting and defining key values</a></li></ul></li><li class="tocline"><a href="#key-value-tables" class="tocxref"><span class="secno">6.3 </span>Key Value Tables</a><ul class="toc"><li class="tocline"><a href="#keys-special" class="tocxref"><span class="secno">6.3.1 </span>Special Key Values</a></li><li class="tocline"><a href="#keys-modifier" class="tocxref"><span class="secno">6.3.2 </span>Modifier Keys</a></li><li class="tocline"><a href="#keys-whitespace" class="tocxref"><span class="secno">6.3.3 </span>Whitespace Keys</a></li><li class="tocline"><a href="#keys-navication" class="tocxref"><span class="secno">6.3.4 </span>Navigation Keys</a></li><li class="tocline"><a href="#keys-editing" class="tocxref"><span class="secno">6.3.5 </span>Editing Keys</a></li><li class="tocline"><a href="#keys-ui" class="tocxref"><span class="secno">6.3.6 </span>UI Keys</a></li><li class="tocline"><a href="#keys-device" class="tocxref"><span class="secno">6.3.7 </span>Device Keys</a></li><li class="tocline"><a href="#keys-composition" class="tocxref"><span class="secno">6.3.8 </span>IME and Composition Keys</a></li></ul></li><li class="tocline"><a href="#new-event-interface-initializers" class="tocxref"><span class="secno">6.4 </span>Initializing New Event Interfaces</a><ul class="toc"><li class="tocline"><a href="#event-initializers" class="tocxref"><span class="secno">6.4.1 </span>Supplemental Initializer Interfaces</a></li></ul></li><li class="tocline"><a href="#legacy-key-attributes" class="tocxref"><span class="secno">6.5 </span>Legacy Key Attributes</a><ul class="toc"><li class="tocline"><a href="#KeyboardEvent-supplemental-interface" class="tocxref"><span class="secno">6.5.1 </span>Legacy <span class="formerLink"><code>KeyboardEvent</code></span> supplemental interface</a></li><li class="tocline"><a href="#legacy-key-models" class="tocxref"><span class="secno">6.5.2 </span>Legacy key models</a></li></ul></li><li class="tocline"><a href="#legacy-event-types" class="tocxref"><span class="secno">6.6 </span>Legacy Event Types</a><ul class="toc"><li class="tocline"><a href="#legacy-uievent-events" class="tocxref"><span class="secno">6.6.1 </span>Legacy <span class="formerLink"><code>UIEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-focusevent-events" class="tocxref"><span class="secno">6.6.2 </span>Legacy <span class="formerLink"><code>FocusEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-keyboardevent-events" class="tocxref"><span class="secno">6.6.3 </span>Legacy <span class="formerLink"><code>KeyboardEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-mutationevent-events" class="tocxref"><span class="secno">6.6.4 </span>Legacy <span class="formerLink"><code>MutationEvent</code></span> events</a></li></ul></li><li class="tocline"><a href="#extending_events" class="tocxref"><span class="secno">6.7 </span>Extending Events</a><ul class="toc"><li class="tocline"><a href="#extending_events-intro" class="tocxref"><span class="secno">6.7.1 </span>Introduction</a></li><li class="tocline"><a href="#extending_events-Custom_Events" class="tocxref"><span class="secno">6.7.2 </span>Custom Events</a></li><li class="tocline"><a href="#extending_events-Impl_Extensions" class="tocxref"><span class="secno">6.7.3 </span>Implementation-Specific Extensions</a></li></ul></li><li class="tocline"><a href="#security-considerations-Security" class="tocxref"><span class="secno">6.8 </span>Security Considerations</a></li><li class="tocline"><a href="#changes-Changes" class="tocxref"><span class="secno">6.9 </span>Changes</a><ul class="toc"><li class="tocline"><a href="#changes-DOMEvents2to3Changes" class="tocxref"><span class="secno">6.9.1 </span>Changes between DOM Level 2 Events and DOM Level 3 Events</a></li><li class="tocline"><a href="#changes-drafts" class="tocxref"><span class="secno">6.9.2 </span>Changes between different drafts of DOM Level 3 Events</a></li></ul></li><li class="tocline"><a href="#acknowledgements-contributors" class="tocxref"><span class="secno">6.10 </span>Acknowledgements</a><ul class="toc"><li class="tocline"><a href="#acknowledgements-Productions" class="tocxref"><span class="secno">6.10.1 </span>Production Systems</a></li></ul></li><li class="tocline"><a href="#references-role-references" class="tocxref"><span class="secno">6.11 </span>References</a><ul class="toc"><li class="tocline"><a href="#references-References-Normative" class="tocxref"><span class="secno">6.11.1 </span>Normative References</a></li><li class="tocline"><a href="#references-References-Informative" class="tocxref"><span class="secno">6.11.2 </span>Informative References</a></li></ul></li></ul></li></ul></section>
-
- <!-- Section: SOTD ========================================================-->
-
-
- <!-- Section 1: DOM3 Events Overview ========================================================-->
- <section id="dom-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_dom-events"><span class="secno">1. </span>Document Object Model Events</h2>
-
- <section id="dom-events-overview" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_dom-events-overview"><span class="secno">1.1 </span>Introduction</h3>
- <p>DOM Events is designed with two main goals. The first goal is the design of an <a class="def" href="#glossary-event">event</a> 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 DOM Events is to provide a common subset of the current event systems used in existing 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>
- </section> <!-- dom-events-overview -->
-
- <section id="dom-events-conformance" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_dom-events-conformance"><span class="secno">1.2 </span>Conformance</h3>
- <p><strong>This section is normative.</strong></p>
-
- <p>Within this specification, the key words <q><em class="rfc2119" title="MUST">MUST</em></q>, <q><em class="rfc2119" title="MUST NOT">MUST NOT</em></q>, <q><em class="rfc2119" title="REQUIRED">REQUIRED</em></q>,
- <q><em class="rfc2119" title="SHALL">SHALL</em></q>, <q><em class="rfc2119" title="SHALL NOT">SHALL NOT</em></q>, <q><em class="rfc2119" title="SHOULD">SHOULD</em></q>, <q><em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em></q>,
- <q><em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em></q>, <q><em class="rfc2119" title="MAY">MAY</em></q>, and <q><em class="rfc2119" title="OPTIONAL">OPTIONAL</em></q> are to be interpreted as described in
- <a href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a> [<a href="#ref-rfc2119">RFC2119</a>].</p>
-
- <p>This specification is to be understood in the context of the DOM Level 3 Core specification [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>]
- and the general considerations for DOM implementations apply. For example, handling of <a class="def" href="#glossary-namespaceURI">namespace URIs</a> is discussed in
- <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations"><em>XML Namespaces</em></a>. For additional information about
- <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance"><em>conformance</em></a>, please see the DOM Level 3 Core specification
- [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>]. A <a class="def" href="#glossary-user-agent">user agent</a> is not required to conform
- to the entirety of another specification in order to conform to this specification, but it <em class="rfc2119" title="MUST">MUST</em> conform to the specific parts of any other specification which are called
- out in this specification (e.g., a conforming DOM3 Events <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> support the <code>DOMString</code> data type as defined
- in <a href="#references-WebIDL">Web IDL</a>, but need not support every method or data type defined in <a href="#references-WebIDL">Web IDL</a> in order to conform
- to DOM3 Events).</p>
-
- <p>This specification defines several classes of conformance for different <a class="def" href="#glossary-user-agent">user agents</a>, specifications, and content authors:</p>
- <dl>
- <dt id="conf-interactive-ua">Web browsers and other dynamic or interactive <a class="def" href="#glossary-user-agent">user agents</a></dt>
- <dd>
- <p>A dynamic or interactive <a class="def" href="#glossary-user-agent">user agent</a>, referred to here as a <q>browser</q> (be it a Web browser, AT (Accessibility
- Technology) application, or other similar program), conforms to DOM Level 3 Events if it supports the Core module defined in [<cite><a class="normative" href="#references-DOMCore">DOM3
- Core</a></cite>], the <a href="#event-flow">Event dispatch and DOM event flow</a> mechanism, all the interfaces and events with their associated methods, attributes,
- and semantics defined in this specification with the exception of those marked as <a class="def" href="#glossary-deprecated">deprecated</a> (a conforming user agent
- <em class="rfc2119" title="MAY">MAY</em> implement the deprecated interfaces, events, or APIs for backwards compatibility, but is not required to do so in order to be conforming), and the complete
- set of <a class="def" href="#glossary-character-value">character values</a> and <a class="def" href="#glossary-key-value">key values</a> in the <a href="#key-value-tables">
- Key Value Tables</a> (subject to platform availability), as well as all other normative requirements defined in this specification. A conforming browser <em class="rfc2119" title="MUST">MUST</em>
- <a class="def" href="#glossary-dispatch">dispatch</a> events appropriate to the given <a href="#widl-EventTarget">EventTarget</a> when the conditions defined
- for that <a class="def" href="#glossary-event-type">event type</a> have been met.</p>
-
- <p><span id="conform-arch">A browser conforms specifically to the DOM Level 3 Events Architecture if it implements the <a href="#dom-event-architecture">DOM Event
- Architecture</a> and <a href="#event-interfaces">Basic Event Interfaces</a>, regardless of its support for any other event interfaces or <a class="def" href="#glossary-event-type">
- event types</a> defined in this specification.</span> <span id="conform-module">A browser conforms specifically to the DOM Level 3 Events Module if it implements
- the interfaces and its related <a class="def" href="#glossary-event-type">event types</a> specified in the <a href="#events-module">Events Module</a>, and to each
- event interface if it implements that interface and its related <a class="def" href="#glossary-event-type">event types</a>.</span></p>
-
- <p><span id="conform-script">A conforming browser <em class="rfc2119" title="MUST">MUST</em> support scripting, declarative interactivity, or some other means of detecting and dispatching events in the manner
- described by this specification, and <em class="rfc2119" title="MUST">MUST</em> support the APIs specified for that <a class="def" href="#glossary-event-type">event type</a>.</span></p>
-
- <p>In addition to meeting all other conformance criteria, a conforming browser <em class="rfc2119" title="MAY">MAY</em> implement features of this specification marked as <a class="def" href="#glossary-deprecated">
- deprecated</a>, for backwards compatibility with existing content, but such implementation is discouraged.</p>
-
- <p>A conforming browser <em class="rfc2119" title="MAY">MAY</em> also support features not found in this specification, but which use the <a href="#event-flow">Event dispatch and DOM event flow</a> mechanism,
- interfaces, events, or other features defined in DOM Level 3 Events, and <em class="rfc2119" title="MAY">MAY</em> implement additional interfaces and <a class="def" href="#glossary-event-type">event types</a>
- appropriate to that implementation. Such features can be later standardized in future specifications.</p>
-
- <p>A browser which does not conform to all required portions of this specification <em class="rfc2119" title="MUST NOT">MUST NOT</em> claim conformance to DOM Level 3 Events. Such an implementation which
- does conform to portions of this specification <em class="rfc2119" title="MAY">MAY</em> claim conformance to those specific portions.</p>
-
- <p>A conforming browser <em class="rfc2119" title="MUST">MUST</em> also be a <i>conforming implementation</i> of the IDL fragments in this specification, as described in the Web IDL specification. <a href="#references-WebIDL">[WEBIDL]</a></p>
- </dd>
-
- <dt id="conf-author-tools">Authoring tools</dt>
- <dd>
- <p>A content authoring tool conforms to DOM Level 3 Events if it produces content which uses the <a class="def" href="#glossary-event-type">event types</a> and <a href="#event-flow">Event dispatch and DOM event flow</a> model, consistent in a manner as defined in this specification. A content authoring tool <em class="rfc2119" title="MUST NOT">MUST NOT</em> claim
- conformance to DOM Level 3 Events for content it produces which uses features of this specification marked as <a class="def" href="#glossary-deprecated">deprecated</a>
- in this specification. A conforming content authoring tool <em class="rfc2119" title="SHOULD">SHOULD</em> provide to the content author a means to use all <a class="def" href="#glossary-event-type">event
- types</a> and interfaces appropriate to all <a class="def" href="#glossary-host-language">host languages</a> in the content document being produced.</p>
- </dd>
-
- <dt id="conf-authors">Content authors and content</dt>
- <dd>
- <p>A content author creates conforming DOM Level 3 Events content if that content uses the <a class="def" href="#glossary-event-type">event types</a> and <a href="#event-flow">
- Event dispatch and DOM event flow</a> model, consistent in a manner as defined in this specification. A content author <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use features of this specification
- marked as <a class="def" href="#glossary-deprecated">deprecated</a>, but <em class="rfc2119" title="SHOULD">SHOULD</em> rely instead upon replacement mechanisms defined in this specification and elsewhere.
- Conforming content <em class="rfc2119" title="MUST">MUST</em> use the semantics of the interfaces and <a class="def" href="#glossary-event-type">event types</a> as described in this specification.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_1"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Content authors are advised to follow best practices as described in <a href="http://www.w3.org/TR/WAI-WEBCONTENT/">
- accessibility</a> and <a href="http://www.w3.org/standards/techs/i18n">internationalization</a> guideline specifications.</p></div>
- </dd>
-
- <dt id="conf-specs">Specifications and host languages</dt>
- <dd>
- <p>A specification or <a class="def" href="#glossary-host-language">host language</a> conforms to DOM Level 3 Events if it references and uses the <a href="#event-flow">
- Event dispatch and DOM event flow</a> mechanism, interfaces, events, or other features defined in this specification, and does not extend these
- features in incompatible ways. A specification or <a class="def" href="#glossary-host-language">host language</a> conforms specifically to the DOM Level 3 Events
- Architecture if it references and uses the <a href="#dom-event-architecture">DOM Event Architecture</a> and <a href="#event-interfaces">Basic Event Interfaces</a>,
- regardless of its use of any other event interfaces or <a class="def" href="#glossary-event-type">event types</a> defined in this specification.</p>
-
- <p>A specification or <a class="def" href="#glossary-host-language">host language</a> conforms specifically to the DOM Level 3 Events Module if it references and uses the interfaces and
- its related <a class="def" href="#glossary-event-type">event types</a> specified in the <a href="#events-module">Events Module</a>, and to each event interface
- if it references and uses that interface and its related <a class="def" href="#glossary-event-type">event types</a>. A conforming specification <em class="rfc2119" title="MAY">MAY</em>
- define additional interfaces and <a class="def" href="#glossary-event-type">event types</a> appropriate to that specification, or <em class="rfc2119" title="MAY">MAY</em> extend the DOM Level 3 Events
- interfaces and <a class="def" href="#glossary-event-type">event types</a> in a manner that does not contradict or conflict with the definitions of those interfaces
- and <a class="def" href="#glossary-event-type">event types</a> in this specification.</p>
-
- <p>Specifications or <a class="def" href="#glossary-host-language">host languages</a> which reference DOM Level 3 Events <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use or recommend features of this
- specification marked as <a class="def" href="#glossary-deprecated">deprecated</a>, but <em class="rfc2119" title="SHOULD">SHOULD</em> use or recommend the indicated replacement for that the feature (if available).</p>
- </dd>
- </dl>
- </section> <!-- dom-events-conformance -->
-
- <section id="style-conventions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_style-conventions"><span class="secno">1.3 </span>Stylistic Conventions</h3>
- <p>The following stylistic conventions are followed in this specification, per the <a href="http://www.w3.org/People/Schepers/spec-conventions.html">Proposed <abbr title="World Wide Web Consortium">W3C</abbr> Specification
- Conventions</a>:</p>
-
- <dl>
- <dt>Keywords or values</dt>
- <dd><code>This is a keyword or value</code></dd>
-
- <dt>Event types</dt>
- <dd><code>This is an event type</code></dd>
-
- <dt>Key and character values</dt>
- <dd>
- This is a key name: <code class="key">'='</code> (e.g., the value of <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>).
- This is the equivalent character value: <code class="char">'\u003d'</code>.
- This is a glyph that represents that same character value: <code class="glyph">'='</code>.
- </dd>
-
- <dt>Glossary definitions</dt>
- <dd>This is a link to a definition in the glossary</dd>
-
- <dt>Notes</dt>
- <dd><div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_2"><span>Note</span></div><p class=""><strong>Note:</strong> This is a note.</p></div></dd>
-
- <dt>Warnings</dt>
- <dd><p class="warning"><strong>Warning!</strong> This is a warning. It is used on security notes and to mark <a class="def" href="#glossary-deprecated">deprecated</a> features.</p></dd>
-
- <dt>Examples</dt>
- <dd>
- <div class="example">
- <div class="example-title"></div>
- <p>This is an example.</p>
- </div>
- </dd>
-
- <!-- [Not current used in this document] <dt>Features at risk</dt>
- <dd><p class="atrisk">This is a feature at risk, which is likely to be removed from the specification.</p></dd>-->
-
- <dt>Spec Issues</dt>
- <dd><div class="issue"><div class="issue-title" aria-level="3" role="heading" id="h_issue_1"><span>Issue 1</span></div><p class="">This is an open issue.</p></div></dd>
- </dl>
-
- <p>In addition, certain terms are used in this specification with particular meanings. The term <q>implementation</q> applies to a browser, content authoring tool,
- or other <a class="def" href="#glossary-user-agent">user agent</a> that implements this specification, while a content author is a person who writes script or code
- that takes advantage of the interfaces, methods, attributes, events, and other features described in this specification in order to make Web applications, and a
- user is the person who uses those Web applications in an implementation.</p>
- </section> <!-- style-conventions -->
- </section> <!-- dom-events -->
-
- <!-- Section 2: Glossary ========================================================-->
- <section id="glossary" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_glossary"><span class="secno">2. </span>Glossary</h2>
-
- <p class="1st">Some of the following term definitions have been borrowed or modified from similar definitions in other <abbr title="World Wide Web Consortium">W3C</abbr> or standards documents. See the links within
- the definitions for more information.</p>
-
- <dl id="glossary-list">
- <dt id="glossary-activation-behavior"><dfn id="dfn-activation-behavior">activation behavior</dfn></dt>
- <dd>The action taken when an <a class="def" href="#glossary-event">event</a>, typically initiated by users through an input device, causes an element to fulfill a
- defined task. The task <em class="rfc2119" title="MAY">MAY</em> be defined for that element by the <a class="def" href="#glossary-host-language">host language</a>, or by
- author-defined variables, or both. The default task for any given element <em class="rfc2119" title="MAY">MAY</em> be a generic action, or <em class="rfc2119" title="MAY">MAY</em> be
- unique to that element. For example, the activation behavior of an HTML or SVG <code><a></code> element is to cause the
- <a class="def" href="#glossary-user-agent">user agent</a> to traverse the link specified in the <code>href</code> attribute, with the further optional parameter
- of specifying the browsing context for the traversal (such as the current window or tab, a named window, or a new window). The activation behavior of an HTML
- <code><input></code> element with the <code>type</code> attribute value <code>submit</code> is be to send the values of the form elements to an
- author-defined IRI by the author-defined HTTP method. See <a href="#event-flow-activation">Activation triggers and behavior</a> for more details.</dd>
-
- <dt id="glossary-activation-trigger"><dfn id="dfn-activation-trigger">activation trigger</dfn></dt>
- <dd>An event which is defined to initiate an <a class="def" href="#glossary-activation-behavior">activation behavior</a>. Refer to <a href="#event-flow-activation">
- Activation triggers and behavior</a> for more details.</dd>
-
- <dt id="glossary-author"><dfn id="dfn-author">author</dfn></dt>
- <dd>In the context of this specification, an <em>author</em>, <em>content author</em>, or <em>script author</em> is a person who writes script or other executable
- content that uses the interfaces, events, and event flow defined in this specification. See <a href="#conf-authors">Content authors and content</a> conformance
- category for more details.</dd>
-
- <dt id="glossary-bubbling-phase"><dfn id="dfn-bubbling-phase">bubbling phase</dfn></dt>
- <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by one of the target's ancestors <em>after</em> being handled by the
- <a class="def" href="#glossary-event-target">event target</a>. See the description of the <a href="#bubble-phase">bubble phase</a> in the context
- of event flow for more details.</dd>
-
- <dt id="glossary-capture-phase"><dfn id="dfn-capture-phase">capture phase</dfn></dt>
- <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by one of the target's ancestors <em>before</em> being handled by the
- <a class="def" href="#glossary-event-target">event target</a>. See the description of the <a href="#capture-phase">capture phase</a> in the context
- of event flow for more details.</dd>
-
- <dt id="glossary-character-value"><dfn id="dfn-character-value">character value</dfn></dt>
- <dd>In the context of key values, a character value is a string representing one or more Unicode characters, such as a letter or symbol, or a set of letters. In this
- specification, character values are denoted as a unicode string (e.g., <code class="char">'\u0020'</code>) or a glyph representation of the same code point (e.g.,
- <code class="glyph">' '</code>), and are color coded to help distinguish these two representations.
- <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_3"><span>Note</span></div><p class=""><strong>Note:</strong> In source code, some key values, such as non-graphic characters, can be represented using
- the character escape syntax of the programming language in use.</p></div>
- </dd>
-
- <dt id="glossary-candidate-event-handlers"><dfn id="dfn-candidate-event-handlers">candidate event handlers</dfn></dt>
- <dt><dfn id="dfn-candidate-event-listeners">candidate event listeners</dfn></dt>
- <dd>The list of all <a class="def" href="#glossary-event-handler">event listeners</a> that have been registered on the target object in their order of registration. This
- list is captured or <q>frozen</q> before event listeners on the target object are dispatched, and released or <q>un-frozen</q> after this set of candidate event
- handlers have been dispatched (allowing these event listeners to add or remove additional listeners on other objects in an event's propagation chain, but not affect
- the order of listeners that will be invoked on the target object).
-
- <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_4"><span>Note</span></div><p class=""><strong>Note:</strong> Initially capturing the candidate event handlers prevents infinite loops of event listener dispatch on a given target object.</p></div>
- </dd>
-
- <dt id="glossary-current-event-target"><dfn id="dfn-current-event-target">current event target</dfn></dt>
- <dd>In an event flow, the current event target is the object associated with the <a class="def" href="#glossary-event-handler">event handler</a> that is currently being
- dispatched. This object <em class="rfc2119" title="MAY">MAY</em> be the <a href="#glossary-event-target">event target</a> itself or one of its ancestors. The current event target changes as the
- <a class="def" href="#glossary-event">event</a> propagates from object to object through the various <a class="def" href="#glossary-phase">phases</a> of the event flow.
- The current event target is the value of the <a href="#widl-Event-currentTarget"><code>Event.currentTarget</code></a> attribute.</dd>
-
- <dt id="glossary-dead-key"><dfn id="dfn-dead-key">dead key</dfn></dt>
- <dd>A dead key is a key or combination of keys which produces no character by itself, but which in combination or sequence with another key produces a modified character,
- such as a character with diacritical marks (e.g., <code>ö</code>, <code>é</code>, <code>â</code>).</dd>
-
- <dt id="glossary-default-action"><dfn id="dfn-default-action">default action</dfn></dt>
- <dd>A <a class="def" href="#glossary-default-action">default action</a> is an <em class="rfc2119" title="OPTIONAL">OPTIONAL</em> supplementary behavior that an implementation
- <em class="rfc2119" title="MUST">MUST</em> perform in combination with the dispatch of the event object. Each event type definition, and each specification, defines the
- <a class="def" href="#glossary-default-action">default action</a> for that event type, if it has one. An instance of an event <em class="rfc2119" title="MAY">MAY</em> have more than
- one <a class="def" href="#glossary-default-action">default action</a> under some circumstances, such as when associated with an
- <a class="def" href="#glossary-activation-trigger">activation trigger</a>. A <a class="def" href="#glossary-default-action"> default action</a> <em class="rfc2119" title="MAY">MAY</em>
- be cancelled through the invocation of the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method. For more details, see
- <a href="#event-flow-default-cancel">Default actions and cancelable events</a>.</dd>
-
- <dt id="glossary-defaultView"><dfn id="dfn-defaultview">defaultView</dfn></dt>
- <dd>The <code>defaultView</code> is the document's browsing context's Window Proxy object as defined in <a href="http://dev.w3.org/html5/spec/single-page.html#dom-document-defaultview" title="HTML5 defaultView IDL attribute">HTML5</a> [<cite><a class="normative" href="#references-HTML5">HTML5</a></cite>].</dd>
-
- <dt id="glossary-delta"><dfn id="dfn-delta">delta</dfn></dt>
- <dd>The estimated scroll amount (in pixels, lines, or pages) that the user agent will scroll or zoom the page in response to the physical movement of an input device that
- supports the <code>WheelEvent</code> interface (such as a mouse wheel or touch pad). The value of a <a class="def" href="#glossary-delta">delta</a> (e.g., the <a href="#widl-WheelEvent-deltaX">deltaX</a>, <a href="#widl-WheelEvent-deltaY">deltaY</a>, or <a href="#widl-WheelEvent-deltaZ">deltaZ</a> attributes) is to be
- interpreted in the context of the current <a href="#widl-WheelEvent-deltaMode"><code>deltaMode</code></a> property. The relationship between the physical movement of
- a wheel (or other device) and whether the <a class="def" href="#glossary-delta">delta</a> is positive or negative is environment and device dependent. However, if a user
- agent scrolls as the <a class="def" href="#glossary-default-action">default action</a> then the sign of the <a class="def" href="#glossary-delta">delta</a> is given by a
- right-hand coordinate system where positive X,Y, and Z axes are directed towards the right-most edge, bottom-most edge, and farthest depth (away from the user) of the
- document, respectively.</dd>
-
- <dt id="glossary-deprecated"><dfn id="dfn-deprecated">deprecated</dfn></dt>
- <dd>Features marked as deprecated are included in the specification as reference to older implementations or specifications, but are <em class="rfc2119" title="OPTIONAL">OPTIONAL</em>
- and discouraged. Only features which have existing or in-progress replacements <em class="rfc2119" title="MUST">MUST</em> be deprecated in this specification. Implementations
- which do not already include support for the feature <em class="rfc2119" title="MAY">MAY</em> implement deprecated features for reasons of backwards compatibility with existing
- content, but content authors creating content <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use deprecated features, unless there is no other way to solve a use case.
- Other specifications which reference this specification <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use deprecated features, but <em class="rfc2119" title="SHOULD">SHOULD</em>
- point instead to the replacements of which the feature is deprecated in favor. Features marked as deprecated in this specification are expected to be dropped from
- future specifications.</dd>
-
- <dt id="glossary-dispatch"><dfn id="dfn-dispatch">dispatch</dfn></dt>
- <dd>To create an event with attributes and methods appropriate to its type and context, and propagate it through the DOM tree in the specified manner. Interchangeable
- with the term <q><a href="#glossary-fire">fire</a></q>, e.g., <q>fire a <a class="eventtype" href="#event-type-click"><code>click</code></a> event</q> or <q>dispatch
- a <a class="eventtype" href="#event-type-load"><code>load</code></a> event</q>.</dd>
-
- <dt id="glossary-document"><dfn id="dfn-document">document</dfn></dt>
- <dd>An object instantiating the <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#i-Document" title="Document Object Model Core"><code>Document</code> interface</a>
- [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>], representing the entire HTML or XML text document. Conceptually, it is the root of
- the document tree, and provides the primary access to the document's data.</dd>
-
- <dt id="glossary-DOM-application"><dfn id="dfn-dom-application">DOM application</dfn></dt>
- <dd>A DOM application is script or code, written by a content author or automatically generated, which takes advantage of the interfaces, methods, attributes, events,
- and other features described in this specification in order to make dynamic or interactive content, such as Web applications, exposed to users in a <a class="def" href="#glossary-user-agent">user agent</a>.</dd>
-
- <dt id="glossary-DOM-Level-0"><dfn id="dfn-dom-level-0">DOM Level 0</dfn></dt>
- <dd>The term <q>DOM Level 0</q> refers to a mix of HTML document functionalities, often not formally specified but traditionally supported as de facto standards, implemented
- originally by Netscape Navigator version 3.0 or Microsoft Internet Explorer version 3.0. In many cases, attributes or methods have been included for reasons of
- backward compatibility with <q>DOM Level 0</q>.</dd>
-
- <dt id="glossary-empty-string"><dfn id="dfn-empty-string">empty string</dfn></dt>
- <dd>The empty string is a value of type <code>DOMString</code> of length <code>0</code>, i.e., a string which contains no characters (neither printing nor control
- characters).</dd>
-
- <dt id="glossary-event"><dfn id="dfn-event">event</dfn></dt>
- <dd>An event is the representation of some occurrence (such as a mouse click on the presentation of an element, the removal of child node from an element, or any number
- of other possibilities) which is associated with its <a class="def" href="#glossary-event-target">event target</a>. Each event is an instantiation
- of one specific <a class="def" href="#glossary-event-type">event type</a>.</dd>
-
- <dt id="glossary-event-handler"><dfn id="dfn-event-handler">event handler</dfn></dt>
- <dt><dfn id="dfn-event-listener">event listener</dfn></dt>
- <dd>An object that implements the <a href="#interface-EventListener"><code>EventListener</code></a> interface and provides an <a href="#widl-EventListener-handleEvent">
- <code>EventListener.handleEvent()</code></a> callback method. Event handlers are language-specific. Event handlers are invoked in the context of a particular object
- (the <a class="def" href="#glossary-current-event-target">current event target</a>) and are provided with the event object itself.
-
- <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_5"><span>Note</span></div><p class=""><strong>Note: </strong>In JavaScript, user-defined functions are considered to implement the <code>EventListener</code> interface. Thus the
- <code>Event</code> object will be provided as the first parameter to the user-defined function when it is invoked. Additionally, JavaScript objects can also implement
- the <code>EventListener</code> interface when they define a <q><code>handleEvent</code></q> method.</p></div>
- </dd>
-
- <dt id="glossary-event-order"><dfn id="dfn-event-order">event order</dfn></dt>
- <dd>The sequence in which events from the same event source or process occur, using the same or related event interfaces. For example, in an environment with a mouse,
- a track pad, and a keyboard, each of those input devices would constitute a separate event source, and each would follow its own event order. A <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> event from the trackpad followed by a <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>
- event from the mouse would not result in a <a class="eventtype" href="#event-type-click"><code>click</code></a> event.
-
- <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_6"><span>Note</span></div><p class=""><strong>Note:</strong> There can be interactions between different event orders. For example, a <a class="eventtype" href="#event-type-click"><code>click</code></a> event might
- be modified by a concurrent <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event (<code class="key">'Shift'</code><code>+click</code>). However, the event orders
- of these different event sources would be distinct.</p></div>
-
- The event order of some interfaces are device-independent. For example, a user might change focus using the <a href="#key-Tab"><code class="key">'Tab'</code></a>
- key, or by clicking the new focused element with the mouse. The event order in such cases depends on the state of the process, not on the state of the device that
- initiates the state change.</dd>
-
- <dt id="glossary-event-phase"><dfn id="dfn-event-phase">event phase</dfn></dt>
- <dd>See <a class="def" href="#glossary-phase">phase</a>.</dd>
-
- <dt id="glossary-event-target"><dfn id="dfn-event-target">event target</dfn></dt>
- <dd>The object to which an <a class="def" href="#glossary-event">event</a> is targeted using the <a href="#event-flow">DOM event flow</a>. The event target is the
- value of the <a href="#widl-Event-target"><code>Event.target</code></a> attribute.</dd>
-
- <dt id="glossary-event-type"><dfn id="dfn-event-type">event type</dfn></dt>
- <dd>An <em>event type</em> is an <a class="def" href="#glossary-event">event</a> object with a particular name and which defines particular trigger conditions, properties,
- and other characteristics which distinguish it from other event types. For example, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event
- type has different characteristics than the <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a> or <a class="eventtype" href="#event-type-load">
- <code>load</code></a> event types. The event type is exposed as the <a href="#widl-Event-type"><code class="interface-attribute">Event.type</code></a>
- attribute on the event object. See <a href="#event-types">event types</a> for more details. Also loosely referred to as <em>'event'</em>, such as the <em><a class="eventtype" href="#event-type-click"><code>click</code></a> event</em>.</dd>
-
- <dt id="glossary-event-focus"><dfn id="dfn-focus">focus</dfn></dt>
- <dd>Focus is a special state of receptivity and concentration on an particular element or other <a class="def" href="#glossary-event-target">event target</a> within
- a document. Each element has different behavior when focused, depending on its functionality, such as priming the element for activation (as for a button or hyperlink)
- or toggling state (as for a checkbox), receiving text input (as for a text form field), or copying selected text. For more details, see <a href="#events-focusevent-doc-focus">
- Document Focus and Focus Context</a>.</dd>
-
- <dt id="glossary-event-focus-ring"><dfn id="dfn-focus-ring">focus ring</dfn></dt>
- <dd>A focus ring is an ordered set of <a class="def" href="#glossary-event-focus">focus</a> targets within a document. A <a class="def" href="#glossary-host-language">
- host language</a> <em class="rfc2119" title="MAY">MAY</em> define one or more ways to determine the order of targets, such as document order, a numerical index defined per focus target, explicit pointers
- between focus targets, or a hybrid of different models. Each document <em class="rfc2119" title="MAY">MAY</em> contain multiple focus rings, or conditional focus rings. Typically, for document-order
- or indexed focus rings, focus <q>wraps around</q> from the last focus target to the first.</dd>
-
- <dt id="glossary-fire"><dfn id="dfn-fire">fire</dfn></dt>
- <dd>A synonym for <a href="#glossary-dispatch">dispatch</a>.</dd>
-
- <dt id="glossary-host-language"><dfn id="dfn-host-language">host language</dfn></dt>
- <dd>Any language which integrates the features of another language or API specification, while normatively referencing the origin specification rather than redefining
- those features, and extending those features only in ways defined by the origin specification. An origin specification typically is only intended to be implemented
- in the context of one or more host languages, not as a standalone language. For example, XHTML, HTML, and SVG are host languages for DOM 3 Events, and they integrate
- and extend the objects and models defined in this specification.</dd>
-
- <dt id="glossary-hysteresis"><dfn id="dfn-hysteresis">hysteresis</dfn></dt>
- <dd>A feature of human interface design to accept input values within a certain range of location or time, in order to improve the user experience. For example, allowing
- for small deviation in the time it takes for a user to double-click a mouse button is temporal hysteresis, and not immediately closing a nested menu if the user
- mouses out from the parent window when transitioning to the child menu is locative hysteresis.</dd>
-
- <dt id="glossary-ime"><dfn id="dfn-ime">IME</dfn></dt>
- <dt id="glossary-input-method-editor"><dfn id="dfn-input-method-editor">input method editor</dfn></dt>
- <dd>An <em>input method editor</em> (IME), also known as a <em>front end processor</em>, is an application that performs the conversion between keystrokes and ideographs
- or other characters, usually by user-guided dictionary lookup, often used in East Asian languages (e.g., Chinese, Japanese, Korean). An <a class="def" href="#glossary-ime">
- IME</a> <em class="rfc2119" title="MAY">MAY</em> also be used for dictionary-based word completion, such as on mobile devices. See <a href="#keys-IME">Input Method Editors</a> for treatment of
- IMEs in this specification. See also <a class="def" href="#glossary-text-composition-system">text composition system</a>.</dd>
-
- <dt id="glossary-key-value"><dfn id="dfn-key-value">key value</dfn></dt>
- <dd>A key value is a <a class="def" href="#glossary-character-value">character value</a> or multi-character string (such as <a href="#key-Enter"><code class="key">'Enter'
- </code></a>, <a href="#key-Tab"><code class="key">'Tab'</code></a>, or <a href="#key-MediaNextTrack"><code class="key">'MediaNextTrack'</code></a>) associated
- with a key in a particular state. Every key has a key value, whether or not it has a <a class="def" href="#glossary-character-value">character value</a>. This includes
- control keys, function keys, <a class="def" href="#glossary-modifier-key">modifier keys</a>, <a class="def" href="#glossary-dead-key">dead keys</a>, and any other key.
- The key value of any given key at any given time depends upon the <a class="def" href="#glossary-key-mapping">key mapping</a>.</dd>
-
- <dt id="glossary-key-mapping"><dfn id="dfn-key-mapping">key mapping</dfn></dt>
- <dd>Key mapping is the process of assigning a key value to a particular key, and is the result of a combination of several factors, including the operating system
- and the keyboard layout (e.g., <a class="def" href="#glossary-qwerty">QWERTY</a>, Dvorak, Spanish, InScript, Chinese, etc.), and after taking into account all <a class="def" href="#glossary-modifier-key">modifier key</a> (<a href="#key-Shift"><code class="key">'Shift'</code></a>, <a href="#key-Alt"><code class="key">
- 'Alt'</code></a>, etc.) and <a class="def" href="#glossary-dead-key">dead key</a> states.</dd>
-
- <dt id="glossary-localname"><dfn id="dfn-local-name">local name</dfn></dt>
- <dd>See local name in [<cite><a class="informative" href="#references-Namespaces10">XML Namespaces 1.0</a></cite>].</dd>
-
- <dt id="glossary-modifier-key"><dfn id="dfn-modifier-key">modifier key</dfn></dt>
- <dd>A modifier key changes the normal behavior of a key, such as to produce a character of a different case (as with the <a href="#key-Shift"><code class="key">
- 'Shift'</code></a> key), or to alter what functionality the key triggers (as with the <a href="#key-Fn"><code class="key">'Fn'</code></a> or <a href="#key-Alt">
- <code class="key">'Alt'</code></a> keys). Refer to the <a href="#widl-KeyboardEvent-getModifierState"><code>KeyboardEvent.getModifierState()</code></a>
- method for a list of modifier keys defined in this specification. See also <a href="#keys-Modifiers">Modifier keys</a>.</dd>
-
- <dt id="glossary-namespaceURI"><dfn id="dfn-namespace-uri">namespace URI</dfn></dt>
- <dd>A <em>namespace URI</em> is a URI that identifies an XML namespace. This is called the namespace name in [<cite><a class="informative" href="#references-Namespaces10">XML
- Namespaces 1.0</a></cite>]. See also sections 1.3.2 <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#baseURIs-Considerations"><em>DOM URIs</em></a>
- and 1.3.3 <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations"><em>XML Namespaces</em></a> regarding URIs and namespace
- URIs handling and comparison in the DOM APIs.</dd>
-
- <dt id="glossary-phase"><dfn id="dfn-phase">phase</dfn></dt>
- <dd>In the context of <a class="def" href="#glossary-event">events</a>, a phase is set of logical traversals from node to node along the DOM tree, from the <a class="def" href="#glossary-defaultView">defaultView</a> (window), to the <code>Document</code> object, <a class="def" href="#glossary-root-element">root element</a>, and down
- to the <a class="def" href="#glossary-event-target">event target</a> (<a class="def" href="#glossary-capture-phase">capture phase</a>), at the <a class="def" href="#glossary-event-target">
- event target</a> itself (<a class="def" href="#glossary-target-phase">target phase</a>), and back up the same chain (<a class="def" href="#glossary-bubbling-phase">bubbling
- phase</a>).</dd>
-
- <dt id="glossary-propagation-path"><dfn id="dfn-propagation-path">propagation path</dfn></dt>
- <dd>The ordered set of <a class="def" href="#glossary-current-event-target">current event targets</a> though which an <a class="def" href="#glossary-event">event</a> object will pass
- sequentially on the way to and back from the <a class="def" href="#glossary-event-target">event target</a>. As the event propagates, each <a class="def" href="#glossary-current-event-target">current event target</a> in the propagation path is in turn set as the <a href="#widl-Event-currentTarget"><code>Event.currentTarget</code></a>.
- The propagation path is initially composed of one or more <a class="def" href="#glossary-event-phase">event phases</a> as defined by the <a class="def" href="#glossary-event-type">
- event type</a>, but <em class="rfc2119" title="MAY">MAY</em> be interrupted. Also known as an <em>event target chain</em>.</dd>
-
- <dt id="glossary-qwerty"><dfn id="dfn-qwerty">QWERTY</dfn></dt>
- <dd>QWERTY (pronounced <q>ˈkwɜrti</q>) is a common keyboard layout, so named because the first five character keys on the top row of letter keys are Q,
- W, E, R, T, and Y. There are many other popular keyboard layouts (including the Dvorak and Colemak layouts), most designed for localization or ergonomics.</dd>
-
- <dt id="glossary-root-element"><dfn id="dfn-root-element">root element</dfn></dt>
- <dd>The first element node of a document, of which all other elements are children. The document element.</dd>
-
- <dt id="glossary-rotation"><dfn id="dfn-rotation">rotation</dfn></dt>
- <dd>An indication of incremental change on an input device using the <a href="#interface-WheelEvent">WheelEvent</a> interface. On some devices this <em class="rfc2119" title="MAY">MAY</em> be a literal
- rotation of a wheel, while on others, it <em class="rfc2119" title="MAY">MAY</em> be movement along a flat surface, or pressure on a particular button.</dd>
-
- <dt id="glossary-text-composition-system"><dfn id="dfn-text-composition-system">text composition system</dfn></dt>
- <dd>A software component that interprets some form of alternate input (such as a <a class="def" href="#glossary-ime">input method editor</a>, a speech processor, or
- a handwriting recognition system) and converts it to text.</dd>
-
- <dt id="glossary-target-phase"><dfn id="dfn-target-phase">target phase</dfn></dt>
- <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by the <a class="def" href="#glossary-event-target">event target</a>.
- See the description of the <a href="#target-phase">target phase</a> in the context of event flow for more details.</dd>
-
- <dt id="glossary-topmost-event-target"><dfn id="dfn-topmost-event-target">topmost event target</dfn></dt>
- <dd>The <a class="def" href="#glossary-topmost-event-target">topmost event target</a> <em class="rfc2119" title="MUST">MUST</em> be the element highest in the rendering order which is capable of being
- an <a class="def" href="#glossary-event-target">event target</a>. In graphical user interfaces this is the element under the user's pointing device. A user
- interface's <q>hit testing</q> facility is used to determine the target. For specific details regarding hit testing and stacking order, refer to the
- <a class="def" href="#glossary-host-language">host language</a>.</dd>
-
- <dt id="glossary-tree"><dfn id="dfn-tree">tree</dfn></dt>
- <dd>A data structure that represents a document as a hierarchical set of nodes with child-parent-sibling relationships, i.e., each node having one or more possible
- ancestors (nodes higher in the hierarchy in a direct lineage), one or more possible descendants (nodes lower in the hierarchy in a direct lineage), and one or more
- possible peers (nodes of the same level in the hierarchy, with the same immediate ancestor).</dd>
-
- <dt id="glossary-Unicode-character-categories"><dfn id="dfn-unicode-character-categories">Unicode character categories</dfn></dt>
- <dd>A subset of the General Category values that are defined for each Unicode code point. This subset contains all the
- Letter (<abbr title="Letter, Lowercase">Ll</abbr>,
- <abbr title="Letter, Modifier">Lm</abbr>,
- <abbr title="Letter, Other">Lo</abbr>,
- <abbr title="Letter, Titlecase">Lt</abbr>,
- <abbr title="Letter, Uppercase">Lu</abbr>),
- Number (<abbr title="Number, Decimal Digit">Nd</abbr>,
- <abbr title="Number, Letter">Nl</abbr>,
- <abbr title="Number, Other">No</abbr>),
- Punctuation (<abbr title="Punctuation, Connector">Pc</abbr>,
- <abbr title="Punctuation, Dash">Pd</abbr>,
- <abbr title="Punctuation, Close">Pe</abbr>,
- <abbr title="Punctuation, Final quote">Pf</abbr>,
- <abbr title="Punctuation, Initial quote">Pi</abbr>,
- <abbr title="Punctuation, Other">Po</abbr>,
- <abbr title="Punctuation, Open">Ps</abbr>)
- and Symbol (<abbr title="Symbol, Currency">Sc</abbr>,
- <abbr title="Symbol, Modifier">Sk</abbr>,
- <abbr title="Symbol, Math">Sm</abbr>,
- <abbr title="Symbol, Other">So</abbr>)
- category values.</dd>
-
- <dt id="glossary-unicode-code-point"><dfn id="dfn-unicode-code-point">Unicode code point</dfn></dt>
- <dd>A Unicode code point is a unique hexadecimal number signifying a character by its index in the Unicode codespace (or library of characters). In the context of
- key values, a Unicode code point is expressed as a string in the format <code>\u</code> followed by a hexadecimal character index in the range <code>0000</code>
- to <code>10FFFF</code>, using at least four digits. See also <a class="def" href="#glossary-character-value">character value</a>.</dd>
-
- <dt id="glossary-un-initialized-value"><dfn id="dfn-un-initialized-value">un-initialized value</dfn></dt>
- <dd>The value of any event attribute (such as <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a> or <a href="#widl-Event-currentTarget"><code>
- Event.currentTarget</code></a>) before the event has been initialized with <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>. The un-initialized
- values of an <code>Event</code> apply immediately after a new event has been created using the method <a href="#widl-DocumentEvent-createEvent"><code>
- DocumentEvent.createEvent()</code></a>.</dd>
-
- <dt id="glossary-user-agent"><dfn id="dfn-user-agent">user agent</dfn></dt>
- <dd>A program, such as a browser or content authoring tool, normally running on a client machine, which acts on a user's behalf in retrieving, interpreting, executing,
- presenting, or creating content. Users <em class="rfc2119" title="MAY">MAY</em> act on the content using different user agents at different times, for different purposes. See the <a href="#conf-interactive-ua">
- Web browsers and other dynamic or interactive user agents</a> and <a href="#conf-author-tools">Authoring tools</a> for details on the requirements for a <em>conforming</em>
- user agent.</dd>
- </dl>
- </section>
-
- <!-- Section 3: Architecture ========================================================-->
- <section id="dom-event-architecture" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_dom-event-architecture"><span class="secno">3. </span>DOM Event Architecture</h2>
-
- <section id="event-flow" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-flow"><span class="secno">3.1 </span>Event dispatch and DOM event flow</h3>
-
- <p>This section defines the event <a class="def" href="#glossary-dispatch">dispatch</a> mechanism of the event model defined in this specification.
- Applications <em class="rfc2119" title="MAY">MAY</em> dispatch event objects using the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method, and
- implementations <em class="rfc2119" title="MUST">MUST</em> dispatch event objects as if through this method. The behavior of this method depends on the <em>event flow</em>
- associated with the underlying object. An event flow describes how event objects <em>propagate</em> through a data structure. As an example, when an event object
- is dispatched to an element in an XML document, the object propagates through parts of the document, as determined by the DOM event flow which is defined at the
- end of this section.</p>
-
- <figure class="figure" style="text-align: center" id="fig-graphical-representation-of-an-event-dispatched-in-a-dom-tree-using-the-dom-event-flow">
- <object type="image/svg+xml" data="images/eventflow.svg" width="520" height="560">
- <img src="images/eventflow.png" alt="Graphical representation of an event dispatched in a DOM tree using the DOM event flow" title="Graphical representation of an event dispatched in a DOM tree using the DOM event flow" />
- </object>
- <figcaption>Fig. <span class="figno">1</span> <span class="fig-title">Graphical representation of an event dispatched in a DOM tree using the DOM event flow</span></figcaption></figure>
-
- <p>Event objects are dispatched to an <a class="def" href="#glossary-event-target">event target</a>. At the beginning
- of the dispatch, implementations <em class="rfc2119" title="MUST">MUST</em> first determine the event object's <a class="def" href="#glossary-propagation-path">propagation path</a>.</p>
-
- <p>The propagation path <em class="rfc2119" title="MUST">MUST</em> be an ordered list of <a class="def" href="#glossary-current-event-target">current event targets</a> through which
- the event object <em class="rfc2119" title="MUST">MUST</em> pass. For DOM implementations, the propagation path <em class="rfc2119" title="MUST">MUST</em> reflect the hierarchical tree
- structure of the document. The last item in the list <em class="rfc2119" title="MUST">MUST</em> be the <a class="def" href="#glossary-event-target">event target</a>. The
- preceding items in the list are referred to as the <em>target's ancestors</em>, and the immediately preceding item as the <em>target's parent</em>. Once determined, the
- propagation path <em class="rfc2119" title="MUST NOT">MUST NOT</em> be changed. For DOM implementations, this applies even if an element in the propagation path is moved within the
- DOM or removed from the DOM.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>In the DOM event flow, event listeners might change the position of the <a class="def" href="#glossary-event-target">
- event target</a> in the document while the event object is being dispatched. Such changes do not affect the propagation path.</p>
- </div>
-
- <p>Exceptions thrown inside event listeners <em class="rfc2119" title="MUST NOT">MUST NOT</em> stop the propagation of the event or affect the
- <a class="def" href="#glossary-propagation-path">propagation path</a>. The exception itself <em class="rfc2119" title="MUST NOT">MUST NOT</em> propagate outside the scope of the event
- handler.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>In the following code, the exception thrown from the call to <code>throw "Error"</code> does not propagate into the parent scope
- (which would prevent the <code>console.log</code> statement from executing):</p>
- <pre>var e = document.createEvent("Event");
-e.initEvent("myevent", false, false);
-var target = document.createElement("div");
-target.addEventListener("myevent", function () {
- throw "Error";
-});
-target.dispatchEvent(e); <span class="comment">// Causes the event listener to throw an exception...</span>
-<span class="comment">// The previously thrown exception doesn't affect the code that follows:</span>
-console.log("Exceptions? No problem");</pre>
- </div>
-
- <p id="event-phase">As the next step, the event object <em class="rfc2119" title="MUST">MUST</em> complete one or more <a class="def" href="#glossary-phase">event phases</a>. This specification defines
- three event phases: <a href="#capture-phase">capture phase</a>, <a href="#target-phase">target phase</a> and <a href="#bubble-phase">bubble phase</a>. Event objects
- complete these phases in the specified order using the partial propagation paths as defined below. A phase <em class="rfc2119" title="MUST">MUST</em> be skipped if it is not
- supported, or if the event object's propagation has been stopped. For example, if the <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a>
- attribute is set to false, the bubble phase will be skipped, and if <a href="#widl-Event-stopPropagation"><code>Event.stopPropagation()</code></a> has been
- called prior to the dispatch, all phases <em class="rfc2119" title="MUST">MUST</em> be skipped.</p>
-
- <ol>
- <li>The <strong id="capture-phase">capture phase</strong>: The event object <em class="rfc2119" title="MUST">MUST</em> propagate through the target's ancestors from the <a class="def" href="#glossary-defaultView">defaultView</a> to the target's parent. This phase is also known as the <em>capturing phase</em>. Event
- listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em> handle the event before it reaches its target.</li>
-
- <li>The <strong id="target-phase">target phase</strong>: The event object <em class="rfc2119" title="MUST">MUST</em> arrive at the event object's <a class="def" href="#glossary-event-target">
- event target</a>. This phase is also known as the <em>at-target phase</em>. Event listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em>
- handle the event once it has reached its target. If the <a class="def" href="#glossary-event-type">event type</a> indicates that
- the event <em class="rfc2119" title="MUST NOT">MUST NOT</em> bubble, the event object <em class="rfc2119" title="MUST">MUST</em> halt after completion of this phase.</li>
-
- <li>The <strong id="bubble-phase">bubble phase</strong>: The event object propagates through the target's ancestors in reverse order, starting
- with the target's parent and ending with the <a class="def" href="#glossary-defaultView">defaultView</a>. This phase is also known as the <em>bubbling phase</em>.
- Event listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em> handle the event after it has reached its target.</li>
- </ol>
-
- <p>Implementations <em class="rfc2119" title="MUST">MUST</em> let event objects accomplish an event phase by applying the following steps while there are pending event targets in
- the partial propagation path for this phase and the event object's propagation has not been stopped through <a href="#widl-Event-stopPropagation"><code>
- Event.stopPropagation()</code></a>.</p>
-
- <p>First, the implementation <em class="rfc2119" title="MUST">MUST</em> determine the <em>current target</em>. This <em class="rfc2119" title="MUST">MUST</em> be the next pending event target in the partial propagation
- path, starting with the first. From the perspective of an event listener this <em class="rfc2119" title="MUST">MUST</em> be the event target the listener has been registered on.</p>
-
- <p>Next, the implementation <em class="rfc2119" title="MUST">MUST</em> determine the current target's <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>.
- This <em class="rfc2119" title="MUST">MUST</em> be the list of all event listeners that have been registered on the current target in their order of registration. [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines the ordering of listeners registered through event handler attributes. Once determined, the candidate event listeners
- <em class="rfc2119" title="MUST NOT">MUST NOT</em> be changed. Adding or removing listeners does not affect the current target's candidate event listeners.</p>
-
- <p>Finally, the implementation <em class="rfc2119" title="MUST">MUST</em> process all candidate <a class="def" href="#glossary-event-handler">event handlers</a> in order and trigger
- each handler if all the following conditions are met:</p>
-
- <ul>
- <li>The event object's immediate propagation has not been stopped.</li>
-
- <li>The listener has been registered for this event phase.</li>
-
- <li>The listener has been registered for this <a class="def" href="#glossary-event-type">event type</a>.</li>
- </ul>
-
- <p>In the production of the <a class="def" href="#glossary-propagation-path">propagation path</a>, if the <a class="def" href="#glossary-defaultView">defaultView</a>
- implements the <a href="#widl-EventTarget"><code>EventTarget</code></a> interface, the event propagates from <a class="def" href="#glossary-defaultView">defaultView</a>
- to the <code>document</code> object during the <a class="def" href="#glossary-capture-phase">capture phase</a>, and from the <code>document</code> object to the
- <a class="def" href="#glossary-defaultView">defaultView</a> during the <a class="def" href="#glossary-bubbling-phase">bubble phase</a>.</p>
-
- <p>After an event completes all the phases of its <a class="def" href="#glossary-propagation-path">propagation path</a>, its <a href="#widl-Event-currentTarget">
- <code>Event.currentTarget</code></a> <em class="rfc2119" title="MUST">MUST</em> be set to <code>null</code> and the <a href="#widl-Event-eventPhase"><code>Event.eventPhase</code></a> <em class="rfc2119" title="MUST">MUST</em> be
- set to <code>0</code> (<a href="#widl-Event-NONE"><code>NONE</code></a>). All other attributes of the <code>Event</code> (or interface derived from <code>Event</code>)
- are unchanged (including the <a href="#widl-Event-target"><code>Event.target</code></a> attribute, which <em class="rfc2119" title="MUST">MUST</em> continue to reference the <a class="def" href="#glossary-event-target">
- event target</a>).</p>
-
- <p>The model defined above <em class="rfc2119" title="MUST">MUST</em> be applied regardless of the specific event flow associated with an event target. Each event flow <em class="rfc2119" title="MUST">MUST</em> define how the propagation path
- <em class="rfc2119" title="MUST">MUST</em> be determined and which event phases are supported. The <em>DOM event flow</em> is an application of this model: the propagation path for a <code>Node</code>
- object <em class="rfc2119" title="MUST">MUST</em> be determined by its <code>Node.parentNode</code> chain, and if applicable, the document's containing <a class="def" href="#glossary-defaultView">defaultView</a>.
- All events accomplish the capture and target phases. Whether an event accomplishes the bubble phase <em class="rfc2119" title="MUST">MUST</em> be defined individually for each <a class="def" href="#glossary-event-type">
- event type</a>. An alternate application of this model can be found in [<cite><a class="informative" href="#references-DOMLS">DOM3 Load and Save</a></cite>].</p>
-
- <p>Implementations of the DOM event model <em class="rfc2119" title="MUST">MUST</em> be reentrant. Event listeners <em class="rfc2119" title="MAY">MAY</em> perform actions that cause additional events to be dispatched. Such events are handled
- in a synchronous manner, the event propagation that causes the event listener to be triggered <em class="rfc2119" title="MUST">MUST</em> resume only after the event dispatch of the new event is completed.</p>
- </section>
-
- <section id="event-flow-default-cancel" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-flow-default-cancel"><span class="secno">3.2 </span>Default actions and cancelable events</h3>
-
- <p>Events are typically dispatched by the implementation as a result of a user action, in response to the completion of a task, or to signal progress during asynchronous
- activity (such as a network request). Some events can be used to control the behavior that the implementation <em class="rfc2119" title="MAY">MAY</em> take next (or undo an action that the implementation
- already took). Events in this category are said to be <em>cancelable</em> and the behavior they cancel is called their <a class="def" href="#glossary-default-action">
- <em>default action</em></a>. Cancelable event objects can be associated with one or more <a class="def" href="#glossary-default-action">default actions</a>.
- To cancel an event, call the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> event is dispatched immediately after the user presses down a button on a
- pointing device (typically a mouse). One possible <a class="def" href="#glossary-default-action">default action</a> taken by the implementation is to set up a state
- machine that allows the user to drag images or select text. The <a class="def" href="#glossary-default-action">default action</a> depends on what happens next — for
- example, if the user's pointing device is over text, a text selection might begin. If the user's pointing device is over an image, then an image-drag action could
- begin. Preventing the <a class="def" href="#glossary-default-action">default action</a> of a <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>
- event prevents these actions from occuring.</p>
- </div>
-
- <p><a class="def" href="#glossary-default-action">Default actions</a> <em class="rfc2119" title="SHOULD">SHOULD</em> be performed after the event dispatch has been completed, but in exceptional
- cases <em class="rfc2119" title="MAY">MAY</em> also be performed immediately before the event is dispatched.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The default action associated with the <a class="eventtype" href="#event-type-click"><code>click</code></a> event on <code><input
- type="checkbox"></code> elements toggles the <code>checked</code> IDL attribute value of that element. If the <a class="eventtype" href="#event-type-click"><code>click</code>
- </a> event's default action is cancelled, then the value is restored to its former state.</p>
- </div>
-
- <p id="events-dt-cancelable-event">When an event is canceled, then the conditional <a class="def" href="#glossary-default-action">default actions</a> associated with the event <em class="rfc2119" title="MUST">MUST</em> be skipped (or
- as mentioned above, if the <a class="def" href="#glossary-default-action">default actions</a> are carried out before the dispatch, their effect <em class="rfc2119" title="MUST">MUST</em> be undone).
- Whether an event object is cancelable <em class="rfc2119" title="MUST">MUST</em> be indicated by the <a href="#widl-Event-cancelable"><code>Event.cancelable</code></a> attribute. <a href="#widl-Event-preventDefault">
- <code>Event.preventDefault()</code></a> stops all related <a class="def" href="#glossary-default-action">default actions</a> of an event object. The <a href="#widl-Event-defaultPrevented">
- <code>Event.defaultPrevented</code></a> attribute indicates whether an event has already been canceled (e.g., by a prior event listener). If the <a class="def" href="#glossary-DOM-application">
- DOM application</a> itself initiated the dispatch, then the return value of the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a>
- method indicates whether the event object was cancelled.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_7"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Many implementations additionally interpret an event listener's return value, such as the value <code>false</code>, to mean
- that the <a class="def" href="#glossary-default-action">default action</a> of cancelable events will be cancelled (though <code>window.onerror</code> handlers are cancelled
- by returning <code>true</code>).</p></div>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_8"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Some cancelable events might not have any observable <a class="def" href="#glossary-default-action">default actions</a>. For
- example, the <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a> event.</p></div>
-
- <p>This specification does not offer features to programatically query if an event object has any <a class="def" href="#glossary-default-action">default action</a> associated with
- it, or to associate new <a class="def" href="#glossary-default-action">default actions</a> with an event object. Other specifications <em class="rfc2119" title="SHOULD">SHOULD</em> define what default actions, if any,
- are associated with certain event objects. Further, implementations <em class="rfc2119" title="MAY">MAY</em> associate <a class="def" href="#glossary-default-action">default actions</a> with events as necessary and
- appropriate for that implementation.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>As an example, one implementation might scroll a document view by a certain amount as the <a class="def" href="#glossary-default-action">
- default action</a> of a <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event, while another implementation might instead zoom the document as its <a class="def" href="#glossary-default-action">default action</a>.</p>
- </div>
- </section>
-
- <section id="sync-async" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_sync-async"><span class="secno">3.3 </span>Synchronous and asynchronous events</h3>
-
- <p>Events <em class="rfc2119" title="MAY">MAY</em> be dispatched either synchronously or asynchronously.</p>
-
- <p>Events which are synchronous (<em><q>sync events</q></em>) <em class="rfc2119" title="MUST">MUST</em> be treated as if they are in a virtual queue in a first-in-first-out model, ordered by sequence
- of temporal occurrence with respect to other events, to changes in the DOM, and to user interaction. Each event in this virtual queue <em class="rfc2119" title="MUST">MUST</em> be delayed until the
- previous event has completed its propagation behavior, or been canceled. Some sync events are driven by a specific device or process, such as mouse button events.
- These events are governed by the <a class="def" href="#glossary-event-order">event order</a> algorithms defined for that set of events, and a user agent <em class="rfc2119" title="MUST">MUST</em> dispatch
- these events in the defined order.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A user double-clicks a passage of text to select a word, then presses the <code class="key">'Del'</code>
- key to erase the word, triggering the following synchronous sequence of events:
- <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
- <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
- <a class="eventtype" href="#event-type-click"><code>click</code></a>,
- <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
- <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
- <a class="eventtype" href="#event-type-click"><code>click</code></a>,
- <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>,
- <a class="eventtype" href="#event-type-select"><code>select</code></a>,
- <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
- <a class="eventtype" href="#event-type-input"><code>input</code></a>,
- <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>.
- Each of these events are fired in the sequence initiated by the user's actions.</p>
- </div>
-
- <p>Events which are asynchronous (<em><q>async events</q></em>) <em class="rfc2119" title="MAY">MAY</em> be dispatched as the results of the action are completed, with no relation to other events, to
- other changes in the DOM, nor to user interaction.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>During loading of a document, an inline script element is parsed and executed. The <a class="eventtype" href="#event-type-load">
- <code>load</code></a> event is queued to be fired asynchronously at the script element. However, because it is an async event, its order with relation to other synchronous
- events fired during document load (such as the <code>DOMContentLoaded</code> event from <cite><a class="informative" href="#references-HTML5">HTML5</a></cite>) is not guaranteed.</p>
- </div>
-
- <section id="event-order-and-loops" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_event-order-and-loops"><span class="secno">3.3.1 </span>Event order and event loops</h4>
-
- <p>Most events take place in a sequential context. [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines its event operations in terms
- of an event loop mechanism, in which events of all types are fed into different <em>task queues</em>. This specification does not define events in terms of this
- event loop mechanism, but it is compatible with this mechanism. Instead, this specification defines several operation-specific <a class="def" href="#glossary-event-order">
- event orders</a>.</p>
-
- <p>Using the terminology of HTML5, each independent device, such as a mouse or keyboard, <em class="rfc2119" title="SHOULD">SHOULD</em> be treated as a <em>task source</em> which feeds into the appropriate
- <em>task queue</em>, in the order defined by the <a class="def" href="#glossary-event-order">event order</a> associated with that device. Each operation, such as
- a focus change or composition input, also acts as a <em>task source</em> for the appropriate <em>task queue</em>. The resolution of these event loops is handled
- in a manner conforming to the <a class="def" href="#glossary-host-language">host language</a>, such as HTML [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>].</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_9"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Certain events, such as <q>hotkeys</q> or control keys pressed in a certain sequence, can be
- <q>swallowed</q> by the operating system or the application, interrupting the expected <a class="def" href="#glossary-event-order">event order</a>.</p></div>
- </section>
- </section>
-
- <section id="trusted-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_trusted-events"><span class="secno">3.4 </span>Trusted events</h3>
-
- <p>Events that are generated by the user agent, either as a result of user interaction, or as a direct result of changes to the DOM, are trusted by the user agent
- with privileges that are not afforded to events generated by script through the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a>
- method, modified using the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method, or dispatched via the <a href="#widl-EventTarget-dispatchEvent">
- <code>EventTarget.dispatchEvent()</code></a> method. The <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute of trusted events has a
- value of <code>true</code>, while untrusted events have a <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>.</p>
-
- <p>Most untrusted events <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> trigger <a class="def" href="#glossary-default-action">default actions</a>, with the exception of <a class="eventtype" href="#event-type-click">
- <code>click</code></a> or <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events. These events trigger the <a class="def" href="#glossary-default-action">
- default action</a> of an <a class="def" href="#glossary-activation-trigger">activation trigger</a> (see <a href="#event-flow-activation">Activation triggers and behaviors</a> for more details). These
- untrusted events have an <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>, but still initiate any
- <a class="def" href="#glossary-default-action">default actions</a> for backwards compatibility. All other untrusted events <em class="rfc2119" title="MUST">MUST</em> behave
- as if the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method had been called on that event.</p>
- </section>
-
- <section id="event-flow-activation" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-flow-activation"><span class="secno">3.5 </span>Activation triggers and behavior</h3>
-
- <p>Certain <a class="def" href="#glossary-event-target">event targets</a> (such as a link or button element) <em class="rfc2119" title="MAY">MAY</em> have associated <a class="def" href="#glossary-activation-behavior">
- activation behavior</a> (such a following a link) that implementations perform in response to an <em><a class="def" href="#glossary-activation-trigger">activation
- trigger</a></em> (such as clicking a link).</p>
-
- <p>A <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> indicate which, if any, elements have activation behavior, describe appropriate <a class="def" href="#glossary-activation-trigger">activation triggers</a>, and define the result of that activation behavior. An implementation which supports a <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> initiate these <a class="def" href="#glossary-activation-behavior">activation behavior</a> when the associated
- <a class="def" href="#glossary-activation-trigger">activation trigger</a> occurs.</p>
-
- <div class="example" id="example-activation">
- <div class="example-title"></div>
- <p>Both HTML and SVG have an <code><a></code> element which indicates a link. Relevant <a class="def" href="#glossary-activation-trigger">activation triggers</a> for an <code><a></code> element are a <a class="eventtype" href="#event-type-click"><code>
- click</code></a> event on the text or image content of the <code><a></code> element, or a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>
- event with a <a href="#widl-KeyboardEvent-key">key</a> attribute value of <a href="#key-Enter"><code class="key">'Enter'</code></a> key when the <code><a></code>
- element has focus. The activation behavior for an <code><a></code> element is normally to change the content of the window to the content of the new document,
- in the case of external links, or to reposition the current document relative to the new anchor, in the case of internal links.</p>
- </div>
-
- <p>An <a class="def" href="#glossary-activation-trigger">activation trigger</a> is a user action or an event which indicates to the implementation that an activation
- behavior <em class="rfc2119" title="SHOULD">SHOULD</em> be initiated. User-initiated <a class="def" href="#glossary-activation-trigger">activation triggers</a> include clicking a mouse button on an activatable
- element, pressing the <a href="#key-Enter"><code class="key">'Enter'</code></a> key when an activatable element has focus, or pressing a key that is somehow
- linked to an activatable element (a <q>hotkey</q> or <q>access key</q>) even when that element does not have focus. Event-based <a class="def" href="#glossary-activation-trigger">
- activation triggers</a> <em class="rfc2119" title="MAY">MAY</em> include timer-based events that activate an element at a certain clock time or after a certain time period has elapsed, progress
- events after a certain action has been completed, or many other condition-based or state-based events.</p>
-
- <p>In some cases, a <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="MAY">MAY</em> define attributes or even attribute values which add to or change the native
- <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a> of an element.
- For example, ARIA [<cite><a class="informative" href="#ref-ARIA">ARIA</a></cite>] defines values for the <code class="attr">role</code> attribute that add semantics
- to the element to which it is applied, for purposes of enhanced accessibility. In such cases, if the <a class="def" href="#glossary-host-language">host language</a>
- does not explicitly define the <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation
- behavior</a>, the content author <em class="rfc2119" title="MUST">MUST</em> provide the mechanics of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> (via an event listener)
- or <a class="def" href="#glossary-activation-behavior">activation behavior</a> (such as calling an ECMAScript function) for that element when applying that attribute
- or attribute value.</p>
-
- <section id="click-synthesis" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_click-synthesis"><span class="secno">3.5.1 </span>Activation event synthesis</h4>
-
- <p>If the instance of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> is not an event of <a class="def" href="#glossary-event-type">event
- type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> (that is, when it does not result from a user's activation of a button or link
- using a mouse or equivalent pointing device), the implementation <em class="rfc2119" title="MUST">MUST</em> synthesize and dispatch an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> as one of the <a class="def" href="#glossary-default-action">default actions</a> of that <a class="def" href="#glossary-activation-trigger">activation trigger</a>. The value of the <code class="attribute-name"><a href="#widl-Event-target">Event.target</a></code>
- <em class="rfc2119" title="MUST">MUST</em> be set to the <a class="def" href="#glossary-event-target">event target</a> (normally, the currently focused element), and the event <em class="rfc2119" title="MUST">MUST</em> simulate a <em>left
- click</em> (i.e., the <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>, and the <a href="#widl-MouseEvent-buttons">
- <code>MouseEvent.buttons</code></a> attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>1</code>). Other context information of such a simulated <a class="eventtype" href="#event-type-click">
- <code>click</code></a> event is implementation dependent, but for historical purposes, the interface for the <a class="eventtype" href="#event-type-click"><code>click</code></a>
- event <em class="rfc2119" title="MUST">MUST</em> be the <a href="#interface-MouseEvent"><code>MouseEvent interface</code></a>, regardless of the actual device used to activate the element. Preventing
- the <a class="def" href="#glossary-default-action">default action</a> of the <a class="def" href="#glossary-activation-trigger">activation trigger</a>, such as
- with the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>, <em class="rfc2119" title="MUST">MUST</em> stop the initiation of the <a class="def" href="#glossary-activation-behavior">
- activation behavior</a>.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>When a user activates a hyperlink using a keyboard, such as by focusing the hyperlink element
- and pressing the <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key, a <a class="eventtype" href="#event-type-click"><code>click</code></a> event would be dispatched as the <a class="def" href="#glossary-default-action">default action</a> of the respective
- <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event.</p>
- </div>
-
- <p>Implementations <em class="rfc2119" title="MUST">MUST</em> dispatch the synthesized <a class="eventtype" href="#event-type-click"><code>click</code></a> event as described above even if they do not
- normally dispatch such an event (e.g., when activation is requested by a voice command, since this specification does not address <a class="def" href="#glossary-event-type">
- event types</a> for voice input).</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_10"><span>Note</span></div><p class=""><strong>Note:</strong> 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></div>
- </section>
-
- <section id="events-activation-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-activation-event-order"><span class="secno">3.5.2 </span>Activation event order</h4>
-
- <p>Activation triggers and behavior can be defined in part by the events which are dispatched in a set order relative to one another. The following is the typical
- sequence of events for an element activated by a pointing device (with only pertinent events listed):</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td colspan="2">
- <em>All <a class="def" href="#glossary-default-action">default actions</a>,
- including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
- </td>
- </tr>
- </tbody></table>
-
- <p>The following is the typical sequence of events when a focused element is activated by a key event (with only pertinent events listed):</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td><em class="rfc2119" title="MUST">MUST</em> be a key which can activate the element, such as the
- <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key,
- or the element is not activated</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td><a class="def" href="#glossary-default-action">default action</a>; synthesized; <code>trusted="false"</code></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td colspan="2">
- <em>All <a class="def" href="#glossary-default-action">default actions</a>,
- including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
- </td>
- </tr>
- </tbody></table>
- </section>
- </section>
-
- <section id="event-exceptions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-exceptions"><span class="secno">3.6 </span>Event exceptions</h3>
-
- <p><em>This section is informative.</em></p>
-
- <p>Event operations can throw a <code>DOMException</code> as specified in their method descriptions.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_11"><span>Note</span></div><p class="" id="note-eventexcpetion-removed"><strong>Note:</strong> The exception <em>EventException</em> introduced in <strong class="version">DOM Level 2</strong> is
- removed in this specification as part of this specification's normative support of <a href="#references-WebIDL">Web IDL</a>. <em>EventException</em> formerly defined
- an exception code <code>UNSPECIFIED_EVENT_TYPE_ERR</code> which is replaced in this specification by the use of a <code>DOMException</code> of type
- <code>InvalidStateError</code>.</p></div>
-
- <p>The following <code>DOMException</code> types are used in this specification.</p>
-
- <table class="exceptiontable" summary="Layout table: the first cell contains the name of the DOMException type, the second contains a short description">
- <tbody><tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code><dfn id="dfn-invalidstateerror">InvalidStateError</dfn></code></td>
- <td>Thrown when the <a href="#widl-Event-type"><code>Event.type</code></a> was not specified by initializing the event before <code>dispatchEvent</code> was
- called. Also thrown when the <a href="#interface-Event"><code>Event</code></a> object provided to <code>dispatchEvent</code> is already being dispatched.</td>
- </tr>
- <tr>
- <td><code><dfn id="dfn-notsupportederror">NotSupportedError</dfn></code></td>
- <td>Thrown when <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent()</code></a> is passed an <a href="#interface-Event"><code>Event</code></a>
- interface that the implementation does not support.</td>
- </tr>
- </tbody></table>
- </section>
- </section> <!-- dom-event-architecture -->
-
- <!-- Section 4: Basic Event Interfaces ========================================================-->
- <section id="event-interfaces" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_event-interfaces"><span class="secno">4. </span>Basic Event Interfaces</h2>
-
- <p>The interfaces described in this section are fundamental to DOM Level 3 Events and <em class="rfc2119" title="MUST">MUST</em> always be supported by the implementation.</p>
-
- <p>The event types defined in this specification derive from these basic interfaces, and <em class="rfc2119" title="MUST">MUST</em> inherit all of the attributes, methods, and constants of the interfaces
- they derive from. Event types defined in other specifications <em class="rfc2119" title="MAY">MAY</em> similarly inherit from these basic interfaces or other interfaces defined in this specification,
- or <em class="rfc2119" title="MAY">MAY</em> define their own interfaces. The following chart describes the inheritance structure of interfaces defined in this specification.</p>
-
- <figure class="figure" style="text-align: center" id="fig-graphical-representation-of-the-dom3-events-interface-inheritance">
- <object type="image/svg+xml" data="images/event-inheritance.svg" width="960" height="230">
- <img src="images/event-inheritance.png" alt="Graphical representation of the DOM3 Events interface inheritance" />
- </object>
- <figcaption>Fig. <span class="figno">2</span> <span class="fig-title">Graphical representation of the DOM3 Events interface inheritance</span></figcaption></figure>
-
- <section id="interface-Event" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_interface-Event"><span class="secno">4.1 </span>Interface Event</h3>
-
- <p class="intro-dom">Introduced in DOM Level 2</p>
-
- <p>The <code>Event</code> interface provides basic contextual information about an event to all registered <a class="def" href="#glossary-event-handler">event handlers</a>.
- Specific events can also implement other derived interfaces, for example the <a href="#interface-UIEvent"><code>UIEvent</code></a> and <a href="#interface-MouseEvent">
- <code>MouseEvent</code></a> interfaces.</p>
-
- <p>To create an instance of the <code>Event</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a>
- method call.</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-Event">interface <span class="idlInterfaceID">Event</span> {
-<span class="idlSectionComment"> // PhaseType</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#NONE">NONE</a></span> = <span class="idlConstValue">0</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#CAPTURING_PHASE">CAPTURING_PHASE</a></span> = <span class="idlConstValue">1</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#AT_TARGET">AT_TARGET</a></span> = <span class="idlConstValue">2</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#BUBBLING_PHASE">BUBBLING_PHASE</a></span> = <span class="idlConstValue">3</span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-Event-type">type</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-Event-target">target</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-Event-currentTarget">currentTarget</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-Event-eventPhase">eventPhase</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-bubbles">bubbles</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-cancelable">cancelable</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMTimeStamp</span> <span class="idlAttrName"><a href="#widl-Event-timeStamp">timeStamp</a></span>;</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-stopPropagation-void">stopPropagation</a></span> ();</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-preventDefault-void">preventDefault</a></span> ();</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-initEvent-void-DOMString-eventTypeArg-boolean-bubblesArg-boolean-cancelableArg">initEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">eventTypeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>);</span>
-<span class="idlSectionComment"> // Introduced in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-stopImmediatePropagation-void">stopImmediatePropagation</a></span> ();</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-defaultPrevented">defaultPrevented</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-isTrusted">isTrusted</a></span>;</span>
-};</span></pre><section id="attributes"><h4 aria-level="3" role="heading" id="h4_attributes"><span class="secno">4.1.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-Event-bubbles"><code>bubbles</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Used to indicate whether or not an event is a bubbling event. If the event can bubble the value <em class="rfc2119" title="MUST">MUST</em> be <code>true</code>, otherwise the value <em class="rfc2119" title="MUST">MUST</em> be
- <code>false</code>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-Event-cancelable"><code>cancelable</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Used to indicate whether or not an event can have its <a class="def" href="#glossary-default-action">default action</a> prevented (see also <a href="#event-flow-default-cancel">
- Default actions and cancelable events</a>). If the <a class="def" href="#glossary-default-action">default action</a> can be prevented the value <em class="rfc2119" title="MUST">MUST</em> be <code>true</code>,
- otherwise the value <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_12"><span>Note</span></div><p class=""><strong>Note:</strong> Use <code>Event.defaultPrevented</code> to see whether a cancelable event has beened cancelled or not.</p></div>
- </dd><dt id="widl-Event-currentTarget"><code>currentTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
- <p>Used to retrieve the <a class="def" href="#glossary-current-event-target">current event target</a> whose <a href="#interface-EventListener"><code>EventListeners</code></a>
- are currently being processed. This is particularly useful during the capture and bubbling phases.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd><dt id="widl-Event-defaultPrevented"><code>defaultPrevented</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>Used to indicate whether this event has been cancelled or not. <code>Event.defaultPrevented</code> <em class="rfc2119" title="MUST">MUST</em> return true if both <a href="#widl-Event-cancelable">
- <code>Event.cancelable</code></a> is <code>true</code> and <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> has been called for
- this event. Otherwise this attribute <em class="rfc2119" title="MUST">MUST</em> return <code>false</code>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_13"><span>Note</span></div><p class=""><strong>Note:</strong> Calling <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> after an event has been dispatched will reset
- the internal default-prevented state of the event.</p></div>
- </dd><dt id="widl-Event-eventPhase"><code>eventPhase</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
- <p>Used to indicate the <a href="#event-phase">phase</a> of the event's current propagation path (capture, target, or bubble).
- The event flow phases are defined in <a href="#event-flow">Event dispatch and DOM event flow</a>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code> (<code>NONE</code>).</p>
- </dd><dt id="widl-Event-isTrusted"><code>isTrusted</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>Used to indicate whether this event was generated by the <a class="def" href="#glossary-user-agent">user agent</a> (trusted) or by script (untrusted). See <a href="#trusted-events">trusted events</a> for more details.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-Event-target"><code>target</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
- <p>Used to retrieve the <a class="def" href="#glossary-event-target">event target</a> associated with the <a href="#event-flow">Event dispatch and DOM
- event flow</a>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd><dt id="widl-Event-timeStamp"><code>timeStamp</code> of type <span class="idlAttrType">DOMTimeStamp</span>, readonly </dt><dd>
- <p>Used to specify the time at which the event was created in milliseconds relative to 1970-01-01T00:00:00Z. This value is the <a class="def" href="#glossary-un-initialized-value">
- un-initialized value</a> of this attribute.</p>
- </dd><dt id="widl-Event-type"><code>type</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p>The name of the event type. <a href="#conf-specs">Specifications that define events</a>, <a href="#conf-authors">content authors</a>, and <a href="#conf-author-tools">
- authoring tools</a> <em class="rfc2119" title="MUST">MUST</em> use case-sensitive event type names.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd></dl></section><section id="methods"><h4 aria-level="3" role="heading" id="h4_methods"><span class="secno">4.1.2 </span>Methods</h4><dl class="methods"><dt id="widl-Event-initEvent"><code>initEvent</code></dt><dd>
- <p>Initializes attributes of an <code>Event</code>. The <code>Event</code> could have been created through the <a href="#widl-DocumentEvent-createEvent">
- <code>DocumentEvent.createEvent</code></a> method or by the implementation in response to a user action. For any <code>Event</code> created with the
- <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent</code></a> method, this method <em class="rfc2119" title="MUST">MUST</em> be called before the <code>Event</code>
- is dispatched via the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. If the method is called several
- times before invoking <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, only the final invocation takes precedence.
- If this method is called during an invocation of <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, this method
- <em class="rfc2119" title="MUST">MUST</em> do nothing and return immediately. 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 <em class="rfc2119" title="MUST">MUST</em> also reset the event object's internal-propagation and default-action-prevention states. This allows an event object to be "reset"
- before being dispatched multiple times.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>If an <code>EventListener</code> called <code>stopPropagation()</code> or <code>stopImmediatePropagation()</code> during
- the event's previous dispatch, then after calling this method, the event can be re-dispatched (via <code>dispatchEvent</code>) and will propagate through all candidate
- event listeners along its propagation path (as it did during the prior dispatch). Similarily, if an <code>EventListener</code> called <code>preventDefault()</code>
- during the event's previous dispatch, then after calling this method, the event's <code>defaultPrevented</code> property will be <code>false</code>.</p>
- </div>
-
- <p class="warning" id="warning-initEvent-untrusted"><strong>Warning!</strong> For security reasons, events modified using <a href="#widl-Event-initEvent"><code>
- Event.initEvent()</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute value of <code>false</code>.
- See <a href="#trusted-events">trusted events</a> for more details.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_14"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> <a class="def" href="#trusted-events">Trusted events</a> can have their <a class="def" href="#glossary-event-type">
- event type</a> and other attributes changed using this method. However, this method always converts the <code>Event</code> from a trusted event to an untrusted
- event (e.g., the <a href="#widl-Event-isTrusted"><code>Event.isTrusted</code></a> attribute will return <code>false</code>).</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_15"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> <a class="def" href="#trusted-events">Trusted events</a> are pre-initialized by the implementation before being dispatched.
- As a result, it is not necessary to call <code>Event.initEvent()</code> prior to re-dispatching the trusted event--however calling <a href="#widl-EventTarget-dispatchEvent">
- <code>EventTarget.dispatchEvent()</code></a> will convert the <code>Event</code> from a trusted event to an untrusted event (e.g., the <a href="#widl-Event-isTrusted">
- <code>Event.isTrusted</code></a> attribute will return <code>false</code>).</p></div>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">eventTypeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-Event-type"><code>Event.type</code></a>, the name of the event type.</p>
- </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a>. This parameter overrides the intrinsic bubbling behavior of the event.</p>
- </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-Event-cancelable"><code>Event.cancelable</code></a>. This parameter overrides the intrinsic cancelable behavior of the event.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-preventDefault"><code>preventDefault</code></dt><dd>
- <p>When this method is invoked, the event <em class="rfc2119" title="MUST">MUST</em> be canceled, meaning any <a class="def" href="#glossary-default-action">default actions</a> normally taken by the implementation
- as a result of the event <em class="rfc2119" title="MUST NOT">MUST NOT</em> occur (see also <a href="#event-flow-default-cancel">Default actions and cancelable events</a>). Default actions which occur prior
- to the event's dispatch (see <a href="#event-flow-default-cancel">Default actions and cancelable events</a>) are reverted. Calling this method for a non-cancelable
- event <em class="rfc2119" title="MUST">MUST</em> have no effect. If an event has more than one <a class="def" href="#glossary-default-action">default action</a>, each cancelable <a class="def" href="#glossary-default-action">
- default action</a> <em class="rfc2119" title="MUST">MUST</em> be canceled.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_16"><span>Note</span></div><p class=""><strong>Note:</strong> This method does not stop the event propagation — use <a href="#widl-Event-stopPropagation">
- <code>Event.stopPropagation()</code></a> or <a href="#widl-Event-stopImmediatePropagation"><code>Event.stopImmediatePropagation()</code></a> for that effect.</p></div>
- <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-stopImmediatePropagation"><code>stopImmediatePropagation</code></dt><dd>
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>Prevents all other <a class="def" href="#glossary-event-handler">event listeners</a> from being triggered for this event dispatch, <strong>including</strong> any remaining
- <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>. Once it has been called, further calls to this method have no additional
- effect.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_17"><span>Note</span></div><p class=""><strong>Note:</strong> This method does not prevent the <a class="def" href="#glossary-default-action">default action</a> from being invoked —
- use <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> for that effect.</p></div>
- <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-stopPropagation"><code>stopPropagation</code></dt><dd>
- <p>Prevents all other <a class="def" href="#glossary-event-handler">event listeners</a> from being triggered for this event dispatch, <strong>excluding</strong> any remaining <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>. Once it has been called, further calls to this method have no additional effect.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_18"><span>Note</span></div><p class="" id="note-stopPropagation-default"><strong>Note:</strong> This method does not prevent the <a class="def" href="#glossary-default-action">default action</a>
- from being invoked — use <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> for that effect.</p></div>
- <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd></dl></section><section id="constants"><h4 aria-level="3" role="heading" id="h4_constants"><span class="secno">4.1.3 </span>Constants</h4><dl class="constants"><dt id="widl-Event-AT_TARGET"><code>AT_TARGET</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The current event is in the <a class="def" href="#glossary-target-phase">target phase</a>, i.e., it is being evaluated at the <a class="def" href="#glossary-event-target">event target</a>.</p>
- </dd><dt id="widl-Event-BUBBLING_PHASE"><code>BUBBLING_PHASE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The current event phase is the <a class="def" href="#glossary-bubbling-phase">bubbling phase</a>.</p>
- </dd><dt id="widl-Event-CAPTURING_PHASE"><code>CAPTURING_PHASE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The current event phase is the <a class="def" href="#glossary-capture-phase">capture phase</a>.</p>
- </dd><dt id="widl-Event-NONE"><code>NONE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The current event is not being dispatched, i.e., the <a href="#widl-Event-eventPhase">Event.eventPhase</a> is being observered prior to
- calling <a href="#widl-EventTarget-dispatchEvent">EventTarget.dispatchEvent()</a> or following the completion of the
- <a class="def" href="#glossary-phase">event phases</a> of a given <code>Event</code>.</p>
- </dd></dl></section>
- </section><!-- Event -->
-
- <section id="interface-CustomEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_interface-CustomEvent"><span class="secno">4.2 </span>Interface CustomEvent</h3>
-
- <p class="intro-dom">Introduced in DOM Level 2</p>
-
- <p>The <a href="#interface-CustomEvent"><code>CustomEvent</code></a> interface is the <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> interface for application-specific event types. Unlike the <a href="#interface-Event">
- <code>Event</code></a> interface, it allows applications to provide contextual information about the event type.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_19"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Use a prefix string on the event type name for application-specific event types to avoid clashes with future general-purpose
- event types.</p></div>
-
- <p>To create an instance of the <code>CustomEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("CustomEvent")</code></a>
- method call.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_20"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
- CustomEvent objects.</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-CustomEvent">interface <span class="idlInterfaceID">CustomEvent</span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">any</span> <span class="idlAttrName"><a href="#widl-CustomEvent-detail">detail</a></span>;</span>
-};</span></pre><section id="attributes-1"><h4 aria-level="3" role="heading" id="h4_attributes-1"><span class="secno">4.2.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-CustomEvent-detail"><code>detail</code> of type <span class="idlAttrType">any</span>, readonly </dt><dd>
- <p>Specifies some detail information about the <a href="#interface-Event"><code>Event</code></a>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd></dl></section>
- </section><!-- CustomEvent -->
-
- <section id="interface-EventTarget" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_interface-EventTarget"><span class="secno">4.3 </span>Interface EventTarget</h3>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The <code>EventTarget</code> interface allows registration and removal of event listeners, and dispatch of events to an event target.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_21"><span>Note</span></div><p class=""><strong>Note:</strong> Though an event listener can be registered for any <a class="def" href="#glossary-event-target">event
- target</a> node, the user agent only dispatches UA-generated (trusted) events on node types that are defined as event target types for that specific event type
- (see the <a href="#event-types-list">List of DOM3 Event Types</a>). For example, a <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>
- event type registered on a text node will never be fired by the user agent, though a content author could dispatch an event of that type on the text node via script.</p></div>
-
- <p>When used with the DOM event flow, this interface <em class="rfc2119" title="MUST">MUST</em> be implemented by all <a class="def" href="#glossary-event-target">event targets</a> 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>removeEventListener</code>) repeatedly on the same <code>EventTarget</code> with the same values for the parameters
- <code>type</code>, <code>listener</code>, and <code>useCapture</code> has no effect. Doing so does not cause the event listener to be registered more than once and
- does not cause a change in the triggering order.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_22"><span>Note</span></div><p class=""><strong>Note:</strong> In addition to the <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a> method, some
- <a class="def" href="#glossary-host-language">host languages</a> allow a content author to register event listeners by the use of attributes, e.g.,
- <code>onclick="handleClick()"</code> (see [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] for further examples). Due to the
- language-specific details, this type of event listener registration is not defined in this specification. In general, many event types can be used as an attribute
- in this way by adding the prefix <em><code>on-</code></em> to the event type name. Dispatching events to these listeners is expected to behave consistently with the
- event registration and propagation defined in this specification, with the same interfaces, properties, and methods.</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-EventTarget">interface <span class="idlInterfaceID">EventTarget</span> {
-<span class="idlSectionComment"> // Modified in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventTarget-addEventListener-void-DOMString-type-EventListener-listener-boolean-useCapture">addEventListener</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">type</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventListener" class="idlType"><code>EventListener</code></a>?</span> <span class="idlParamName">listener</span></span>, <span class="idlParam">optional <span class="idlParamType">boolean</span> <span class="idlParamName">useCapture</span> = <span class="idlDefaultValue">false</span></span>);</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventTarget-removeEventListener-void-DOMString-type-EventListener-listener-boolean-useCapture">removeEventListener</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">type</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventListener" class="idlType"><code>EventListener</code></a>?</span> <span class="idlParamName">listener</span></span>, <span class="idlParam">optional <span class="idlParamType">boolean</span> <span class="idlParamName">useCapture</span> = <span class="idlDefaultValue">false</span></span>);</span>
-<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-EventTarget-dispatchEvent-boolean-Event-event">dispatchEvent</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlParamName">event</span></span>);</span>
-};</span></pre><section id="methods-1"><h4 aria-level="3" role="heading" id="h4_methods-1"><span class="secno">4.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-EventTarget-addEventListener"><code>addEventListener</code></dt><dd>
- <p><em>Modified in DOM Level 3</em></p>
-
- <p>Registers an event listener on the <a href="#interface-EventTarget"><code>EventTarget</code></a>. The listener is registered for the capture phase if the
- <code>useCapture</code> parameter is <code>true</code>, and for the bubble phase otherwise. When the event reaches the target element, listeners for both
- the capture and bubble phases are triggered as part of the target phase.
- </p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">type</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies the <a href="#widl-Event-type"><code>Event.type</code></a> associated with the event for which the user is registering.</p>
- </td></tr><tr><td class="prmName">listener</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>If non-null, the <code>listener</code> parameter <em class="rfc2119" title="MUST">MUST</em> be an object that implements the
- <a href="#interface-EventListener"><code>EventListener</code></a> interface or a function.
- If <code>listener</code> is a function then it <em class="rfc2119" title="MUST">MUST</em> be used as the callback for the event.
- Otherwise, if <code>listener</code> implements
- <a href="#interface-EventListener"><code>EventListener</code></a>, then its
- <a href="#widl-EventListener-handleEvent">handleEvent</a> method <em class="rfc2119" title="MUST">MUST</em> be used as the callback.
- </p>
- </td></tr><tr><td class="prmName">useCapture</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptTrue"><span role="img" aria-label="True">✔</span></td><td class="prmDesc">
- <p>If true, <code>useCapture</code> indicates that the user wishes to add the event listener for the <a class="def" href="#glossary-capture-phase">capture</a>
- and <a class="def" href="#glossary-target-phase">target</a> phases only, i.e., this event listener will not be triggered during the <a class="def" href="#glossary-bubbling-phase"> bubbling</a> phase. If <code>false</code>, the event listener <em class="rfc2119" title="MUST">MUST</em> only be triggered during the <a class="def" href="#glossary-target-phase">target</a> and <a class="def" href="#glossary-bubbling-phase">bubbling</a> phases.</p>
-
- <p>This parameter <em class="rfc2119" title="MUST">MUST</em> be optional. If not provided, the <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a> method <em class="rfc2119" title="MUST">MUST</em> behave as if
- <code class="parameter-name">useCapture</code> was specified to be <code>false</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_23"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> The <code class="parameter-name">useCapture</code> parameter was mandatory in
- DOM2 Events [<a href="#references-DOM2Events">DOM2 Events</a>], and omitting this parameter could cause an error in older implementations.</p></div>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-EventTarget-dispatchEvent"><code>dispatchEvent</code></dt><dd>
- <p><em>Modified in DOM Level 3</em></p>
-
- <p>Dispatches an event into the implementation's event model. The <a class="def" href="#glossary-event-target">event target</a> of the event <em class="rfc2119" title="MUST">MUST</em> be the <code>EventTarget</code>
- object on which <code>dispatchEvent</code> is called.</p>
-
- <p>If after the event object finishes propagating through the DOM event flow its <a href="#widl-Event-defaultPrevented"><code>Event.defaultPrevented</code></a>
- attribute is <code>false</code>, then this method returns <code>true</code>. Otherwise this method returns <code>false</code>.</p>
-
- <p class="warning"><strong>Warning!</strong> For security reasons, events dispatched using <a href="#widl-EventTarget-dispatchEvent">
- <code>EventTarget.dispatchEvent()</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute value
- of <code>false</code>. See <a href="#trusted-events">trusted events</a> for more details.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_24"><span>Note</span></div><p class=""><strong>Note:</strong> While a dispatch (triggered by <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a>) is in progress, calls to
- <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> are ignored (the method returns immediately without side-effects) and calls to
- <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> result in an exception.</p></div>
-
-
-
- <p><strong>Exceptions:</strong>
- If the <a href="#widl-Event-type"><code>Event.type</code></a> was not specified by initializing the event before <code>dispatchEvent</code> was called OR
- the <a href="#interface-Event"><code>Event</code></a> object is already being dispatched, a <code>DOMException</code> of type <em><code>InvalidStateError</code></em>
- is thrown.</p>
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">event</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>The event to be dispatched.</p>
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_25"><span>Note</span></div><p class=""><strong>Note: </strong>This parameter receives an <code>Event</code> object, or any object that inherits from <code>Event</code>, e.g.,
- <a href="#interface-MouseEvent"><code>MouseEvent</code></a>,
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>,
- <code>MutationEvent</code>, etc.</p></div>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-EventTarget-removeEventListener"><code>removeEventListener</code></dt><dd>
- <p><em>Modified in DOM Level 3</em></p>
-
- <p>Removes an event listener. Calling <code>removeEventListener</code> with arguments that do not identify any currently registered <a href="#interface-EventListener"><code>
- EventListener</code></a> on the <code>EventTarget</code> has no effect. </p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">type</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies the <a href="#widl-Event-type"><code>Event.type</code></a> for which the user registered the event listener.</p>
- </td></tr><tr><td class="prmName">listener</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>The <a href="#interface-EventListener"><code>EventListener</code></a> to be removed.</p>
- </td></tr><tr><td class="prmName">useCapture</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptTrue"><span role="img" aria-label="True">✔</span></td><td class="prmDesc">
- <p>Specifies whether the <a href="#interface-EventListener"><code>EventListener</code></a> being removed was registered for the capture phase or not. Implementations
- <em class="rfc2119" title="MUST">MUST</em> treat the same listener that was registered twice with both <code>useCapture</code> true and <code>useCapture</code> false as independent registrations, and
- remove them independently.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_26"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> If a listener was registered twice, once for the capture and target phases and once for the target and bubbling phases,
- this represents two unique registrations. Removal of an event listener registered for the capture and target phases does not affect the same event listener registered
- for the target and bubbling phases, and vice versa.</p></div>
-
- <p>This parameter <em class="rfc2119" title="MUST">MUST</em> be optional. If not provided, the <a href="#widl-EventTarget-removeEventListener">EventTarget.removeEventListener</a> method <em class="rfc2119" title="MUST">MUST</em> behave as if
- <code class="parameter-name">useCapture</code> were specified to be <code>false</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_27"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> The <code class="parameter-name">useCapture</code> parameter was mandatory in
- DOM2 Events [<a href="#references-DOM2Events">DOM2 Events</a>], and omitting this parameter could cause an error in older implementations.</p></div>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section><!-- EventTarget -->
-
- <section id="interface-EventListener" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_interface-EventListener"><span class="secno">4.4 </span>Interface EventListener</h3>
-
- <p class="intro-dom">Introduced in DOM Level 2</p>
-
- <p>The <code>EventListener</code> interface is the primary way to handle events. <code>EventListener</code> represents the callback object that the user agent will
- invoke when dispatching an <code>Event</code> to an <a href="#widl-EventTarget"><code>EventTarget</code></a>.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_28"><span>Note</span></div><p class=""><strong>Note:</strong> Authors define an object which implements the <code>EventListener</code> interface and register their event listener using <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a>. In JavaScript, an <code>EventListener</code> can be either a function or an object
- with a <code>handleEvent</code> member function.</p></div>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_29"><span>Note</span></div><p class=""><strong>Note:</strong> It is a best practice for authors to remove their <code>EventListener</code> from its <a href="#widl-EventTarget"><code>EventTarget</code></a>
- after they have completed using the listener.</p></div>
-
- <p>Copying a <code>Node</code>, with methods such as <code>Node.cloneNode</code> or <code>Range.cloneContents</code> [<cite><a class="informative" href="#references-DOMRange">DOM Range</a></cite>], <em class="rfc2119" title="MUST NOT">MUST NOT</em> copy the event listeners attached to it.
- Event listeners can be attached to the newly created <code>Node</code> afterwards, if so desired.</p>
-
- <p>Moving a <code>Node</code>, with methods such as <code>Document.adoptNode</code>, <code>Node.appendChild</code>, or <code>Range.extractContents</code>
- [<cite><a class="informative" href="#references-DOMRange">DOM Range</a></cite>], <em class="rfc2119" title="MUST NOT">MUST NOT</em> cause the event listeners attached to it to be removed or un-registered.</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-EventListener">interface <span class="idlInterfaceID">EventListener</span> {
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventListener-handleEvent-void-Event-event">handleEvent</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlParamName">event</span></span>);</span>
-};</span></pre><section id="methods-2"><h4 aria-level="3" role="heading" id="h4_methods-2"><span class="secno">4.4.1 </span>Methods</h4><dl class="methods"><dt id="widl-EventListener-handleEvent"><code>handleEvent</code></dt><dd>
- <p>This method <em class="rfc2119" title="MUST">MUST</em> be called whenever an event occurs of the event type for which the <code>EventListener</code> interface was registered.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">event</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>The <a href="#interface-Event"><code>Event</code></a> contains contextual information about the <a class="def" href="#glossary-event">event</a>.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section><!-- EventListener -->
-
- <section id="interface-DocumentEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_interface-DocumentEvent"><span class="secno">4.5 </span>Interface DocumentEvent</h3>
-
- <p class="intro-dom">Introduced in DOM Level 2</p>
-
- <p>The <code>DocumentEvent</code> interface provides a mechanism by which the user can create an <a href="#interface-Event"><code>Event</code></a> object of a type supported
- by the implementation. The <code>DocumentEvent</code> interface <em class="rfc2119" title="MUST">MUST</em> be implemented on the same object that implements the <code>Document</code> interface.</p>
-
- <pre class="idl"><span class="idlImplements"><a href="#dfn-document" class="internalDFN">Document</a> implements <a href="#idl-def-DocumentEvent" class="idlType"><code>DocumentEvent</code></a>;</span></pre><div class="idlImplementsDesc">
- </div>
-
- <!-- NOTE: This is preserved as a [NoInterfaceObject] definition (rather than a partial interface Document { ..} because SVG also needs to implement this interface on their SVGSVGElement interface -->
- <pre class="idl"><span class="idlInterface" id="idl-def-DocumentEvent">[<span class="extAttr">NoInterfaceObject</span>]
-interface <span class="idlInterfaceID">DocumentEvent</span> {
-<span class="idlMethod"> <span class="idlMethType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlMethName"><a href="#widl-DocumentEvent-createEvent-Event-DOMString-eventInterface">createEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">eventInterface</span></span>);</span>
-};</span></pre><section id="methods-3"><h4 aria-level="3" role="heading" id="h4_methods-3"><span class="secno">4.5.1 </span>Methods</h4><dl class="methods"><dt id="widl-DocumentEvent-createEvent"><code>createEvent</code></dt><dd>
- <p class="intro-dom">Modified in DOM Level 3</p>
-
- <p>Creates an event object of the type specified. Returns the newly created object.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_30"><span>Note</span></div><p class=""><strong>Note: </strong>After calling <code>createEvent</code>, and prior to dispatching the event with the
- <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method, the
- <a href="#interface-Event"><code>Event</code></a> will need to be initialized with the appropriate event initialization
- method (e.g., <code>initEvent</code>, <code>initMouseEvent</code>, etc.) in order to associate it with an event type and related values.</p></div>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A content author wishing to synthesize some kind of <a href="#interface-UIEvent"><code>UIEvent</code></a>
- would invoke <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("UIEvent")</code></a>. The <a href="#widl-UIEvent-initUIEvent"><code>
- UIEvent.initUIEvent()</code></a> method could then be called on the newly created <a class="noxref" href="#interface-UIEvent"><code>UIEvent</code></a> object to
- set the specific type of user interface event to be dispatched, <a class="eventtype" href="#event-type-scroll"><code>scroll</code></a> for example, and set its
- context information, e.g., <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>.</p>
- </div>
-
- <p class="warning"><strong>Warning!</strong> For security reasons, events generated using <a href="#widl-DocumentEvent-createEvent">
- <code>DocumentEvent.createEvent("Event")</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute
- value of <code>false</code>. See <a href="#trusted-events">trusted events</a> for more details.</p>
-
- <p><strong>Exceptions:</strong>
- If the implementation does not support the <a href="#interface-Event"><code>Event</code></a> interface requested, a <code>DOMException</code> of type <em><code>NotSupportedError</code></em>
- is thrown.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">eventInterface</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>The <code>eventInterface</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.</p>
-
- <p>For backward compatibility, the following case-insensitive feature names are valid values for the parameter <code>eventInterface</code>:</p>
-
- <table class="data-table" summary="The first column contains the feature name, the second contains the resulting event interface returned by createEvent">
- <tbody><tr>
- <th>Legacy feature name</th>
- <th>Resulting event interface</th>
- </tr>
- <tr>
- <td><code>"Events"</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- </tr>
- <tr>
- <td><code>"HTMLEvents"</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- </tr>
- <tr>
- <td><code>"UIEvents"</code></td>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- </tr>
- <tr>
- <td><code>"MouseEvents"</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <td><code>"MutationEvents"</code></td>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- </tbody></table>
-
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section><!-- DocumentEvent -->
-
- </section> <!-- event-interfaces -->
-
- <!-- Section 5: The Events ========================================================-->
- <section id="events-module" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_events-module"><span class="secno">5. </span>Events Module</h2>
-
- <section id="event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-types"><span class="secno">5.1 </span>Event Types</h3>
- <p>Each event <em class="rfc2119" title="MUST">MUST</em> be associated with a type, called <em>event type</em> and available as the <a href="#widl-Event-type"><code class="interface-attribute">type</code></a>
- attribute on the event object. The event type <em class="rfc2119" title="MUST">MUST</em> be of type <code>DOMString</code>.</p>
-
- <section id="event-types-list" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_event-types-list"><span class="secno">5.1.1 </span>List of DOM3 Event Types</h4>
- <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, or voice), these event
- types can be generated by the implementation. When used with an [<cite><a class="informative" href="#references-XML">XML 1.0</a></cite>] or
- [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] application, the specifications of those languages <em class="rfc2119" title="MAY">MAY</em> restrict the
- semantics and scope (in particular the possible <a class="def" href="#glossary-event-target">event targets</a>) 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 an informative summary of the event types defined in this specification.</p>
-
- <table class="data-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.">
- <tbody><tr>
- <th>Event Type</th>
- <th>Sync / Async</th>
- <th>Bubbling phase</th>
- <th>Trusted event target types</th>
- <th>DOM interface</th>
- <th>Cancelable</th>
- <th>Default Action</th>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-abort"><code>abort</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code>, <code>Element</code></td>
- <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- <td>Yes</td>
- <td>Show a <a class="def" href="#glossary-text-composition-system">text composition system</a> candidate window</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-error"><code>error</code></a></td>
- <td>Async</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code>, <code>Element</code></td>
- <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- <td>Yes</td>
- <td>Varies:
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and <a class="eventtype" href="#event-type-input"><code>input</code></a> events;
- launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
- <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
- <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event;
- <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
- other event</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-load"><code>load</code></a></td>
- <td>Async</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td>Varies: start a drag/drop operation; start a text selection; start a scroll/pan interaction (in combination with the middle mouse button, if supported)</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- <td>Yes</td>
- <td>Invoke a context menu (in combination with the right mouse button, if supported)</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-resize"><code>resize</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code></td>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-scroll"><code>scroll</code></a></td>
- <td>Async</td>
- <td><abbr title="Number, Other">No</abbr> / <a href="#scroll-document">Yes</a></td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-select"><code>select</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-unload"><code>unload</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-Event"><code>Event</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-wheel"><code>wheel</code></a></td>
- <td>Async</td>
- <td>Yes</td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-WheelEvent"><code>WheelEvent</code></a></td>
- <td>Yes</td>
- <td>Scroll (or zoom) the document</td>
- </tr>
- </tbody></table>
-
- <p>For a list of events which are deprecated in this specification, see the <a href="#legacy-event-types">Legacy Event Types</a> appendix
- at the end of this document.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The following is one way to interpret the above tables: the <a class="eventtype" href="#event-type-load"><code>load</code></a> event will
- trigger event listeners attached on <code>Element</code> nodes for that event and on the capture and target phases. This event is not cancelable. If an event listener for the
- <a class="eventtype" href="#event-type-load"><code>load</code></a> event is attached to a node other than <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>,
- <code>Document</code>, or <code>Element</code> nodes, or if it is attached to the bubbling phase only, this event listener would not be triggered.</p>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_31"><span>Note</span></div><p class=""><strong>Note: </strong>Don't interpret the above tables as definitive for the listed event types. For example, the <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a> event is used in other
- specifications, for example, in XMLHttpRequest. Similarly, <a href="#widl-EventTarget-dispatchEvent"><code>dispatchEvent</code></a> can be used to dispatch untrusted events to
- listeners on <strong>any</strong> object that also implements <a href="#interface-EventTarget"><code>EventTarget</code></a>.</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_32"><span>Note</span></div><p class=""><strong>Note: </strong>The event objects associated with the event types described above contain additional context information--refer to the description of the DOM
- interfaces for further information.</p></div>
- </section>
- </section>
-
- <section id="event-definitions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_event-definitions"><span class="secno">5.2 </span>Event Module Definitions</h3>
- <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 in the future.
- This document does 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>
-
- <section id="events-uievents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-uievents"><span class="secno">5.2.1 </span>User Interface Event Types</h4>
- <p>The User Interface event module contains basic event types associated with user interfaces and document manipulation.</p>
-
- <section id="interface-UIEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-UIEvent">Interface UIEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 2</p>
-
- <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 <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("UIEvent")</code></a>
- method call.</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-UIEvent">interface <span class="idlInterfaceID">UIEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">AbstractView?</span> <span class="idlAttrName"><a href="#widl-UIEvent-view">view</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-UIEvent-detail">detail</a></span>;</span>
-};</span></pre><section><h6 id="attributes-2" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-UIEvent-detail"><code>detail</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
- <p>Specifies some detail information about the <a href="#interface-Event"><code>Event</code></a>, depending on the type of event.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-UIEvent-view"><code>view</code> of type <span class="idlAttrType">AbstractView</span>, readonly , nullable</dt><dd>
- <p>The <code>view</code> attribute identifies the <code>AbstractView</code> from which the event was generated.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd></dl></section>
- </section>
-
- <p>The User Interface event types are listed below. Some of these events use the <a href="#interface-UIEvent"><code>UIEvent</code></a> interface if generated from a
- user interface, but the <a href="#interface-Event"><code>Event</code></a> interface otherwise, as detailed in each event.</p>
-
- <!-- load -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-load"><dfn id="dfn-load"><a class="eventtype" href="#event-type-load"><code>load</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>load</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Async</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- common object whose contained resources have loaded</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM implementation finishes loading the resource (such as the document)
- and any dependent resources (such as images, style sheets, or scripts). Dependent resources that fail to load <em class="rfc2119" title="MUST NOT">MUST NOT</em> prevent this event from firing if the resource
- that loaded them is still accessible via the DOM. If this event type is dispatched, implementations are <em class="rfc2119" title="REQUIRED">REQUIRED</em> to dispatch this event at least on the <code>Document</code>
- node.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_33"><span>Note</span></div><p class=""><strong>Note:</strong> For legacy reasons, <a class="eventtype" href="#event-type-load"><code>load</code></a> events for resources inside
- the document (e.g., images) do not include the <a class="def" href="#glossary-defaultView">defaultView</a> in the propagation path in HTML implementations. See
- [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] for more information.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- unload -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-unload"><dfn id="dfn-unload"><a class="eventtype" href="#event-type-unload"><code>unload</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>unload</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- common object whose contained resources have been removed</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM Implementation removes from the environment the resource (such
- as the document) or any dependent resources (such as images, style sheets, scripts). The document <em class="rfc2119" title="MUST">MUST</em> be unloaded after the dispatch of this event type. If this
- event type is dispatched, implementations are <em class="rfc2119" title="REQUIRED">REQUIRED</em> to dispatch this event at least on the <code>Document</code> node.</p>
- </dd>
- </dl>
- </div>
-
- <!-- abort -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-abort"><dfn id="dfn-abort"><a class="eventtype" href="#event-type-abort"><code>abort</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>abort</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element whose resources have been stopped from loading without error</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the loading of a resource has been aborted, such as by a user canceling
- the load while it is still in progress.</p>
- </dd>
- </dl>
- </div>
-
- <!-- error -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-error"><dfn id="dfn-error"><a class="eventtype" href="#event-type-error"><code>error</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>error</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Async</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element whose resources have been stopped from loading due to an error</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a resource failed to load, or has been loaded but cannot be interpreted
- according to its semantics, such as an invalid image, a script execution error, or non-well-formed XML.</p>
- </dd>
- </dl>
- </div>
-
- <!-- select -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-select"><dfn id="dfn-select"><a class="eventtype" href="#event-type-select"><code>select</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>select</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element whose text content has been selected</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a user selects some text. This event is dispatched after the selection
- has occurred.</p>
-
- <p>This specification does not provide contextual information to access the selected text. Where applicable, a <a class="def" href="#glossary-host-language">host
- language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> define rules for how a user <em class="rfc2119" title="MAY">MAY</em> select content (with consideration for international language conventions), at what point the <a class="eventtype" href="#event-type-select"><code>select</code></a> event is dispatched, and how a content author <em class="rfc2119" title="MAY">MAY</em> access the user-selected content.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_34"><span>Note</span></div><p class=""><strong>Note:</strong> In order to access to user-selected content, content authors will use native capabilities of the <a class="def" href="#glossary-host-language">host languages</a>, such as the <code>Document.getSelection()</code> method of the <a href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections">
- HTML Editing APIs</a> [<cite><a class="informative" href="#references-HTMLEd">HTML Editing</a></cite>].</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_35"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-select"><code>select</code></a> event might not be available
- for all elements in all languages. For example, in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>], <a class="eventtype" href="#event-type-select">
- <code>select</code></a> events can be dispatched only on form <code>input</code> and <code>textarea</code> elements. Implementations can dispatch <a class="eventtype" href="#event-type-select"><code>select</code></a> events in any context deemed appropriate, including text selections outside of form controls, or image or
- markup selections such as in SVG.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- resize -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-resize"><dfn id="dfn-resize"><a class="eventtype" href="#event-type-resize"><code>resize</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>resize</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- object which has been resized</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a document view has been resized. This event type is dispatched after
- all effects for that occurrence of resizing of that particular <a class="def" href="#glossary-event-target">event target</a> have been executed by the <a class="def" href="#glossary-user-agent">user agent</a>.</p>
-
- <p><a class="def" href="#glossary-user-agent">User agents</a> which support continuous reflow of the document's layout during user-initiated resizing <em class="rfc2119" title="MUST">MUST</em> dispatch
- this event synchronously after each reflow of the document.</p>
-
- <p>The <a class="def" href="#glossary-defaultView"><code>defaultView</code></a> object <em class="rfc2119" title="SHOULD">SHOULD</em> always be resizable. A <a class="def" href="#glossary-host-language">
- host language</a> <em class="rfc2119" title="MAY">MAY</em> define certain elements to be resizable, and under what conditions (e.g., specific elements like <code><iframe></code>, or elements
- with particular characteristics like width and height). However, this specification does not define the behavior for elements.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_36"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-resize"><code>resize</code></a> event is distinct from the
- SVG <code class="eventtype">zoom</code> event types, though both can occur at the same time, or as the consequence of the same user action. In particular, browser
- <q>font zooming</q> or <q>page zooming</q> will not necessarily trigger a <a class="eventtype" href="#event-type-resize"><code>resize</code></a> event.</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_37"><span>Note</span></div><p class=""><strong>Note:</strong> In previous DOM Events specifications, the <a class="eventtype" href="#event-type-resize"><code>resize</code></a>
- event type was defined to have a <a class="def" href="#glossary-bubbling-phase">bubbling phase</a>, but for performance reasons, this was not implemented in most
- user agents, and this specification removes the <a class="def" href="#glossary-bubbling-phase">bubbling phase</a> for this event.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- scroll -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-scroll"><dfn id="dfn-scroll"><a class="eventtype" href="#event-type-scroll"><code>scroll</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>scroll</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Async</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr> / <a href="#scroll-document">Yes</a></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- object which has been scrolled</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a document view or an element has been scrolled. This event type is dispatched
- after the scroll has occurred.</p>
-
- <p id="scroll-document">When dispatched on the <code>Document</code> element, this event type <em class="rfc2119" title="MUST">MUST</em> bubble to the <a class="def" href="#glossary-defaultView"><code>
- defaultView</code></a> object.</p>
- </dd>
- </dl>
- </div>
- </section>
-
- <section id="events-focusevent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-focusevent"><span class="secno">5.2.2 </span>Focus Event Types</h4>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_38"><span>Note</span></div><p class=""><strong>Note:</strong> This interface and its associated event types and <a href="#events-focusevent-event-order">focus event
- order</a> were designed in accordance to the concepts and guidelines defined in <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/">User Agent Accessibility
- Guidelines 2.0</a> [<a href="#references-UAAG2">UAAG 2.0</a>], with particular attention on the <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/#gl-focus-mechanism">
- focus mechanism</a> and the terms defined in the <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/#def-focus">glossary entry for focus</a>.</p></div>
-
- <section id="interface-FocusEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-FocusEvent">Interface FocusEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The <code>FocusEvent</code> interface provides specific contextual information associated with Focus events.</p>
-
- <p>
- To create an instance of the <code>FocusEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("FocusEvent")</code></a>
- method call.
- </p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_39"><span>Note</span></div><p class="">
- <strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
- FocusEvent objects.
- </p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-FocusEvent">interface <span class="idlInterfaceID">FocusEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-FocusEvent-relatedTarget">relatedTarget</a></span>;</span>
-};</span></pre><section><h6 id="attributes-3" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-FocusEvent-relatedTarget"><code>relatedTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
- <p>Used to identify a secondary <a href="#widl-EventTarget"><code>EventTarget</code></a> related to a Focus event, depending on the type of event.</p>
-
- <p>For security reasons with nested browsing contexts, when tabbing into or out of a nested context, the relevant EventTarget <em class="rfc2119" title="SHOULD">SHOULD</em> be <code>null</code>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd></dl></section>
- </section>
-
- <section id="events-focusevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-focusevent-event-order">Focus Event Order</h5>
- <p>
- The focus events defined in this specification occur in a set order relative to one another. The following is the typical sequence of events when a focus is shifted
- between elements (this order assumes that no element is initially focused):</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User shifts focus</em></td>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
- <td>Sent before first target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
- <td>Sent after first target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User shifts focus</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
- <td>Sent before first target element loses focus</td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
- <td>Sent before second target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
- <td>Sent after first target element loses focus</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
- <td>Sent after second target element receives focus</td>
- </tr>
- </tbody></table>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_40"><span>Note</span></div><p class=""><strong>Note:</strong> This specification does not define the behavior of focus events when interacting with methods such as <code>focus()</code> or
- <code>blur()</code>. See the relevant specifications where those methods are defined for such behavior.</p></div>
- </section>
-
- <section id="events-focusevent-doc-focus" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-focusevent-doc-focus">Document Focus and Focus Context</h5>
-
- <p>This event module includes event types for notification of changes in document
- <a class="def" href="#glossary-event-focus">focus</a>.
- There are three distinct focus contexts that are relevant to this discussion:
- </p>
-
- <ul>
- <li>The <em>operating system focus context</em> which <em class="rfc2119" title="MAY">MAY</em> be on one of many different applications currently
- running on the computer. One of these applications with focus can be a browser.
- </li>
- <li>When the browser has focus, the user can switch (such as with the tab key) the
- <em>application focus context</em> among the different browser user interface fields (e.g., the
- Web site location bar, a search field, etc.). One of these user interface fields can be the
- document being shown in a tab.
- </li>
- <li>When the document itself has focus, the <em>document focus context</em> can be set to any of the
- focusable elements in the document.
- </li>
- </ul>
-
- <p>The event types defined in this specification deal exclusively with document focus, and the
- <a class="def" href="#glossary-event-target">event target</a> identified in the event details
- <em class="rfc2119" title="MUST">MUST</em> only be part of the document or documents in the window, never a part of the browser or
- operating system, even when switching from one focus context to another.
- </p>
-
- <p>Normally, a document always has a focused element (even if it is the document element itself) and a persistent <a class="def" href="#glossary-event-focus-ring">focus
- ring</a>. When switching between focus contexts, the document's currently focused element and focus ring normally remain in their current state. For example,
- if a document has three focusable elements, with the second element focused, when a user changes operating system focus to another application and then back to
- the browser, the second element will still be focused within the document, and tabbing will change the focus to the third element. A <a class="def" href="#glossary-host-language">
- host language</a> <em class="rfc2119" title="MAY">MAY</em> define specific elements which might receive focus, the conditions under which an element <em class="rfc2119" title="MAY">MAY</em> receive focus, the means by which
- focus <em class="rfc2119" title="MAY">MAY</em> be changed, and the order in which the focus changes. For example, in some cases an element might be given focus by moving a pointer over it, while other
- circumstances might require a mouse click. Some elements might not be focusable at all, and some might be focusable only by special means (clicking on the element),
- but not by tabbing to it. Documents <em class="rfc2119" title="MAY">MAY</em> contain multiple focus rings. Other specifications <em class="rfc2119" title="MAY">MAY</em> define a more complex focus model than is described in this specification,
- including allowing multiple elements to have the current focus.
- </p>
- </section>
-
- <p>The Focus event types are listed below.</p>
-
- <!-- blur -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-blur"><dfn id="dfn-blur"><a class="eventtype" href="#event-type-blur"><code>blur</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>blur</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> receiving focus.</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> loses
- focus. The focus <em class="rfc2119" title="MUST">MUST</em> be taken from the element before the dispatch of this event type. This event type is similar to <a class="eventtype" href="#event-type-focusout">
- <code>focusout</code></a>, but is dispatched after focus is shifted, and does not bubble.</p>
- </dd>
- </dl>
- </div>
-
- <!-- focus -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-focus"><dfn id="dfn-focus-1"><a class="eventtype" href="#event-type-focus"><code>focus</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>focus</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> losing focus (if any).</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> receives
- focus. The focus <em class="rfc2119" title="MUST">MUST</em> be given to the element before the dispatch of this event type. This event type is similar to <a class="eventtype" href="#event-type-focusIn">
- <code>focusin</code></a>, but is dispatched after focus is shifted, and does not bubble.</p>
- </dd>
- </dl>
- </div>
-
- <!-- focusin -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-focusIn"><dfn id="dfn-focusin"><a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>focusin</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> losing focus (if any).</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> is about
- to receive focus. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the element is given focus. The <a class="def" href="#glossary-event-target">event target</a> <em class="rfc2119" title="MUST">MUST</em>
- be the element which is about to receive focus. This event type is similar to <a class="eventtype" href="#event-type-focus"><code>focus</code></a>, but is dispatched
- before focus is shifted, and does bubble.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_41"><span>Note</span></div><p class="" id="_9"><strong>Note:</strong> When using this event type, the content author can use the event's <code class="attribute-name"><a href="#widl-FocusEvent-relatedTarget">
- FocusEvent.relatedTarget</a></code> attribute (or a host-language-specific method or means) to get the currently focused element before the focus shifts to the
- next focus <a class="def" href="#glossary-event-target">event target</a>, thus having access to both the element losing focus and the element gaining focus
- without the use of the <a class="eventtype" href="#event-type-blur"><code>blur</code></a> or <a class="eventtype" href="#event-type-focusout">focusout</a> event
- types.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- focusout -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-focusout"><dfn id="dfn-focusout"><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>focusout</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> receiving focus.</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> is about
- to lose focus. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the element loses focus. The <a class="def" href="#glossary-event-target">event target</a> <em class="rfc2119" title="MUST">MUST</em> be the
- element which is about to lose focus. This event type is similar to <a class="eventtype" href="#event-type-blur"><code>blur</code></a>, but is dispatched before
- focus is shifted, and does bubble.</p>
- </dd>
- </dl>
- </div>
- </section>
-
- <section id="events-mouseevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-mouseevents"><span class="secno">5.2.3 </span>Mouse Event Types</h4>
-
- <p>The mouse event module originates from the [<cite><a class="informative" href="#references-HTML40">HTML 4.01</a></cite>] <code>onclick</code>, <code>ondblclick</code>,
- <code>onmousedown</code>, <code>onmouseup</code>, <code>onmouseover</code>, <code>onmousemove</code>, and <code>onmouseout</code> attributes. This event module
- is specifically designed for use with pointing input devices, such as a mouse or a trackball.</p>
-
- <section id="interface-MouseEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-MouseEvent">Interface MouseEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 2, modified in DOM Level 3</p>
-
- <p>The <code>MouseEvent</code> interface provides specific contextual information associated with Mouse events.</p>
-
- <p>In the case of nested elements, mouse events are always targeted at the most deeply nested element.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_42"><span>Note</span></div><p class=""><strong>Note:</strong> Ancestors of the targeted element can use event bubbling to obtain notifications of mouse events which occur within their descendent
- elements.</p></div>
-
- <p>To create an instance of the <code>MouseEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("MouseEvent")</code></a>
- method call.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_43"><span>Note</span></div><p class=""><strong>Note:</strong> When initializing <code>MouseEvent</code> objects using <code>initMouseEvent</code>, implementations can use the client
- coordinates <code>clientX</code> and <code>clientY</code> for calculation of other coordinates (such as target coordinates exposed by <a class="def" href="#glossary-DOM-Level-0">
- DOM Level 0</a> implementations or other proprietary attributes, e.g., <code>pageX</code>).</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-MouseEvent">interface <span class="idlInterfaceID">MouseEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-screenX">screenX</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-screenY">screenY</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-clientX">clientX</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-clientY">clientY</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-ctrlKey">ctrlKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-altKey">altKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-metaKey">metaKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MouseEvent-button">button</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MouseEvent-buttons">buttons</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-MouseEvent-relatedTarget">relatedTarget</a></span>;</span>
-<span class="idlSectionComment"> // Introduced in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-MouseEvent-getModifierState-boolean-DOMString-keyArg">getModifierState</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>);</span>
-};</span></pre><section><h6 id="attributes-4" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-MouseEvent-altKey"><code>altKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Refer to the <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a> attribute.</p>
- </dd><dt id="widl-MouseEvent-button"><code>button</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
- <p>During mouse events caused by the depression or release of a mouse button, <code>button</code> <em class="rfc2119" title="MUST">MUST</em> be used to indicate which pointer device button changed state.</p>
- <p>The value of the <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be as follows:</p>
-
- <ul>
- <li><code>0</code> <em class="rfc2119" title="MUST">MUST</em> indicate the primary button of the device (in general, the left button or the only button on single-button devices, used to activate a user
- interface control or select text) or the un-initialized value.</li>
- <li><code>1</code> <em class="rfc2119" title="MUST">MUST</em> indicate the auxiliary button (in general, the middle button, often combined with a mouse wheel).</li>
- <li><code>2</code> <em class="rfc2119" title="MUST">MUST</em> indicate the secondary button (in general, the right button, often used to display a context menu).</li>
- </ul>
-
- <p>Some pointing devices provide or simulate more buttons, and values higher than <code>2</code> <em class="rfc2119" title="MAY">MAY</em> be used to represent such buttons.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_44"><span>Note</span></div><p class=""><strong>Note:</strong> The value of <code>button</code> is not updated for events not caused by the depression/release of a mouse button. In these
- scenarios, take care not to interpret the value <code>0</code> as the left button, but rather as the <a class="def" href="#glossary-un-initialized-value">un-initialized
- value</a></p></div>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_45"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Some <a class="def" href="#glossary-default-action">default actions</a> related to events such as
- <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> and <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> depend on the specific mouse button in use.</p></div>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-buttons"><code>buttons</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
- <p>During any mouse events, <code>buttons</code> <em class="rfc2119" title="MUST">MUST</em> be used to indicate which combination of mouse buttons are
- currently being pressed, expressed as a bitmask.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_46"><span>Note</span></div><p class=""><strong>Note:</strong> Though similarly named, the values for the <code>buttons</code> attribute and the <a href="#widl-MouseEvent-button"><code>button</code></a>
- attribute are very different. The value of <code>button</code> is assumed to be valid during <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a>/
- <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> event handlers, whereas the <code>buttons</code> attribute reflects the state of the mouse's buttons for any
- trusted <code>MouseEvent</code> object (while it is being dispatched), because it can represent the "no button currently active" state (0).</p></div>
-
- <p>The value of the <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be as follows:</p>
-
- <ul>
- <li><code>0</code> <em class="rfc2119" title="MUST">MUST</em> indicate no button is currently active.</li>
- <li><code>1</code> <em class="rfc2119" title="MUST">MUST</em> indicate the primary button of the device (in general, the left button or the only button on single-button devices, used to activate a user
- interface control or select text).</li>
- <li><code>2</code> <em class="rfc2119" title="MUST">MUST</em> indicate the secondary button (in general, the right button, often used to display a context menu), if present.</li>
- <li><code>4</code> <em class="rfc2119" title="MUST">MUST</em> indicate the auxiliary button (in general, the middle button, often combined with a mouse wheel).</li>
- </ul>
-
- <p>Some pointing devices provide or simulate more buttons. To represent such buttons, the value <em class="rfc2119" title="MUST">MUST</em> be doubled for each successive button (in the binary series <code>
- 8</code>, <code>16</code>, <code>32</code>, ... ).</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_47"><span>Note</span></div><p class="" id="buttons-mask"><strong>Note:</strong> Because the sum of any set of button values is a unique number, a content author can use a bitwise operation
- to determine how many buttons are currently being pressed and which buttons they are, for an arbitrary number of mouse buttons on a device, e.g., the value <code>3</code>
- indicates that the left and right button are currently both pressed, while the value <code>5</code> indicates that the left and middle button are currently both
- pressed.</p></div>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_48"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Some <a class="def" href="#glossary-default-action">default actions</a> related to events such as
- <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> and <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> depend on the specific mouse button in use.</p></div>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-clientX"><code>clientX</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
- <p>The horizontal coordinate at which the event occurred relative to the viewport associated with the event.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-clientY"><code>clientY</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
- <p>The vertical coordinate at which the event occurred relative to the viewport associated with the event.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-ctrlKey"><code>ctrlKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Refer to the <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a> attribute.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-MouseEvent-metaKey"><code>metaKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Refer to the <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a> attribute.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-MouseEvent-relatedTarget"><code>relatedTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
- <p>Used to identify a secondary <a href="#widl-EventTarget"><code>EventTarget</code></a> related to a UI event, depending on the type of event.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd><dt id="widl-MouseEvent-screenX"><code>screenX</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
- <p>The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-screenY"><code>screenY</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
- <p>The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-MouseEvent-shiftKey"><code>shiftKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p>Refer to the <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a> attribute.</p>
- </dd></dl></section><section><h6 id="methods-4" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-MouseEvent-getModifierState"><code>getModifierState</code></dt><dd>
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>Queries the state of a modifier using a key value. See also <a href="#keys-Modifiers">Modifier keys</a>.</p>
-
- <p>Returns <code>true</code> if it is a modifier key and the modifier is activated, <code>false</code> otherwise.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-KeyboardEvent-getModifierState"><code>KeyboardEvent.getModifierState()</code></a> method for a description of this parameter.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <p id="current-click-count">Implementations <em class="rfc2119" title="MUST">MUST</em> maintain the <em>current click count</em> when generating mouse events. This <em class="rfc2119" title="MUST">MUST</em> be a non-negative integer indicating
- the number of consecutive clicks of a pointing device button within a specific time. The delay after which the count resets is specific to the
- environment configuration.</p>
-
- <section id="events-mouseevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-mouseevent-event-order">Mouse Event Order</h5>
-
- <p>Certain mouse events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in a set order relative to one another.
- The following shows the event sequence that <em class="rfc2119" title="MUST">MUST</em> occur when a pointing
- device's cursor is moved over an element:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center">Element</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved into element A...</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center">A</td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved out of element A...</em></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- </tbody></table>
-
- <p>When a pointing device is moved into an element <em>A</em>, and then into a nested element <em>B</em>
- and then back out again, the following sequence of events <em class="rfc2119" title="MUST">MUST</em> occur:
- </p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center">Element</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved into element A...</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center">A</td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved into nested element B...</em></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center">B</td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved from element B into A...</em></td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">10.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">11.</td>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">12.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center">A</td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved out of element A...</em></td>
- </tr>
- <tr>
- <td class="cell-number">13.</td>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">14.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- </tbody></table>
-
- <p>Sometimes elements can be visually overlapped using CSS. In the following example, three elements
- labeled A, B, and C all have the same dimensions and absolute position on a web page.
- Element C is a child of B, and B is a child of A in the DOM:
- </p>
-
- <figure class="figure" style="text-align: center" id="fig-graphical-representation-of-three-stacked-elements-all-on-top-of-each-other-with-the-pointing-device-moving-over-the-stack.x">
- <img src="images/stacked-event-mouse-dispatch.png" alt="Graphical representation of three stacked elements all on top of each other. The bottom element is labeled A and the top element is C" title="Graphical representation of three stacked elements all on top of each other, with the pointing device moving over the stack." />
- <figcaption>Fig. <span class="figno">3</span> <span class="fig-title">Graphical representation of three stacked elements all on top of each other, with the pointing device moving over the stack.</span></figcaption></figure>
-
- <p>When the pointing device is moved from outside the element stack to the element labeled C and then moved
- out again, the following series of events <em class="rfc2119" title="MUST">MUST</em> occur:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center">Element</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved into element C, the topmost element in the stack</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
- <td class="cell-center">C</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
- <td class="cell-center">C</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td class="cell-center">C</td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="3"><em>Pointing device is moved out of element C...</em></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
- <td class="cell-center">C</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">C</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">B</td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">10.</td>
- <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
- <td class="cell-center">A</td>
- <td></td>
- </tr>
- </tbody></table>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_49"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>mouseover</code>/<code>mouseout</code> events are only fired once, while <code>mouseenter</code>/<code>mouseleave</code>
- events are fired three times (once to each element).</p></div>
-
- <p>The following is the typical sequence of events when a button associated with a pointing device (e.g., a mouse button or trackpad) is pressed and released over
- an element:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
- <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">10.</td>
- <td><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_50"><span>Note</span></div><p class=""><strong>Note: </strong>The lag time, degree, distance, and number of <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a>
- events allowed between the <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup">
- <code>mouseup</code></a> events while still firing a <a class="eventtype" href="#event-type-click"><code>click</code></a> or <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event will be implementation-, device-, and platform-specific. This tolerance can aid users that have physical
- disabilities like unsteady hands when these users interact with a pointing device.</p></div>
-
- <p>Each implementation will determine the appropriate hysteresis tolerance, but in general <em class="rfc2119" title="SHOULD">SHOULD</em> fire <a class="eventtype" href="#event-type-click"><code>click</code></a>
- and <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> events when the event target of the associated <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events is the same element with no
- <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> or <a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a>
- events intervening, and <em class="rfc2119" title="SHOULD">SHOULD</em> fire <a class="eventtype" href="#event-type-click"><code>click</code></a> and <a class="eventtype" href="#event-type-dblclick">
- <code>dblclick</code></a> events on the nearest common ancestor when the event targets of the associated <a class="eventtype" href="#event-type-mousedown">
- <code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events are different.</p>
-
- <p>If the <a class="def" href="#glossary-event-target">event target</a> (e.g. the target element) is removed from the DOM during the mouse events sequence, the remaining
- events of the sequence <em class="rfc2119" title="MUST NOT">MUST NOT</em> be fired on that element.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>If the target element is removed from the DOM as the result of a <a class="eventtype" href="#event-type-mousedown">
- <code>mousedown</code></a> event, no events for that element will be dispatched for <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
- <a class="eventtype" href="#event-type-click"><code>click</code></a>, or <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>, nor any default
- activation events. However, the <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> event will still be dispatched on the element that is exposed
- to the mouse after the removal of the initial target element. Similarly, if the target element is removed from the DOM during the dispatch of a <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> event, the <a class="eventtype" href="#event-type-click"><code>click</code></a> and subsequent events will
- not be dispatched.</p>
- </div>
-
- </section>
-
- <p>The Mouse event types are listed below. In the case of nested elements, mouse event types are always targeted at the most deeply nested element. Ancestors of the
- targeted element <em class="rfc2119" title="MAY">MAY</em> use bubbling to obtain notification of mouse events which occur within its descendent elements.</p>
-
- <!-- click -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-click"><dfn id="dfn-click"><a class="eventtype" href="#event-type-click"><code>click</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>click</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Varies</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- indicates the <a href="#current-click-count">current click count</a>;
- the attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>1</code> when the user begins this action and increments by <code>1</code> for each click.</li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- value based on current button pressed</li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>The <a class="eventtype" href="#event-type-click"><code>click</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched on the
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a> indicated by the pointer, when
- the user presses down and releases the primary pointer button,
- or otherwise activates the pointer in a manner that simulates such an action.
- The actuation method of the mouse button depends upon the pointer device and the environment configuration,
- e.g., it <em class="rfc2119" title="MAY">MAY</em> depend on the screen location or the delay between the press and release of the pointing device button.
- </p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_51"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>click</code> event should only be fired for the primary
- pointer button (i.e., when <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> value is <code>0</code>,
- <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> value is <code>1</code>).
- Secondary buttons (like the middle or right button on a standard mouse) <em class="rfc2119" title="MUST NOT">MUST NOT</em> fire
- <code>click</code> events.
- </p></div>
-
- <p>The <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> be preceded by the <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>
- and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events on the same element, disregarding changes between other node types (e.g., text
- nodes). Depending upon the environment configuration, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> be dispatched if one or
- more of the event types <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>, <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a>,
- and <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> occur between the press and release of the pointing device button. The <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> also be followed by the <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>
- event.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>If a user mouses down on a text node child of a <code><p></code> element which has been styled with
- a large line-height, shifts the mouse slightly such that it is no longer over an area containing text but is still within the containing block of that <code><p></code>
- element (i.e., the pointer is between lines of the same text block, but not over the text node per se), then subsequently mouses up, this will likely still trigger
- a <a class="eventtype" href="#event-type-click"><code>click</code></a> event (if it falls within the normal temporal hysteresis for a <a class="eventtype" href="#event-type-click">
- <code>click</code></a>), since the user has stayed within the scope of the same element. Note that user-agent-generated mouse events are not dispatched on text nodes.
- </p>
- </div>
-
- <p>In addition to being associated with pointer devices, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched as
- part of an element activation, as described in <a href="#event-flow-activation">Activation triggers and behavior</a>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_52"><span>Note</span></div><p class=""><strong>Note:</strong> For maximum accessibility, content authors are encouraged to use the
- <a class="eventtype" href="#event-type-click"><code>click</code></a> event type when defining activation
- behavior for custom controls, rather than other pointing-device event types such as
- <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> or
- <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, which are more device-specific.
- Though the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type has its origins
- in pointer devices (e.g., a mouse), subsequent implementation
- enhancements have extended it beyond that association, and it can be considered a device-independent event
- type for element activation.
- </p></div>
-
- <p>The <a class="def" href="#glossary-default-action">default action</a> of the
- <a class="eventtype" href="#event-type-click"><code>click</code></a> event type varies
- based on the <a class="def" href="#glossary-event-target">event target</a> of the event and the value of the
- <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a>
- or <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attributes.
- Typical <a class="def" href="#glossary-default-action">default actions</a>
- of the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type are as follows:
- </p>
-
- <ul>
- <li>If the <a class="def" href="#glossary-event-target">event target</a> has associated activation behavior, the <a class="def" href="#glossary-default-action">default
- action</a> <em class="rfc2119" title="MUST">MUST</em> be to execute that activation behavior (see <a href="#event-flow-activation">Activation triggers and behavior</a>).</li>
-
- <li>If the <a class="def" href="#glossary-event-target">event target</a> is focusable, the <a class="def" href="#glossary-default-action">default action</a> <em class="rfc2119" title="MUST">MUST</em> be
- to give that element document focus.</li>
- </ul>
- </dd>
- </dl>
- </div>
-
- <!-- dblclick -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-dblclick"><dfn id="dfn-dblclick"><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>dblclick</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- indicates the <a href="#current-click-count">current click count</a></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- value based on current button pressed</li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the primary button
- of a pointing device is clicked twice over an element. The definition of a double click depends on the environment
- configuration, except that the event target <em class="rfc2119" title="MUST">MUST</em> be the same between
- <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
- <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, and
- <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>.
- This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type
- <a class="eventtype" href="#event-type-click"><code>click</code></a>
- if a click and double click occur simultaneously,
- and after the event type <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> otherwise.
- </p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_53"><span>Note</span></div><p class=""><strong>Note:</strong> As with the <code>click</code> event, the <code>dblclick</code> event
- should only be fired for the primary pointer button.
- Secondary buttons <em class="rfc2119" title="MUST NOT">MUST NOT</em> fire <code>dblclick</code> events.
- </p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_54"><span>Note</span></div><p class=""><strong>Note:</strong> Canceling the
- <a class="eventtype" href="#event-type-click"><code>click</code></a> event does not affect the firing
- of a <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event.
- </p></div>
-
- <p>As with the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type, the
- <a class="def" href="#glossary-default-action">default action</a>
- of the <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event type varies based on the
- <a class="def" href="#glossary-event-target">event target</a> of the event and the value of the
- <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> or
- <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attributes.
- Normally, the typical <a class="def" href="#glossary-default-action">default actions</a> of the
- <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event type match those of the
- <a class="eventtype" href="#event-type-click"><code>click</code></a> event type, with the following additional
- behavior:
- </p>
-
- <ul>
- <li>If the <a class="def" href="#glossary-event-target">event target</a> is selectable, the <a class="def" href="#glossary-default-action">default action</a> <em class="rfc2119" title="MUST">MUST</em>
- be to select part or all of the selectable content. Subsequent clicks <em class="rfc2119" title="MAY">MAY</em> select additional selectable portions of that content.</li>
- </ul>
- </dd>
- </dl>
- </div>
-
- <!-- mousedown -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mousedown"><dfn id="dfn-mousedown"><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mousedown</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Varies: Start a drag/drop operation; start a text selection; start a scroll/pan interaction (in combination with the middle mouse button, if supported)</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- indicates the <a href="#current-click-count">current click count</a> incremented by one. For example, if no click happened
- before the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a>, <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>
- will contain the value <code>1</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- value based on current button pressed</li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device button is pressed over an element.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_55"><span>Note</span></div><p class=""><strong>Note: </strong>Many implementations use the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> event to begin a variety of contextually dependent <a class="def" href="#glossary-default-action">default actions</a>. These default actions can be prevented if this event is canceled. Some of these default actions could include: beginning
- a drag/drop interaction with an image or link, starting text selection, etc. Additionally, some implementations provide a mouse-driven panning feature that is activated when
- the middle mouse button is pressed at the time the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> event is dispatched.</p></div>
-
- </dd>
- </dl>
- </div>
-
- <!-- mouseenter -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mouseenter"><dfn id="dfn-mouseenter"><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mouseenter</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is exiting, if any.</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved onto the boundaries of an element or one of
- its descendent elements. This event type is similar to <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>, but differs in that it does
- not bubble, and <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched when the pointer device moves from an element onto the boundaries of one of its descendent elements.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_56"><span>Note</span></div><p class=""><strong>Note:</strong> There are similarities between this event type and the CSS <a href="http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes" title="Selectors"><code>:hover</code> pseudo-class</a> <a href="#references-CSS2">[CSS2.1]</a>. See also the <a class="eventtype" href="#event-type-mouseleave"><code>
- mouseleave</code></a> event type.</p></div>
-
- </dd>
- </dl>
- </div>
-
- <!-- mouseleave -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mouseleave"><dfn id="dfn-mouseleave"><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mouseleave</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is entering, if any.</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved off of the boundaries of an element and all
- of its descendent elements. This event type is similar to <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a>, but differs in that does
- not bubble, and that it <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched until the pointing device has left the boundaries of the element and the boundaries of all of its children.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_57"><span>Note</span></div><p class=""><strong>Note:</strong> There are similarities between this event type and the CSS <a href="http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes" title="Selectors"><code>:hover</code> pseudo-class</a> <a href="#references-CSS2">[CSS2.1]</a>. See also the <a class="eventtype" href="#event-type-mouseenter"><code>
- mouseenter</code></a> event type.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- mousemove -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mousemove"><dfn id="dfn-mousemove"><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mousemove</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved while it is over an element. The frequency
- rate of events while the pointing device is moved is implementation-, device-, and platform-specific, but multiple consecutive <a class="eventtype" href="#event-type-mousemove">
- <code>mousemove</code></a> events <em class="rfc2119" title="SHOULD">SHOULD</em> be fired for sustained pointer-device movement, rather than a single event for each instance of mouse movement. Implementations
- are encouraged to determine the optimal frequency rate to balance responsiveness with performance.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_58"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>In some implementation environments, such as a browser, <a class="eventtype internalDFN" href="#dfn-mousemove"><code>mousemove</code></a> events can continue
- to fire if the user began a drag operation (e.g., a mouse button is pressed) and the pointing device has left the boundary of the user agent.</p></div>
-
- </dd>
- </dl>
- </div>
-
- <!-- mouseout -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mouseout"><dfn id="dfn-mouseout"><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mouseout</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is entering, if any.</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved off of the boundaries of an element. This
- event type is similar to <a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a>, but differs in that does bubble, and that it <em class="rfc2119" title="MUST">MUST</em> be dispatched
- when the pointer device moves from an element onto the boundaries of one of its descendent elements.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_59"><span>Note</span></div><p class=""><strong>Note:</strong> See also the <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a> event type.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- mouseover -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mouseover"><dfn id="dfn-mouseover"><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></dfn></dt>
- <dd>
- <table summary="This table contains information about the semantics of the given event type" border="0" cellpadding="2" cellspacing="0">
- <tbody>
- <tr>
- <th>Type</th>
- <td><strong><code>mouseover</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is exiting, if any.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved onto the boundaries of an element. This event
- type is similar to <a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a>, but differs in that it bubbles, and that it <em class="rfc2119" title="MUST">MUST</em> be dispatched
- when the pointer device moves onto the boundaries of an element whose ancestor element is the <a class="def" href="#glossary-event-target">event target</a> for
- the same event listener instance.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_60"><span>Note</span></div><p class=""><strong>Note:</strong> See also the <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> event type.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- mouseup -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-mouseup"><dfn id="dfn-mouseup"><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>mouseup</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Invoke a context menu (in combination with the right mouse button, if supported)</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- indicates the <a href="#current-click-count">current click count</a> incremented by one.</li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- value based on the pointer position on the screen</li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- value based on the pointer position within the viewport</li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- value based on current button pressed</li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device button is released over an element.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_61"><span>Note</span></div><p class=""><strong>Note: </strong>Many implementations will invoke a context menu as the default action of this event if the right mouse button is being released.</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_62"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>In some implementation environments, such as a browser, a <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> event
- can be dispatched even if the pointing device has left the boundary of the user agent, e.g., if the user began a drag operation with a mouse button pressed).</p></div>
- </dd>
- </dl>
- </div>
- </section>
-
- <section id="events-wheelevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-wheelevents"><span class="secno">5.2.4 </span>Wheel Event Types</h4>
- <p>Wheels are devices that can be rotated in one or more spatial dimensions, and which can be associated with a pointer device. The coordinate system depends on the
- environment configuration.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The user's environment might be configured to associate vertical scrolling with rotation along the y-axis, horizontal
- scrolling with rotation along the x-axis, and zooming with rotation along the z-axis.</p>
- </div>
-
- <p>The deltaX, deltaY, and deltaZ attributes of <a href="#interface-WheelEvent"><code>WheelEvent</code></a> objects indicate a measurement along their respective axes
- in units of pixels, lines, or pages. The reported measurements are provided after an environment-specific algorithm translates the actual rotation/movement of
- the wheel device into the appropriate values and units.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_63"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> A user's environment settings can be customized to interpret actual rotation/movement of a wheel device in different ways.
- One movement of a common <q>dented</q> mouse wheel can produce a measurement of 162 pixels (162 is just an example value, actual values can depend on the current screen
- dimensions of the user-agent). But a user can change their default environment settings to speed-up their mouse wheel, increasing this number. Furthermore, some
- mouse wheel software can support acceleration (the faster the wheel is rotated/moved, the greater the delta of each measurement) or even sub-pixel rotation measurements.
- Because of this, authors can not assume a given rotation amount in one user agent will produce the same delta value in all user agents.</p></div>
-
- <p>The sign (positive or negative) of the values of the deltaX, deltaY, and deltaZ attributes <em class="rfc2119" title="MUST">MUST</em> be consistent between multiple dispatches of the
- <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event while the motion of the actual wheel device is rotating/moving in the same direction. If a user agent scrolls as the
- default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event then the sign of the delta <em class="rfc2119" title="SHOULD">SHOULD</em> be given by a right-hand coordinate system where positive X,
- Y, and Z axes are directed towards the right-most edge, bottom-most edge, and farthest depth (away from the user) of the document, respectively.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_64"><span>Note</span></div><p class=""><strong>Note:</strong> Individual user agents can (depending on their environment and hardware configuration) interpret the same physical user interaction
- on the wheel differently. For example, a vertical swipe on the edge of a trackpad from top to bottom can be interpreted as a wheel action intended to either scroll the
- page down or to pan the page up (i.e., resulting in either a positive or negative deltaY value respectively).</p></div>
-
- <section id="interface-WheelEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-WheelEvent">Interface WheelEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The <code>WheelEvent</code> interface provides specific contextual information associated with <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> events.</p>
-
- <p>To create an instance of the <code>WheelEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("WheelEvent")</code></a>
- method call.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_65"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
- WheelEvent objects.</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-WheelEvent">interface <span class="idlInterfaceID">WheelEvent</span> : <span class="idlSuperclass"><a href="#idl-def-MouseEvent" class="idlType"><code>MouseEvent</code></a></span> {
-<span class="idlSectionComment"> // DeltaModeCode</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_PIXEL">DOM_DELTA_PIXEL</a></span> = <span class="idlConstValue">0x00</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_LINE">DOM_DELTA_LINE</a></span> = <span class="idlConstValue">0x01</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_PAGE">DOM_DELTA_PAGE</a></span> = <span class="idlConstValue">0x02</span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaX">deltaX</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaY">deltaY</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaZ">deltaZ</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaMode">deltaMode</a></span>;</span>
-};</span></pre><section><h6 id="attributes-5" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-WheelEvent-deltaMode"><code>deltaMode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
- <p>The <code>deltaMode</code> attribute contains an indication of the units of measurement for the <a href="#glossary-delta"><code>delta</code></a> values.
- The default value is <a href="#widl-WheelEvent-DOM_DELTA_PIXEL"><code class="constant-name">DOM_DELTA_PIXEL</code></a> (pixels).</p>
-
- <p>This attribute <em class="rfc2119" title="MUST">MUST</em> be set to one of the DOM_DELTA constants to indicate the units of measurement for the <a href="#glossary-delta"><code>delta</code></a> values. The precise measurement
- is specific to device, operating system, and application configurations.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-WheelEvent-deltaX"><code>deltaX</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
- <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
- the x-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
- measurement (in pixels, lines, or pages) of the movement of a wheel device around the x-axis.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-WheelEvent-deltaY"><code>deltaY</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
- <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
- the y-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
- measurement (in pixels, lines, or pages) of the movement of a wheel device around the y-axis.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-WheelEvent-deltaZ"><code>deltaZ</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
- <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
- the z-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
- measurement (in pixels, lines, or pages) of the movement of a wheel device around the z-axis.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd></dl></section><section><h6 id="constants-1" aria-level="5" role="heading">Constants</h6><dl class="constants"><dt id="widl-WheelEvent-DOM_DELTA_LINE"><code>DOM_DELTA_LINE</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be individual lines of text. This is the case for many form controls.</p>
- </dd><dt id="widl-WheelEvent-DOM_DELTA_PAGE"><code>DOM_DELTA_PAGE</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be pages, either defined as a single screen or as a demarcated page.</p>
- </dd><dt id="widl-WheelEvent-DOM_DELTA_PIXEL"><code>DOM_DELTA_PIXEL</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be pixels. This is the most typical case in most operating system and implementation
- configurations.</p>
- </dd></dl></section>
- </section>
-
- <p>The Wheel event types are listed below.</p>
-
- <!-- wheel -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-wheel"><dfn id="dfn-wheel"><a class="eventtype" href="#event-type-wheel"><code>wheel</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>wheel</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-WheelEvent"><code>WheelEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Async</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Scroll (or zoom) the document</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
- if the wheel is associated with a pointing device, the value based on the pointer position on the screen, otherwise <code>0</code></li>
- <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
- if the wheel is associated with a pointing device, the value based
- on the pointer position on the screen, otherwise <code>0</code></li>
- <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
- if the wheel is associated with a pointing device, the value based
- on the pointer position within the viewport, otherwise <code>0</code></li>
- <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
- if the wheel is associated with a pointing device, the value
- based on the pointer position within the viewport, otherwise <code>0</code></li>
- <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a>
- modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
- if wheel is associated with a pointing device, value based on current button pressed, otherwise <code>0</code></li>
- <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
- if wheel is associated with a pointing device, value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
- <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
- indicates the <a class="def" href="#glossary-event-target">event target</a> the pointing device is pointing at, if any.</li>
- <li><a href="#widl-WheelEvent-deltaX"><code class="attribute-name">WheelEvent.deltaX</code></a>:
- expected amount that the page will scroll along the x-axis according
- to the deltaMode units; or an implemenation-specific value of movement of a wheel around the x-axis</li>
- <li><a href="#widl-WheelEvent-deltaY"><code class="attribute-name">WheelEvent.deltaY</code></a>:
- expected amount that the page will scroll along the y-axis according
- to the deltaMode units; or an implemenation-specific value of movement of a wheel around the y-axis</li>
- <li><a href="#widl-WheelEvent-deltaZ"><code class="attribute-name">WheelEvent.deltaZ</code></a>:
- expected amount that the page will scroll along the z-axis according
- to the deltaMode units; or an implemenation-specific value of movement of a wheel around the z-axis</li>
- <li><a href="#widl-WheelEvent-deltaMode"><code class="attribute-name">WheelEvent.deltaMode</code></a>:
- unit indicator (pixels, lines, or pages) for the deltaX, deltaY, and deltaZ attributes</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a mouse wheel has been rotated around any axis, or when an equivalent
- input device (such as a mouse-ball, certain tablets or touchpads, etc.) has emulated such an action. Depending on the platform and input device, diagonal wheel
- deltas <em class="rfc2119" title="MAY">MAY</em> be delivered either as a single <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event with multiple non-zero axes or as separate <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a>
- events for each non-zero axis.</p>
-
- <p>The typical <a class="def" href="#glossary-default-action">default action</a> of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event
- type is to scroll (or in some cases, zoom) the document by the indicated amount. If this event is canceled, the implementation <em class="rfc2119" title="MUST NOT">MUST NOT</em> scroll or zoom the document
- (or perform whatever other implementation-specific default action is associated with this event type).</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_66"><span>Note</span></div><p class=""><strong>Note:</strong> In some <a class="def" href="#glossary-user-agent">user agents</a>, or with some input devices, the speed that the wheel has been
- turned can affect the <a href="#glossary-delta"><code>delta</code></a> values, with a faster speed producing a higher <a href="#glossary-delta"><code>delta</code></a> value.</p></div>
- </dd>
- </dl>
- </div>
- </section>
-
- <section id="events-inputevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-inputevents"><span class="secno">5.2.5 </span>Input Event Types</h4>
- <p>Input events are sent as notifications whenever the DOM is being updated.</p>
-
- <section id="interface-InputEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-InputEvent">Interface InputEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-InputEvent">interface <span class="idlInterfaceID">InputEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-InputEvent-data">data</a></span>;</span>
-};</span></pre><section><h6 id="attributes-6" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-InputEvent-data"><code>data</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p><code>data</code> holds the value of the characters generated by an input method. This <em class="rfc2119" title="MAY">MAY</em> be a single Unicode character or a non-empty sequence of Unicode characters
- [<cite><a class="normative" href="#references-Unicode">Unicode</a></cite>]. Characters <em class="rfc2119" title="SHOULD">SHOULD</em> be normalized as defined by the Unicode normalization form <em>NFC</em>,
- defined in [<cite><a class="normative" href="#references-UnicodeNormalization">UAX #15</a></cite>]. This attribute <em class="rfc2119" title="MAY">MAY</em> be null or contain the <a class="def" href="#glossary-empty-string">
- empty string</a>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd></dl></section>
- </section>
-
- <section id="events-inputevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4input event="" order<="" h4="">
-
- <p>The input events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in a set order relative to one another.
- </p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>DOM element is updated</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- </h4input></section>
-
- <p>The Input event types are listed below.</p>
-
- <!-- beforeinput -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-beforeinput"><dfn id="dfn-beforeinput"><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>beforeinput</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code> or any <code>Element</code> with <code>contentEditable<=true</code>
- or with <code>inputmode</code> set.</td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Update the DOM element</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> that is about to be updated</li>
- <li><a href="#widl-InputEvent-data"><code class="attribute-name">InputEvent.data</code></a>:
- the string containing the data that will be added to the element,
- which <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM is about to be updated.</p>
- </dd>
- </dl>
- </div><!-- beforeinput -->
-
- <!-- input -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-input"><dfn id="dfn-input"><a class="eventtype" href="#event-type-input"><code>input</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>input</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code> or any <code>Element</code> with <code>contentEditable<=true</code>
- or with <code>inputmode</code> set.</td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> that was just updated</li>
- <li><a href="#widl-InputEvent-data"><code class="attribute-name">InputEvent.data</code></a>:
- the string containing the data that was added to the element,
- which <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event immediately after the DOM has been updated.</p>
- </dd>
- </dl>
- </div><!-- input -->
-
- </section>
-
- <section id="events-keyboardevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-keyboardevents"><span class="secno">5.2.6 </span>Keyboard Event Types</h4>
-
- <p>Keyboard events are device dependent, i.e., they rely on the capabilities of the input devices and how they are mapped in the operating systems. Refer to <a href="#keys">
- Keyboard events and key values</a> for more details, including examples on how Keyboard Events are used in combination with Composition Events. Depending on the
- character generation device, keyboard events might not be generated.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_67"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Keyboard events are only one modality of providing textual input. For editing scenarios, consider also using the "input" event
- defined in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] as an alternate to (or in addition to) keyboard events.</p></div>
-
- <section id="interface-KeyboardEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-KeyboardEvent">Interface KeyboardEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface provides specific contextual information associated with keyboard devices. Each keyboard event references a key using a
- value. Keyboard events are commonly directed at the element that has the focus.</p>
-
- <p>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface provides convenient attributes for some common modifiers keys: <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a>,
- <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a>, <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a>,
- <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a>. These attributes are equivalent to using the method <a href="#widl-KeyboardEvent-getModifierState">
- <code>KeyboardEvent.getModifierState(keyArg)</code></a> with <code class="key">'Control'</code>, <code class="key">'Shift'</code>, <code class="key">'Alt'</code>,
- or <code class="key">'Meta'</code> respectively.</p>
-
- <p>To create an instance of the <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("KeyboardEvent")</code></a>
- method call.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_68"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> objects.</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent">interface <span class="idlInterfaceID">KeyboardEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
-<span class="idlSectionComment"> // KeyLocationCode</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_STANDARD">DOM_KEY_LOCATION_STANDARD</a></span> = <span class="idlConstValue">0x00</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_LEFT">DOM_KEY_LOCATION_LEFT</a></span> = <span class="idlConstValue">0x01</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_RIGHT">DOM_KEY_LOCATION_RIGHT</a></span> = <span class="idlConstValue">0x02</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_NUMPAD">DOM_KEY_LOCATION_NUMPAD</a></span> = <span class="idlConstValue">0x03</span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-key">key</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-location">location</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-ctrlKey">ctrlKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-shiftKey">shiftKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-altKey">altKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-metaKey">metaKey</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-repeat">repeat</a></span>;</span>
-<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-KeyboardEvent-getModifierState-boolean-DOMString-keyArg">getModifierState</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>);</span>
-};</span></pre><section><h6 id="attributes-7" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-KeyboardEvent-altKey"><code>altKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p><code>true</code> if the <a href="#key-Alt"><code class="key">'Alt'</code></a> (alternative) or <code>Option</code> key modifier was active.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-KeyboardEvent-ctrlKey"><code>ctrlKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p><code>true</code> if the <a href="#key-Control"><code class="key">'Control'</code></a> (control) key modifier was active.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-KeyboardEvent-key"><code>key</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p><code>key</code> holds the key value of the key pressed.
- If the value is has a printed representation, it <em class="rfc2119" title="MUST">MUST</em> be a non-empty Unicode character
- string, conforming to the <a href="#key-algorithm">algorithm for determining the key value</a> defined in this specification.
- If the value is a control key which has no printed representation, it <em class="rfc2119" title="MUST">MUST</em> be one of the key values defined in the
- <a href="#keys-keyvalues">key values set</a>, as determined by the <a href="#key-algorithm">algorithm for determining the key value</a>. Implementations that are
- unable to identify a key <em class="rfc2119" title="MUST">MUST</em> use the key value <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_69"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>key</code> attribute is not related to the legacy <code>keyCode</code> attribute and does not have the same set of values.</p></div>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd><dt id="widl-KeyboardEvent-location"><code>location</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
- <p>The <code>location</code> attribute contains an indication of the location of the key on the device.</p>
-
- <p>This attribute <em class="rfc2119" title="MUST">MUST</em> be set to one of the DOM_KEY_LOCATION constants to indicate the location of a key on the device. In case a DOM implementation wishes to provide a new location value, a
- value different from the defined constant values <em class="rfc2119" title="MUST">MUST</em> be used.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
- </dd><dt id="widl-KeyboardEvent-metaKey"><code>metaKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p><code>true</code> if the meta (Meta) key modifier was active.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_70"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>'Command'</code> key modifier on Macintosh systems is represented using this key modifier.</p></div>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-KeyboardEvent-repeat"><code>repeat</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p><code>true</code> if the key has been pressed in a sustained manner. Holding down a key <em class="rfc2119" title="MUST">MUST</em> result in the repeating the events
- <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
- <a class="eventtype" href="#event-type-input"><code>input</code></a>
- in this order, at a rate determined by the system configuration. For mobile devices which have <em>long-key-press</em>
- behavior, the first key event with a <a href="#widl-KeyboardEvent-repeat">repeat</a> attribute value of <code>'true'</code> <em class="rfc2119" title="MUST">MUST</em> serve as an
- indication of a <em>long-key-press</em>. The length of time that the key <em class="rfc2119" title="MUST">MUST</em> be pressed in order to begin repeating is configuration-dependent.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd><dt id="widl-KeyboardEvent-shiftKey"><code>shiftKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
- <p><code>true</code> if the shift (Shift) key modifier was active.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
- </dd></dl></section><section><h6 id="methods-5" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-KeyboardEvent-getModifierState"><code>getModifierState</code></dt><dd>
- <p>Queries the state of a modifier using a key value. See also <a href="#keys-Modifiers">Modifier keys</a>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>A modifier key value. Modifier keys defined in this specification are
- <a href="#key-Alt"><code class="key">'Alt'</code></a>
- <a href="#key-AltGraph"><code class="key">'AltGraph'</code></a>
- <a href="#key-CapsLock"><code class="key">'CapsLock'</code></a>
- <a href="#key-Control"><code class="key">'Control'</code></a>
- <a href="#key-Fn"><code class="key">'Fn'</code></a>
- <a href="#key-Meta"><code class="key">'Meta'</code></a>
- <a href="#key-NumLock"><code class="key">'NumLock'</code></a>
- <a href="#key-ScrollLock"><code class="key">'ScrollLock'</code></a>
- <a href="#key-Shift"><code class="key">'Shift'</code></a>
- <a href="#key-SymbolLock"><code class="key">'SymbolLock'</code></a>, and
- <a href="#key-OS"><code class="key">'OS'</code></a>
- User agents <em class="rfc2119" title="MAY">MAY</em> support additional implementation-specific modifier keys depending on the environment.</p>
-
- <p>Returns <code>true</code> if it is a modifier key and the modifier is activated, <code>false</code> otherwise.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_71"><span>Note</span></div><p class=""><strong>Note:</strong> If an application wishes to distinguish between right and left modifiers, this information could be
- deduced using keyboard events and <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>.</p></div>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section><section><h6 id="constants-2" aria-level="5" role="heading">Constants</h6><dl class="constants"><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_LEFT"><code>DOM_KEY_LOCATION_LEFT</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The key activated originated from the left key location (when there is more than one possible location for this key).</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The left <code class="key">'Control'</code> key on a PC 101 Key US keyboard.</p>
- </div>
- </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_NUMPAD"><code>DOM_KEY_LOCATION_NUMPAD</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad
- (when there is more than one possible location for this key).
- Note that the <code class="key">'NumLock'</code>key should always be encoded with a location of
- <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code class="constant-name">DOM_KEY_LOCATION_STANDARD</code></a>.
- </p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The <code class="key">'1'</code> key on a PC 101 Key US keyboard located on the numeric pad.</p>
- </div>
- </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_RIGHT"><code>DOM_KEY_LOCATION_RIGHT</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The key activation originated from the right key location (when there is more than one possible location for this key).</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The right <code class="key">'Shift'</code> key on a PC 101 Key US keyboard.</p>
- </div>
- </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code>DOM_KEY_LOCATION_STANDARD</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
- <p>The key activation <em class="rfc2119" title="MUST NOT">MUST NOT</em> be distinguished as the left or right version of the key, and (other than the <code class="key">'NumLock'</code>key)
- did not originate from the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
- </p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The <code class="key">'Q'</code> key on a PC 101 Key US keyboard.</p>
- <p>The <code class="key">'NumLock'</code> key on a PC 101 Key US keyboard.</p>
- <p>The <code class="key">'1'</code> key on a PC 101 Key US keyboard located in the main section of the keyboard.</p>
- </div>
- </dd></dl></section>
- </section>
-
- <div class="warning">
- <p><strong>Warning!</strong></p>
- <p>Legacy keyboard event implementations include three additional attributes, <code>keyCode</code>, <code>charCode</code>, and
- <code>which</code>. The <code>keyCode</code> attribute indicates a numeric value associated with a particular key on a computer keyboard,
- while the <code>charCode</code> attribute indicates the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> value of the character
- associated with that key (which might be the same as the <code>keyCode</code> value) and is applicable only to keys that produce a
- <a class="def" href="#glossary-character-value">character value</a>.
- </p>
- <p>In practice, <code>keyCode</code> and <code>charCode</code> are inconsistent across platforms
- and even the same implementation on different operating systems or using different localizations.
- DOM Level 3 Events does not define values for either
- <code>keyCode</code> or <code>charCode</code>, or behavior for <code>charCode</code>.
- In conforming DOM Level 3 Events implementations, content authors can instead use <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>.
- </p>
- <p><em>For more information, see the informative appendix on <a href="#legacy-key-attributes">Legacy key attributes</a>.</em>
- </p>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_72"><span>Note</span></div><p class=""><strong>Note:</strong> For compatibility with existing content, virtual keyboards, such as software keyboards on screen-based
- input devices, are expected to produce the normal range of keyboard events, even though they do not possess physical keys.</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_73"><span>Note</span></div><p class=""><strong>Note:</strong> In some implementations or system configurations, some key events, or their values, might be suppressed
- by the <a class="def" href="#glossary-ime">IME</a> in use.</p></div>
-
- <section id="events-keyboard-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-keyboard-event-order">Keyboard Event Order</h5>
- <p>The keyboard events defined in this specification occur in a set order relative to one another, for any given key:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td><em>(only for keys which produce a <a class="def" href="#glossary-character-value">character value</a>)</em></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
- character in to the DOM.</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td><em>(only for keys which have updated the DOM)</em></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Any events as a result of the key being held for a sustained period (see below).</em></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- <p>If the key is depressed for a sustained period, the following events <em class="rfc2119" title="MAY">MAY</em> repeat at an environment-dependent rate: <!-- and the key should seek counseling -->
- </p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td><em>(with <a href="#widl-KeyboardEvent-repeat">repeat</a> attribute set to <code> true</code>)</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td><em>(only for keys which produce a <a class="def" href="#glossary-character-value">character value</a>)</em></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
- character in to the DOM.</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td><em>(only for keys which have updated the DOM)</em></td>
- </tr>
- </tbody></table>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_74"><span>Note</span></div><p class=""><strong>Note:</strong> Typically, any <a class="def" href="#glossary-default-action">default actions</a> associated with any particular
- key are completed before the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event is dispatched. This might delay the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event slightly (though this is not likely to be a perceptible delay).</p></div>
-
- <p>The <a class="def" href="#glossary-event-target">event target</a> of a key event is the currently focused element which is processing the keyboard activity. This
- is often an HTML <code>input</code> element or a textual element which is editable, but <em class="rfc2119" title="MAY">MAY</em> be an element defined by the <a class="def" href="#glossary-host-language">
- host language</a> to accept keyboard input for non-text purposes, such as the activation of a hotkey or trigger of some other behavior. If no suitable element
- is in focus, the event target will be the root element.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_75"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="def" href="#glossary-event-target">event target</a> might change between different key events.
- For example, a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event for the <a href="#key-Tab"><code class="key">'Tab'</code></a> key
- will likely have a different <a class="def" href="#glossary-event-target">event target</a> than the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>
- event on the same keystroke.</p></div>
- </section>
-
- <p>The keyboard event types are listed below.</p>
-
- <!-- keydown -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-keydown"><dfn id="dfn-keydown"><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>keydown</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Varies:
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and <a class="eventtype" href="#event-type-input"><code>input</code></a> events;
- launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
- <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
- <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event;
- <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
- other event</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the key event, root element if no suitable input element focused</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
- the key value of the key pressed.</li>
- <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
- the location of the key on the device.</li>
- <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
- <code>true</code> if a key has been depressed long enough to trigger key repetition, otherwise <code>false</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a key is pressed down. The <a class="eventtype" href="#event-type-keydown">
- <code>keydown</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This
- event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>.
- This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
- <a class="eventtype" href="#event-type-input"><code>input</code></a>,
- and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>
- events associated with the same key.</p>
-
- <p>The default action of the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event depends upon the key:</p>
-
- <ul>
- <li>If the key is associated with a character, the default action <em class="rfc2119" title="MUST">MUST</em> be to dispatch
- a <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> event
- followed by an <a class="eventtype" href="#event-type-input"><code>input</code></a>
- event.
- In the case where the key which is associated with multiple characters (such as with a macro or certain sequences of dead keys), the default action <em class="rfc2119" title="MUST">MUST</em>
- be to dispatch one set of
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> /
- <a class="eventtype" href="#event-type-input"><code>input</code></a>
- events for each character</li>
-
- <li>If the key is associated with a <a class="def" href="#glossary-text-composition-system">text composition system</a>, the default action <em class="rfc2119" title="MUST">MUST</em> be to launch that
- system</li>
-
- <li>If the key is the <a href="#key-Tab"><code class="key">'Tab'</code></a> key, the default action <em class="rfc2119" title="MUST">MUST</em> be to shift the document focus from the currently focused
- element (if any) to the new focused element, as described in <a href="#events-focusevent">Focus Event Types</a></li>
-
- <li>If the key is the <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key and the
- current focus is on a state-changing element, the default action <em class="rfc2119" title="MUST">MUST</em> be to dispatch a <a class="eventtype" href="#event-type-click"><code>click</code></a> event,
- and a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event if that event type is supported by the <a class="def" href="#glossary-user-agent">
- user agent</a> (refer to <a href="#event-flow-activation">activation triggers and behavior</a> for more details)</li>
- </ul>
-
- <p>If this event is canceled, the associated event types <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched, and the associated actions <em class="rfc2119" title="MUST NOT">MUST NOT</em> be performed.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_76"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup">
- <code>keyup</code></a> events are traditionally associated with detecting any key, not just those which produce a <a class="def" href="#glossary-character-value">character
- value</a>.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- keyup -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-keyup"><dfn id="dfn-keyup"><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>keyup</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the key event, root element if no suitable input element focused</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
- the key value of the key pressed.</li>
- <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
- the location of the key on the device.</li>
- <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
- <code>false</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a key is released.
- The <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event type is device dependent and relies on the
- capabilities of the input devices and how they are mapped in the operating system.
- This event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>.
- This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
- <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
- and <a class="eventtype" href="#event-type-input"><code>input</code></a>
- events associated with the same key.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_77"><span>Note</span></div><p class=""><strong>Note:</strong> the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup">
- <code>keyup</code></a> events are traditionally associated with detecting any key, not just those which produce a <a class="def" href="#glossary-character-value">character
- value</a>.</p></div>
- </dd>
- </dl>
- </div>
- </section>
-
- <section id="events-compositionevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_events-compositionevents"><span class="secno">5.2.7 </span>Composition Event Types</h4>
-
- <p>Composition Events provide a means for inputing text in a supplementary or alternate manner than by Keyboard Events, in order to allow the use of characters that
- might not be commonly available on keyboard. For example, Composition Events might be used to add accents to characters despite their absence from standard US keyboards,
- to build up logograms of many Asian languages from their base components or categories, to select word choices from a combination of key presses on a mobile device
- keyboard, or to convert voice commands into text using a speech recognition processor. Refer to <a href="#keys">Keyboard events and key values</a> for examples
- on how Composition Events are used in combination with keyboard events.</p>
-
- <p>Conceptually, a composition session consists of one <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> event, one or more
- <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a> events, and one <a class="eventtype" href="#event-type-compositionend">
- <code>compositionend</code></a> event, with the value of the <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute persisting between each <q>stage</q>
- of this event chain during each session.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_78"><span>Note</span></div><p class=""><strong>Note:</strong> While a composition session is active, keyboard events can be dispatched to the DOM if the keyboard is the input device used
- with the composition session. See the <a href="#event-type-compositionstart"><code>compositionstart</code> event details</a> and <a href="#keys-IME">IME section</a>
- for relevent event ordering.</p></div>
-
- <p>Not all <a class="def" href="#glossary-ime">IME</a> systems or devices expose the necessary data to the DOM, so the active composition string (the <q>Reading Window</q>
- or <q>candidate selection menu option</q>) might not be available through this interface, in which case the selection <em class="rfc2119" title="MAY">MAY</em> be represented by the <a class="def" href="#glossary-empty-string">
- empty string</a>.</p>
-
- <section id="interface-CompositionEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-CompositionEvent">Interface CompositionEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The <code>CompositionEvent</code> interface provides specific contextual information associated with Composition Events.</p>
-
- <p>To create an instance of the <code>CompositionEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("CompositionEvent")</code></a>
- method call.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_79"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
- <code>CompositionEvent</code> objects.</p></div>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-CompositionEvent">interface <span class="idlInterfaceID">CompositionEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString?</span> <span class="idlAttrName"><a href="#widl-CompositionEvent-data">data</a></span>;</span>
-};</span></pre><section><h6 id="attributes-8" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-CompositionEvent-data"><code>data</code> of type <span class="idlAttrType">DOMString</span>, readonly , nullable</dt><dd>
- <p><code>data</code> holds the value of the characters generated by an input method. This <em class="rfc2119" title="MAY">MAY</em> be a single Unicode character or a non-empty sequence of Unicode characters
- [<cite><a class="normative" href="#references-Unicode">Unicode</a></cite>]. Characters <em class="rfc2119" title="SHOULD">SHOULD</em> be normalized as defined by the Unicode normalization form <em>NFC</em>,
- defined in [<cite><a class="normative" href="#references-UnicodeNormalization">UAX #15</a></cite>]. This attribute <em class="rfc2119" title="MAY">MAY</em> be null or contain the <a class="def" href="#glossary-empty-string">
- empty string</a>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd></dl></section>
- </section>
-
- <section id="events-composition-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-composition-event-order">Composition Event Order</h5>
-
- <p>The Composition Events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in the following set order relative to one another:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td>Multiple events</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
- </section>
-
- <section id="handwriting" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_handwriting">Handwriting Recognition Systems</h5>
- <p>The following example describes a possible sequence of events when composing a text passage <q>text</q> with a handwriting recognition system, such as on a pen
- tablet, as modeled using Composition Events.</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User writes word on tablet surface</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td><code>'test'</code></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User rejects first word-match suggestion, selects different match</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td><code>'text'</code></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td><code>'text'</code></td>
- </tr>
- </tbody></table>
- </section>
-
- <section id="events-composition-event-canceling" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-composition-event-canceling">Canceling Composition Events</h5>
- <p>If a <code>keydown</code> event is canceled then any Composition Events that would have fired as a result of that <code>keydown</code> <em class="rfc2119" title="SHOULD">SHOULD</em> not be dispatched:</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td>The <a class="def" href="#glossary-default-action">default action</a> is
- prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
- </td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em><abbr title="Number, Other">No</abbr> Composition Events are dispatched</em></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- <p>If the initial <code>compositionstart</code> event is canceled then the text composition session <em class="rfc2119" title="SHOULD">SHOULD</em> be
- terminated. Regardless of whether or not the composition session is terminated, the
- <code>compositionend</code> event <em class="rfc2119" title="MUST">MUST</em> be sent.</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td>The <a class="def" href="#glossary-default-action">default action</a> is
- prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
- </td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em><abbr title="Number, Other">No</abbr> Composition Events are dispatched</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
- </section>
-
- <section id="events-composition-event-key-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-composition-event-key-events">Key Events During Composition</h5>
- <p>During the composition session, all <code>keydown</code> and <code>keyup</code> events <em class="rfc2119" title="SHOULD">SHOULD</em> be suppressed.</p>
-
- <p>If key events are suppressed between <code>compositionstart</code> and <code>compositionend</code>, then the first or last key
- pressed might result in unmatched <code>keydown</code> and <code>keyup</code> events.
- If a <a class="def" href="#glossary-user-agent">user agent</a> suppresses key events during composition,
- then it <em class="rfc2119" title="MUST">MUST</em> ensure that all <code>keydown</code> and <code>keyup</code> events occur in matching pairs.
- </p>
-
- <p>The following event sequence shows how a <a class="def" href="#glossary-user-agent">user agent</a> might insert the extra <code>keyup</code>
- for a <code>keydown</code> that initiated a composition session.</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td>This is key event that initiates the composition.</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td>This event would normally be suppressed because of the ongoing composition session, but it is sent to match the previously sent <code>keydown</code> event.</td>
- </tr>
- </tbody></table>
-
- <p>For the final key event in a composition session, a <a class="def" href="#glossary-user-agent">user agent</a> may choose to either:
- </p>
-
- <p>(A) Suppress both the <code>keydown</code> and <code>keyup</code> events:
- </p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Keydown for key that exits IME suppressed during composition session</em></td>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>A keyup event would normally be sent at this time, but it is suppressed to avoid generating an unmatched keyup event.</em></td>
- </tr>
- </tbody></table>
-
- <p>(B) Insert an extra <code>keydown</code> event to match the <code>keyup</code> that occurs after the composition session ends:
- </p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Keydown for key that exits IME suppressed during composition session</em></td>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td>This is key event that was suppressed earlier. It is sent now to match the upcoming keyup.</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- </section>
-
- <section id="events-composition-event-key-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_events-composition-event-key-events">Input Events During Composition</h5>
-
- <p>During the composition session, the <code>compositionupdate</code> <em class="rfc2119" title="MUST">MUST</em> be dispatched before the <code>beforeinput</code>
- and <code>input</code> events are sent.</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>Any DOM updates occur at this point.</em></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td></td>
- </tr>
- </tbody></table>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_80"><span>Note</span></div><p class=""><strong>Note:</strong> Most IMEs do not support canceling updates during a composition session.</p></div>
- </section>
-
- <p>The composition event types are listed below.</p>
-
- <!-- compositionstart -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-compositionstart"><dfn id="dfn-compositionstart"><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>compositionstart</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Start a new composition session when a <a class="def" href="#glossary-text-composition-system">text composition system</a> is enabled</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the composition</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
- the original string being edited, otherwise the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a <a class="def" href="#glossary-text-composition-system">text composition
- system</a> is enabled and a new composition session is about to begin (or has begun, depending on the <a class="def" href="#glossary-text-composition-system">text composition
- system</a>) in preparation for composing a passage of text. This event type is device-dependent, and <em class="rfc2119" title="MAY">MAY</em> rely upon the capabilities of the text conversion system and how it is
- mapped into the operating system. When a keyboard is used to feed an input method editor, this event type is generated after a <a class="eventtype internalDFN" href="#dfn-keydown"><code>keydown</code></a> event,
- but speech or handwriting recognition systems <em class="rfc2119" title="MAY">MAY</em> send this event type without keyboard events. Some implementations <em class="rfc2119" title="MAY">MAY</em> populate the
- <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute of the <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> event
- with the text currently selected in the document (for editing and replacement). Otherwise, the value of the <a href="#widl-CompositionEvent-data"><code>data</code></a>
- attribute <em class="rfc2119" title="MUST">MUST</em> be the <a class="def" href="#glossary-empty-string">empty string</a>.</p>
-
- <p>This event <em class="rfc2119" title="MUST">MUST</em> be dispatched immediately before a <a class="def" href="#glossary-text-composition-system">text composition system</a> begins a new composition session, and
- before the DOM is modified due to the composition process. The default action of this event is for the <a class="def" href="#glossary-text-composition-system">text
- composition system</a> to start a new composition session. If this event is canceled, the <a class="def" href="#glossary-text-composition-system">text composition system</a> <em class="rfc2119" title="SHOULD">SHOULD</em>
- discard the current composition session.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_81"><span>Note</span></div><p class=""><strong>Note:</strong> Canceling the <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> <em>event type</em> is distinct
- from canceling the <a class="def" href="#glossary-text-composition-system">text composition system</a> itself (e.g., by hitting a cancel button or closing an <a class="def" href="#glossary-ime">IME</a> window).</p></div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_82"><span>Note</span></div><p class=""><strong>Note:</strong> Some IMEs do not support cancelling an in-progress composition session (e.g., such as GTK which doesn't presently have such an API). In these
- cases, calling <a href="#widl-Event-preventDefault"><code>preventDefault</code></a> will not stop this event's default action.</p></div>
- </dd>
- </dl>
- </div>
-
- <!-- compositionupdate -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-compositionupdate"><dfn id="dfn-compositionupdate"><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>compositionupdate</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the composition, <code>null</code> if not accessible</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
- the string comprising the current results of the composition session, which <em class="rfc2119" title="MAY">MAY</em> be the
- <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="SHOULD">SHOULD</em> dispatch this event during a composition session when a
- <a class="def" href="#glossary-text-composition-system">text composition system</a> updates its active text passage with a
- new character, which is reflected in the string in <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a>.
- </p>
-
- <p>In <a class="def" href="#glossary-text-composition-system">text composition systems</a> which keep the ongoing composition in sync
- with the input control, the <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a> event
- <em class="rfc2119" title="MUST">MUST</em> be dispatched before the control is updated.
- </p>
-
- <p>Some <a class="def" href="#glossary-text-composition-system">text composition systems</a> might not expose this information to the DOM,
- in which case this event will not fire during the composition process.
- </p>
-
- <p>If the composition session is canceled, this event will be fired immediately before the
- <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event,
- and the <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a> attribute will be set to the
- <a class="def" href="#glossary-empty-string">empty string</a>.
- </p>
- </dd>
- </dl>
- </div>
-
- <!-- compositionend -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-compositionend"><dfn id="dfn-compositionend"><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>compositionend</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the composition</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
- the string comprising the final result of the composition session, which <em class="rfc2119" title="MAY">MAY</em> be the
- <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted or if the composition process has been canceled</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a
- <a class="def" href="#glossary-text-composition-system">text composition system</a> completes or cancels the current composition session,
- and the <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the control is updated.
- </p>
-
- <p>This event is dispatched immediately after the <a class="def" href="#glossary-text-composition-system">text composition system</a> completes
- the composition session (e.g., the <a class="def" href="#glossary-ime">IME</a> is closed, minimized, switched out of focus, or otherwise dismissed,
- and the focus switched back to the <a class="def" href="#glossary-user-agent">user agent</a>).
- </p>
- </dd>
- </dl>
- </div>
- </section>
-
- </section>
-
- </section> <!-- events-module -->
-
- <!-- Section 6: Keyboard and key values ========================================================-->
- <section id="keys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <!--OddPage--><h2 aria-level="1" role="heading" id="h2_keys"><span class="secno">6. </span>Keyboard events and key values</h2>
-
- <p>This section contains necessary information regarding keyboard events:</p>
-
- <ul>
- <li>Explanation of keyboard layout, mapping, and key values.</li>
- <li>Relations between keys, such as <a class="def" href="#glossary-dead-key">dead keys</a> or modifiers keys.</li>
- <li>Relations between keyboard events and their default actions.</li>
- <li>The set of key values, and guidelines on how to extend this set.</li>
- </ul>
-
- <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_83"><span>Note</span></div><p class=""><strong>Note:</strong> This section uses Serbian and Kanji characters which could be misrepresented or unavailable in the PDF version or printed
- version of this specification.</p></div>
-
- <section id="keyboard-input" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_keyboard-input"><span class="secno">6.1 </span>Keyboard Input</h3>
-
- <p><em>This section is informative</em></p>
-
- <p>The relationship of each key to the complete keyboard has three separate aspects, each of which vary among different models and configurations of keyboards, particularly
- for locale-specific reasons:</p>
-
- <ul>
- <li><strong>Visual markings:</strong> the labels (or <em>legends</em>) that mark each key</li>
- <li><strong>Mechanical layout:</strong> the dimensions, size, and placement of the physical keys on the keyboard</li>
- <li><strong>Functional mapping:</strong> the abstract key-value association of each key.</li>
- </ul>
-
- <p>This specification only defines the functional mapping, in terms of <a href="#keys-keyvalues">key values</a>, but briefly describes <a href="#key-legends">key legends</a>
- and <a href="#keyboard-layout">keyboard layout</a> for background.</p>
-
- <section id="key-legends" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_key-legends"><span class="secno">6.1.1 </span>Key Legends</h4>
-
- <p><em>This section is informative</em></p>
-
- <p>The visual markings normally consist of one or more characters which a keystroke on that key will produce (such as <code class="glyph">'F'</code>, <code class="glyph">
- '8'</code>, or <code class="glyph">'ш'</code>), or names or symbols which indicate that key's function (such as an upward-pointing arrow <code class="glyph">⇧</code> indicating
- <code class="key">'Shift'</code>, or the string <code>'Enter'</code>). Keys are often referred to by this marking (e.g., <q>Press the <code>
- 'Shift'</code> and <code>'F'</code> keys.</q>). However, the visual appearance of the key has no bearing on its digital representation, and
- in many configurations <em class="rfc2119" title="MAY">MAY</em> be completely inaccurate. Even the control and function keys, such as <code>'Enter'</code>, <em class="rfc2119" title="MAY">MAY</em> be mapped to different
- functionality, or even mapped as character keys.</p>
-
- <p>For historical reasons, the character keys are typically marked with the capital-letter equivalents of the character value they produce, e.g., the <code>
- 'F'</code> key (the key marked with the glyph <code class="glyph">'F'</code>), will produce the character value <code class="char">'f'</code> when pressing
- without an active modifier key (<code class="key">'Shift'</code>) or modifier state (<code class="key">'CapsLock'</code>).</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_84"><span>Note</span></div><p class=""><strong>Note:</strong> The key legends for function keys do not normally produce any characters, although the symbol might have a Unicode equivalent. For example, the <code class="key">'Shift'</code> key might bear the symbol <code class="glyph">⇧</code>, which has the <a class="def" href="#glossary-unicode-code-point">Unicode code point</a> <code class="char">
- '\u21E7'</code>, but pressing the <code class="key">'Shift'</code> key will not produce this character value, and there is no <a class="def" href="#glossary-unicode-code-point">
- Unicode code point</a> for <code class="key">'Shift'</code>.</p></div>
- </section>
-
- <section id="keyboard-layout" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keyboard-layout"><span class="secno">6.1.2 </span>Keyboard Layout</h4>
-
- <p><em>This section is informative</em></p>
-
- <p>As with the key labels, the physical layout of the keys on the keyboard does not not affect the digital key value for any given key. It is outside the scope of
- this specification to provide key values based on keyboard layout, particularly since there are so many possible layouts for a keyboard, and since users can change
- the mapping of keys in their operating system, e.g., by selecting a Dvorak <a class="def" href="#glossary-key-mapping">key mapping</a>.</p>
-
- <p>To illustrate the concept of keyboard layout mappings and its relation with keyboard events and key values, on the same keyboard (a PC/AT US keyboard), pressing
- the key labeled <code>Q</code> (with no modifier key activated) will produce different key values based on the mapping. With a typical US <a class="def" href="#glossary-qwerty">
- QWERTY</a> keyboard layout mapping, it will produce the character <code class="glyph">'q'</code> (<code class="char">'\u0071'</code>, Latin Small Letter Q). If
- the keyboard layout mapping is switched to a French mapping, pressing the same key will produce the character <code class="glyph">'a'</code> (<code class="char">'\u0061'</code>,
- Latin Small Letter A). If the keyboard layout mapping is switched to a Serbian (Cyrillic) mapping, pressing the same key will produce the character <code class="glyph">
- 'љ'</code> (<code class="char">'\u0459'</code>, Cyrillic Small Letter LJE).</p>
-
- <p>However, the physical layout of the keys <em class="rfc2119" title="MAY">MAY</em> be of interest to content authors developing games or other applications in which the location of the keys has an ergonomic
- relationship as the desired user interface controls, with little or no attention paid to the representational value of the key itself. For example, many games
- might use the keys <code class="key">'A'</code>, <code class="key">'S'</code>, <code class="key">'D'</code>, and <code class="key">'W'</code> for <code class="key">
- 'left'</code>, <code class="key">'down'</code>, <code class="key">'right'</code>, and <code class="key">'up'</code> respectively. Content authors <em class="rfc2119" title="SHOULD">SHOULD</em>
- provide a means for the user to assign such controller keys to a custom setting appropriate to their keyboard configurations. Implementations <em class="rfc2119" title="MAY">MAY</em> provide a means
- for the user to more comprehensively map the keyboard to their customized keyboard layout, but this is beyond the scope of this specification.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_85"><span>Note</span></div><p class=""><strong>Note:</strong> Don't confuse key values with <em>scan codes</em>, which are the low-level hexadecimal signals produced for each key
- by the keyboard driver software. <em>Scan codes</em> are mapped at the operating system to a <acronym title="Virtual Key">VK</acronym> (<q>virtual key</q>), which
- in turn might be mapped to the user-defined key configuration. Key values are a high-level abstraction of that final mapping.</p></div>
-
- <section id="keyboard-desktop" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keyboard-desktop">Desktop and Laptop Keyboards</h5>
-
- <p>In the case where a content author wishes to rely on the mechanical layout of a desktop or laptop keyboard, this specification suggests the keyboard configuration
- specified in ISO/IEC 9995, parts 2 and 3 [<cite><a class="informative" href="#references-ISO-9995-2-3">ISO-9995-2/3</a></cite>], which defines a common layout for
- primary, secondary, and auxiliary <a class="def" href="#glossary-key-mapping">key mappings</a> on a typical alphanumeric keyboard, as a common layout appropriate
- to some international uses.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_86"><span>Note</span></div><p class=""><strong>Note:</strong> This keyboard layout is still, in essence, a <a class="def" href="#glossary-qwerty">QWERTY</a> keyboard, and will not
- match the keyboards or configurations of many users. Content authors cannot rely upon any particular configuration, and are expected to create content in an internationalized
- and localizable manner.</p></div>
-
- <figure id="figure-keyboard" class="figure" style="text-align: center">
- <object type="image/svg+xml" data="images/ISOIEC-9995-3-FCD-2009A.svg" width="900" height="300">
- <img src="images/ISOIEC-9995-3-FCD-2009A.png" alt="A graphical depiction of an ISO standard defining layouts of computer keyboards, ISO/IEC 9995, parts 2 and 3" />
- </object>
- <figcaption>Fig. <span class="figno">4</span> <span class="fig-title">A graphical depiction of an ISO standard defining layouts of computer keyboards, ISO/IEC 9995, parts 2 and 3</span></figcaption></figure>
- </section>
-
- <section id="keyboard-mobile" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keyboard-mobile">Mobile Keypads</h5>
-
- <p>In the case where a content author wishes to rely on the mechanical layout of a mobile keypad, this specification suggests the keyboard configuration specified
- in ISO/IEC 9995-8:2006 [<cite><a class="informative" href="#references-ISO-9995-8">ISO-9995-8</a></cite>], which defines a numeric keypad layout and secondary assignment
- of Unicode characters in the range <code class="char">'\u0061'</code>..<code class="char">'\u007A'</code> to the number keys <code>2</code> through <code>9</code>, as a common layout appropriate to some
- international uses.</p>
-
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_87"><span>Note</span></div><p class=""><strong>Note:</strong> This keypad layout, and in particular the distribution of letters is for English devices, and will not match the keypads
- or configurations of many users. Content authors cannot rely upon any particular configuration, and are expected to create content in an internationalized and
- localizable manner.</p></div>
-
- <figure id="figure-numberpad" class="figure" style="text-align:center">
- <object type="image/svg+xml" data="images/ISOIEC-9995-8-2006.svg" width="180" height="240">
- <img src="images/ISOIEC-9995-8-2006.png" alt="A graphical depiction of an ISO standard defining layouts of numeric keypads, with distribution of letters on the keys, ISO/IEC 9995-8:2006" />
- </object>
- <figcaption>Fig. <span class="figno">5</span> <span class="fig-title">A graphical depiction of an ISO standard defining layouts of numeric keypads, with distribution of letters on the keys, ISO/IEC 9995-8:2006</span></figcaption></figure>
- </section>
-
- <section id="remote-control" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_remote-control">Media Remote Controls</h5>
-
- <p>Many keyboards contain special keys to control media functions. Increasingly, many media devices, especially televisions, are Web-enabled. Hybrid keyboard/remote-control
- devices are becoming more common. To meet the needs of these hybrid Web/media devices, this specification defines keys that are common as remote control buttons,
- in addition to traditional keyboard keys.</p>
-
- <p>Because of the smaller form factor, keys (or buttons) on a remote control will often be modal, with one key performing different functions based on the context
- of the on-screen content. Additionally, many keys serve as toggles, to change back and forth between two or more states (see toggling keys).</p>
-
- <figure id="figure-remotecontrol" class="figure" style="text-align:center">
- <object type="image/svg+xml" data="images/remote-control.svg" width="102" height="422">
- <img src="images/remote-control.png" alt="A graphical depiction of a media remote control, with buttons mapped to specific keys values" />
- </object>
- <figcaption>Fig. <span class="figno">6</span> <span class="fig-title">A graphical depiction of a media remote control, with buttons mapped to specific keys values</span></figcaption></figure>
-
- </section>
-
- <section id="keyboard-chording-virtual" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keyboard-chording-virtual">Virtual Keyboards and Chording Keyboards</h5>
-
- <p>Virtual keyboards are software-based sets of keys, in a variety of different arrangements, commonly found on touch-screen devices. They are often modal, with the
- ability to switch between different dynamic sets of keys, such as alphabetic, numeric, or symbolic keys. Because of the lack of physical constraints, these keyboards
- <em class="rfc2119" title="MAY">MAY</em> present the widest range of characters, including emoticons and other symbols, and <em class="rfc2119" title="MAY">MAY</em> have keys not represented by Unicode [<a href="#references-Unicode">Unicode</a>]
- or by the <a href="#key-value-tables">key values</a> defined in this specification. Wherever possible, however, virtual keyboards <em class="rfc2119" title="SHOULD">SHOULD</em> produce the normal range
- of keyboard events and values, for ease of authoring and compatibility with existing content.</p>
-
- <p>Chording keyboards, also know as chorded keysets or chord keyboards, are key input devices which produce values by pressing several keys in combination or sequence,
- normally to simulate a full range of characters or commands on a reduced set of keys, often for single-handed use. A chording keyboard <em class="rfc2119" title="MAY">MAY</em> have additional mode
- keys to switch between key values, and the number and type of keys pressed to produce a key value will vary, but the final key values produced by such keyboards
- <em class="rfc2119" title="SHOULD">SHOULD</em> match the range of key values described in this specification.</p>
-
- <p>For these and other alternative modal keyboards, the key values <a href="#key-Alphanumeric"><code class="key">'Alphanumeric'</code></a>, <a href="#key-CapsLock">
- <code class="key">'CapsLock'</code></a>, <a href="#key-NumLock"><code class="key">'NumLock'</code></a>, and <a href="#key-SymbolLock"><code class="key">
- 'SymbolLock'</code></a> are <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> for the keys which switch between different modes.</p>
-
- </section>
-
- </section>
-
- </section>
-
- <section id="keys-keyvalues" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_keys-keyvalues"><span class="secno">6.2 </span>Key Values</h3>
-
- <p>A key value is a <code>DOMString</code> that can be used to indicate any given key on a keyboard, regardless of position or state, by the value it produces. These
- key values <em class="rfc2119" title="MAY">MAY</em> be used as return values for keyboard events generated by the implementation, or as input values by the content author to specify desired input (such
- as for keyboard shortcuts). This specification defines a set of common key values (defined in the <a href="#key-value-tables">Key Value Tables</a>), and rules for production
- of new key values.</p>
-
- <p>Key values can be used to detect the value of a key which has been pressed, using the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
- attribute. Content authors can retrieve the <a class="def" href="#glossary-character-value">
- character value</a> of upper- or lower-case letters, number, symbols, or other character-producing keys, and also the <a class="def" href="#glossary-key-value">key
- value</a> of control keys, modifier keys, function keys, or other keys that do not generate characters. These values can be used for monitoring particular
- input strings, for detecting and acting on modifier key input in combination with other inputs (such as a mouse), for creating virtual keyboards, or for any number
- of other purposes.</p>
-
- <p>Key values can also be used by content authors in string comparisons, as values for markup attributes (such as the HTML <code>accesskey</code>) in conforming <a class="def" href="#glossary-host-language">host languages</a>, or for other related purposes. A conforming <a class="def" href="#glossary-host-language">host language</a>
- <em class="rfc2119" title="SHOULD">SHOULD</em> allow content authors to use either of the two equivalent string values for a key value: the <a class="def" href="#glossary-character-value">character value</a>,
- or the <a class="def" href="#glossary-key-value">key value</a>.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_88"><span>Note</span></div><p class=""><strong>Note:</strong> While implementations will use the most relevant value for a key independently of the platform or keyboard layout mappings,
- content authors can not make assumptions on the ability of keyboard devices to generate them. When using keyboard events and key values for shortcut-key combinations,
- content authors can <q>consider using numbers and function keys (F4, F5, and so on) instead of letters</q> ([<cite><a class="informative" href="#references-DWW95">DWW95</a></cite>])
- given that most keyboard layouts will provide keys for those.</p></div>
-
- <p>A key value does not indicate a specific key on the physical keyboard, nor does it reflect the character printed on the key. A key
- value indicates the current value of the event with consideration to the current state of all active keys and key input modes (including shift modes and <a class="def" href="#glossary-dead-key">dead keys</a>), as reflected in the operating-system mapping of the keyboard and reported to the implementation. In other words, the
- key value for the key marked <code class="glyph">'O'</code> on a <a class="def" href="#glossary-qwerty">QWERTY</a> keyboard has the key value <code class="key">'o'</code> in an unshifted
- state, <code class="key">'O'</code> in a shifted state, <code class="key">'ö'</code> in an unshifted state during a dead-key operation to add an umlaut diacritic, and <code class="key">'Ö'</code>
- in a shifted state during a dead-key operation to add an umlaut diacritic. Because a user can map their keyboard to an arbitrary custom configuration, the content
- author is encouraged not to assume that a relationship exists between the shifted and unshifted states of a key and the majuscule form (uppercase or capital letters)
- and minuscule form (lowercase or small letters) of a character representation, but is encouraged instead to use the value of the <a href="#widl-KeyboardEvent-key">
- <code>KeyboardEvent.key</code></a> attribute. The keyboard depicted in <a href="#figure-keyboard" class="fig-ref">
- Figure 4</a> illustrates one possible set of <a class="def" href="#glossary-key-mapping">key mappings</a> on one possible keyboard layout. Many others exist,
- both standard and idiosyncratic.</p>
-
- <p>It is also important to note that there is not a one-to-one relationship between key event states and key values. A particular key value might be associated with
- multiple keys. For example, many standard keyboards contain more than one key with the <code class="key">'Shift'</code> key value (normally distinguished by the
- <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> values <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_LEFT"><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></a>
- and <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_RIGHT"><code class="constant-name">DOM_KEY_LOCATION_RIGHT</code></a>) or <code class="key">'8'</code> key value (normally
- distinguished by the <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> values
- <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code class="constant-name">DOM_KEY_LOCATION_STANDARD</code></a>
- and <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_NUMPAD"><code class="constant-name">DOM_KEY_LOCATION_NUMPAD</code></a>), and user-configured
- custom keyboard layouts <em class="rfc2119" title="MAY">MAY</em> duplicate any key value in multiple key-state scenarios (note that <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>
- is intended for standard keyboard layouts, and cannot always indicate a meaningful distinction).</p>
-
- <p>Finally, the meaning of any given character representation is context-dependent and complex. For example, in some contexts, the asterisk (star) glyph (<code class="glyph">'*'</code>) represents a footnote or emphasis (when bracketing a passage of text). However, in some documents or executable programs it is equivalent
- to the mathematical multiplication operation, while in other documents or executable programs, that function is reserved for the multiplication symbol (<code class="glyph">'×'</code>,
- Unicode value <code class="char">'\u00D7'</code>) or the Latin small letter <code>'x'</code> (due to the lack of a multiplication key on many keyboards
- and the superficial resemblance of the glyphs <code class="glyph">'×'</code> and <code class="glyph">'x'</code>). Thus, the semantic meaning or function of
- character representations is outside the scope of this specification.</p>
-
- <section id="keys-unicode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-unicode"><span class="secno">6.2.1 </span>Key Values and Unicode</h4>
-
- <p>The <a class="def" href="#glossary-character-value">character values</a> described in this specification are Unicode [<a href="#references-Unicode">Unicode</a>]
- codepoints, and as such, have certain advantages.</p>
-
- <p>The most obvious advantage is that it allows the content author to use the full range of internationalized language functionality available in the implementation,
- regardless of the limitations of the text input devices on the system. This opens up possibilities for virtual keyboards and Web-application-based <a class="def" href="#glossary-ime">input method editors</a>.</p>
-
- <p>Another benefit is that it allows the content author to utilize the Unicode general category properties programmatically.</p>
-
- <p>With legacy keyboard event attributes such as <code class="attribute-name">keyCode</code> and <code class="attribute-name">charCode</code>, content authors are forced to
- filter key input using cryptic, platform- and implementation-specific numeric codes, with poor internationalization, such as the following pseudocode:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <pre><code>if ( ( event.charCode == 45 || event.charCode == 36 ) ||
- ( event.charCode >= 48 && event.charCode <= 57 ) ||
- ( event.charCode >= 96 && event.charCode <= 105 ) ) {
- <span class="comment">// minus sign, dollar sign, and numeric characters from keyboard and numpad</span>
- <span class="comment">// ...</span>
-}
-else if ( ( event.charCode >= 65 && event.charCode <= 90 ) ||
- ( event.charCode >= 97 && event.charCode <= 122 ) ) {
- <span class="comment">// alphabetic characters from Latin character set, A-Z, a-z</span>
- <span class="comment">// ...</span>
-}
-else {
- <span class="comment">// ...</span>
-}
-</code></pre>
- </div>
-
- <p>With key values and regular expressions, however, content authors can support selective and intuitive ranges for key-based input, in a cross-platform manner with
- advanced internationalization support, such as the following pseudocode:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <pre><code>if ( event.key == "-" || event.key.match("\p{Sc}") || event.key.match("\p{N}") ) {
- <span class="comment">// minus sign, any currency symbol, and numeric characters (regardless of key location)</span>
- <span class="comment">// ...</span>
-}
-else if ( event.key.match("\p{L}") ) {
- <span class="comment">// alphabetic characters from any language, upper and lower case</span>
- <span class="comment">// ...</span>
-}
-else {
- <span class="comment">// ...</span>
-}
-</code></pre>
- </div>
-
- <p>In addition, because Unicode categorizes each assigned <a class="def" href="#glossary-unicode-code-point">code point</a> into a group of code points used by a particular
- human writing system, even more advanced capabilities are possible.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A content author can match characters from a particular human script (e.g., Tibetan) using a regular expression such as
- <code>\p{Tibetan}</code>, to filter out other characters, or discover if a <a class="def" href="#glossary-unicode-code-point">code point</a> is in
- a certain code block (range of code points), using a regular expression like <code>\p{InCyrillic}</code>.</p>
- </div>
-
- <p>To facilitate this, implementations <em class="rfc2119" title="SHOULD">SHOULD</em> support Unicode range detection using regular expressions, in a manner such as the Perl Compatible Regular Expressions
- (PCRE) [<a href="#references-pcre">PCRE</a>].</p>
- </section>
-
- <section id="keys-Modifiers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-Modifiers"><span class="secno">6.2.2 </span>Modifier keys</h4>
-
- <p>Keyboard input uses modifier keys to change the normal behavior of a key. Like other keys, modifier keys generate <a class="eventtype" href="#event-type-keydown">
- <code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events, as shown in the example below. Some modifiers are activated
- while the key is being pressed down or maintained pressed such as <code class="key">'Alt'</code>, <code class="key">'Control'</code>, <code class="key">'Shift'</code>,
- <code class="key">'AltGraph'</code>, or <code class="key">'Meta'</code>. Others modifiers are activated depending on their state such as <code class="key">'CapsLock'</code>,
- <code class="key">'NumLock'</code>, or <code class="key">'ScrollLock'</code>. Change in the state happens when the modifier key is being pressed down. The <a href="#interface-KeyboardEvent">
- <code>KeyboardEvent</code></a> interface provides convenient attributes for some common modifiers keys: <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a>,
- <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a>, <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a>,
- <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a>. Some operating systems simulate the <code class="key">'AltGraph'</code> modifier
- key with the combination of the <code class="key">'Alt'</code> and <code class="key">'Control'</code> modifier keys. Implementations are encouraged to use the
- <code class="key">'AltGraph'</code> modifier key.</p>
-
- <p>The following example describes a possible sequence of events associated with the generation of the Unicode character Q (Latin Capital Letter Q, <a class="def" href="#glossary-unicode-code-point">Unicode code point</a> <code class="char">'\u0051'</code>) on a PC/AT US keyboard using a US mapping:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td><code class="attribute-name">shiftKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td><code class="attribute-name">shiftKey</code></td>
- <td>Latin Capital Letter Q</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td class="cell-center"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td><code class="attribute-name">shiftKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>The following example describes an alternate sequence of keys to the example above, where the <code class="key">'Shift'</code> key is released before the <code class="key">'Q'</code> key. The key value for the key labeled <code class="key">'Q'</code> will revert to its unshifted value for the <a class="eventtype" href="#event-type-keyup">
- <code>keyup</code></a> event:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td><code class="attribute-name">shiftKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td><code class="attribute-name">shiftKey</code></td>
- <td>Latin Capital Letter Q</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td class="cell-center"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'q'</code></td>
- <td></td>
- <td>Latin Small Letter Q</td>
- </tr>
- </tbody></table>
- </div>
-
- <p>The following example describes a possible sequence of keys that does not generate a Unicode character (using the same configuration):</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'v'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td>Latin Small Letter V</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'v'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td>Latin Small Letter V</td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>The following example shows the sequence of events when both <code class="key">'Shift'</code> and <code class="key">'Control'</code> are pressed:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'V'</code></td>
- <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
- <td>Latin Capital Letter V</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'V'</code></td>
- <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
- <td>Latin Capital Letter V</td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>For non-US keyboard layouts, the sequence of events is the same, but the value of the key is based on the current
- keyboard layout. The following example shows a sequence of events when an Arabic keyboard layout is used:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'ر'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td>Arabic Letter Reh</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'ر'</code></td>
- <td><code class="attribute-name">ctrlKey</code></td>
- <td>Arabic Letter Reh</td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Control'</code></td>
- <td></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_89"><span>Note</span></div><p class=""><strong>Note:</strong> The value in the keydown and keyup events varies based on the current keyboard layout
- in effect when the key is pressed. This means that the <code class="key">'v'</code> key on a US layout and the
- <code class="key">'ر'</code> key on an Arabic layout will generate different events even though they are the same physical
- key. To identify these events as coming from the same physical key, you will need to make use of the <code>code</code> attribute
- as specified in the [<a href="#references-UIEvents">UI Events</a>] specification.</p></div>
-
- <p>In some cases, modifier keys change the key value value for a key event. For example, on some MacOS keyboards, the key labeled <code>'delete'</code>
- functions the same as the <code class="key">'Backspace'</code> key on the Windows OS when unmodified, but when modified by the <code class="key">'Fn'</code>
- key, acts as the <code class="key">'Del'</code> key, and the value of the key value will match the most appropriate function of the key in its current modified
- state.</p>
-
- </section>
-
- <section id="keys-DeadKeys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-DeadKeys"><span class="secno">6.2.3 </span>Dead keys</h4>
-
- <p>Some keyboard input uses <a class="def" href="#glossary-dead-key">dead keys</a> for the input of composed character sequences. Unlike the handwriting sequence,
- in which users enter the base character first, keyboard input requires to enter a special state when a <a class="def" href="#glossary-dead-key">dead key</a> is
- pressed and emit the character(s) only when one of a limited number of <q>legal</q> base character is entered.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_90"><span>Note</span></div><p class=""><strong>Note:</strong> The MacOS and Linux operating systems use input methods to process
- <a class="def" href="#glossary-dead-key">dead keys</a>.
- </p></div>
-
- <p>The <a class="def" href="#glossary-dead-key">dead keys</a> are represented in the key values set using combining diacritical marks. While Unicode combining characters
- always follow the handwriting sequence, with the combining character trailing the corresponding letter, typical deadkey input <em class="rfc2119" title="MAY">MAY</em> reverse the sequence, with the
- combining character before the corresponding letter. For example, the word <em>naïve</em>, using the combining diacritic <em>¨</em>, would be represented sequentially
- in Unicode as <em>nai¨ve</em>, but <em class="rfc2119" title="MAY">MAY</em> be typed <em>na¨ive</em>. The sequence of keystrokes <code class="char">'\u0302'</code> (Combining Circumflex Accent key) and <code class="char">'\u0065'</code>
- (key marked with the Latin Small Letter E) will likely produce (on a PC/AT french keyboard using a french mapping and without any modifier activated) the Unicode
- character <code class="glyph">'ê'</code> (Latin Small Letter E With Circumflex), as preferred by the Unicode Normalization Form <em>NFC</em>:</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_91"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>keydown</code> and <code>keyup</code> events shown in these
- examples would normally be suppressed during the composition session.
- They are included in these examples to make the user actions (pressing and releasing keys) more apparent.
- </p></div>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br>data</code></a></th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td>Combining Circumflex Accent</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="char">'\u0302'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'ê'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'ê'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'ê'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'e'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter E</td>
- </tr>
- </tbody></table>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_92"><span>Note</span></div><p class=""><strong>Note:</strong> In the second <code>keydown</code> event (step 5), the key value
- (assuming the event is not suppressed) will
- <em>not</em> be <code class="key">'e'</code> (Latin Small Letter E key) under normal circumstances
- because the value delivered to the user agent will already be modified by the dead key operation.</p></div>
-
- <p>This process might be aborted when a user types an unsupported base character (that is, a base character for which the which the active diacritical mark is not
- available) after pressing a <a class="def" href="#glossary-dead-key">dead key</a>:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br>data</code></a></th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td>Combining Circumflex Accent</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="char">'\u0302'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'q'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter Q</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'q'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
- </section>
-
- <section id="keys-IME" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-IME"><span class="secno">6.2.4 </span>Input Method Editors</h4>
-
- <p>This specification includes a model for <a class="def" href="#glossary-ime">input method editors (IMEs)</a>, through the <a href="#interface-CompositionEvents">CompositionEvent</a>
- interface and events. However, Composition Events and Keyboard Events do not necessarily map as a one-to-one relationship. As an example, receiving a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> for the <a href="#key-Accept"><code class="key">'Accept'</code></a> key value does not necessarily imply
- that the text currently selected in the <a class="def" href="#glossary-ime">IME</a> is being accepted, but indicates only that a keystroke happened, disconnected
- from the <a class="def" href="#glossary-ime">IME</a> Accept functionality (which would normally result in a <a class="eventtype" href="#event-type-compositionend">
- <code>compositionend</code></a> event in most <a class="def" href="#glossary-ime">IME</a> systems). Keyboard events cannot be used to determine the current
- state of the input method editor, which can be obtained through the <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute of the <a href="#interface-CompositionEvents">
- CompositionEvent</a> interface. Additionally, <a class="def" href="#glossary-ime">IME</a> systems and devices vary in their functionality, and in which keys
- are used for activating that functionality, such that the <code class="key">'Convert'</code> and <code class="key">'Accept'</code> keys <em class="rfc2119" title="MAY">MAY</em> be represented
- by other available keys. Keyboard events correspond to the events generated by the input device after the keyboard layout mapping.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_93"><span>Note</span></div><p class=""><strong>Note:</strong> In some implementations or system configurations, some key events, or their values, might be suppressed
- by the <a class="def" href="#glossary-ime">IME</a> in use.</p></div>
-
- <p>The following example describes a possible sequence of keys to generate the Unicode character <code class="glyph">'市'</code> (Kanji character, part of CJK Unified Ideographs) using Japanese
- input methods. This example assumes that the input method editor is activated and in the Japanese-Romaji input mode. The keys <code class="key">'Convert'</code>
- and <code class="key">'Accept'</code> <em class="rfc2119" title="MAY">MAY</em> be replaced by others depending on the input device in use and the configuration of the IME, e.g., it can be respectively
- <code class="char">'\u0020'</code> (Space key) and <code class="key">'Enter'</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_94"><span>Note</span></div><p class=""><strong>Note:</strong> <code class="glyph">'詩'</code> (<q>poem</q>) and <code class="glyph">'市'</code> (<q>city</q>) are homophones, both
- pronounced し (<q>shi</q>), so the user needs to use the <code class="key">'Convert'</code> key to select the proper option.</p></div>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br>data</code></a></th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter S</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'i'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter I</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'し'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'i'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td>Convert</td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'詩'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">10.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">11.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td>Convert</td>
- </tr>
- <tr>
- <td class="cell-number">12.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'市'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">13.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">14.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Accept'</code></td>
- <td class="cell-center"></td>
- <td>Accept</td>
- </tr>
- <tr>
- <td class="cell-number">15.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'市'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">16.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Accept'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>IME composition can also be canceled as in the following example, with conditions identical to the previous example. The key <a href="#key-Cancel"><code class="key">
- 'Cancel'</code></a> might also be replaced by others depending on the input device in use and the configuration of the IME, e.g., it could be <code class="char">'\u001B'</code>
- (Escape key).</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br>data</code></a></th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter S</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'s'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'i'</code></td>
- <td class="cell-center"></td>
- <td>Latin Small Letter I</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'し'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'i'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td>Convert</td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'詩'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">10.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">11.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td>Convert</td>
- </tr>
- <tr>
- <td class="cell-number">12.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'市'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">13.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Convert'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">14.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Cancel'</code></td>
- <td class="cell-center"></td>
- <td>Cancel</td>
- </tr>
- <tr>
- <td class="cell-number">15.</td>
- <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">16.</td>
- <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">''</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">17.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Cancel'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_95"><span>Note</span></div><p class=""><strong>Note:</strong> Some <a class="def" href="#glossary-ime">input method editors</a> (such as on the MacOS operating system) might set an <a class="def" href="#glossary-empty-string">
- empty string</a> to the composition data attribute before canceling a composition.</p></div>
-
- <h4 id="x6.2.4.1-input-method-editor-mode-keys"><a id="keys-IME_keys" href="#keys-IME_keys">6.2.4.1 Input Method Editor mode keys</a></h4>
- <div>
-
- <p>Some keys on certain devices are intended to activate <a class="def" href="#glossary-ime">input method editor</a> functionality, or to change the mode of an active
- <a class="def" href="#glossary-ime">input method editor</a>. Custom keys for this purpose can be defined for different devices or language modes. The keys defined
- in this specification for this purpose are: <code>Alphanumeric</code>, <code>CodeInput</code>, <code>FinalMode</code>, <code>HangulMode</code>, <code>HanjaMode</code>,
- <code>Hiragana</code>, <code>JunjaMode</code>, <code>KanaMode</code>,
- <code>KanjiMode</code>, <code>Katakana</code>, and <code>RomanCharacters</code>. When one of these keys is pressed, and no <a class="def" href="#glossary-ime">IME</a>
- is currently active, the appropriate <a class="def" href="#glossary-ime">IME</a> is expected to be activated in the mode indicated by the key (if available). If
- an <a class="def" href="#glossary-ime">IME</a> is already active when the key is pressed, the active <a class="def" href="#glossary-ime">IME</a> might change to
- the indicated mode, or a different <a class="def" href="#glossary-ime">IME</a> might be launched, or the might <em class="rfc2119" title="MAY">MAY</em> be ignored, on a device- and application-specific
- basis.</p>
-
- <p>This specification also defines other keys which are intended for operation specifically with <a class="def" href="#glossary-ime">input method editors</a>: <code>
- Accept</code>, <code>AllCandidates</code>, <code>Cancel</code>, <code>Convert</code>, <code>Compose</code>, <code>FullWidth</code>, <code>HalfWidth</code>, <code>NextCandidate</code>,
- <code>Nonconvert</code>, and <code>PreviousCandidate</code>. The functions of these keys are not defined in this specification — refer to other resources for details
- on <a class="def" href="#glossary-ime">input method editor</a> functionality.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_96"><span>Note</span></div><p class=""><strong>Note:</strong> Keys with <a class="def" href="#glossary-ime">input method editor</a> functions are not restricted to that purpose, and can have other device- or implementation-specific
- purposes.</p></div>
- </div>
- </section>
-
- <section id="keys-cancelable_keys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-cancelable_keys"><span class="secno">6.2.5 </span>Default actions and cancelable keyboard events</h4>
-
- <p>Canceling the <a class="def" href="#glossary-default-action">default action</a> of a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event
- <em class="rfc2119" title="MUST NOT">MUST NOT</em> affect its respective <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event, but it <em class="rfc2119" title="MUST">MUST</em> prevent the respective
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and
- <a class="eventtype" href="#event-type-input"><code>input</code></a> events
- from being generated. The following example describes a possible sequence of keys
- to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br>data</code></a></th>
- <th class="cell-center">Modifiers</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td>The <a class="def" href="#glossary-default-action">default action</a> is
- prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
- </td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="5">
- <em><abbr title="Number, Other">No</abbr> <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> or
- <a class="eventtype" href="#event-type-input"><code>input</code></a> events are generated</em>
- </td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>If the key is a modifier key, the keystroke <em class="rfc2119" title="MUST">MUST</em> still be taken into account for the modifiers states. The following example describes a possible sequence of keys
- to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br>data</code></a></th>
- <th class="cell-center">Modifiers</th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td>The <a class="def" href="#glossary-default-action">default action</a> is
- prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
- </td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Q'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'Shift'</code></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
-
- <p>If the key is part of a sequence of several keystrokes, whether it is a <a class="def" href="#glossary-dead-key">dead key</a> or it is contributing to an Input
- Method Editor sequence, the keystroke <em class="rfc2119" title="MUST">MUST</em> be ignored (not taken into account) only if the <a class="def" href="#glossary-default-action">default action</a> is
- canceled on the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event.
- Canceling a <a class="def" href="#glossary-dead-key">dead key</a>
- on a <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event has no effect on
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> or
- <a class="eventtype" href="#event-type-input"><code>input</code></a> events.
- The following example uses the keystrokes <code class="char">'\u0302'</code> (Combining Circumflex Accent key) and the key marked <code class="key">
- 'e'</code> (<code class="char">'\u0065'</code>, Latin Small Letter E key) (on a PC/AT French keyboard using a French mapping and without any modifier activated):</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br>data</code></a></th>
- <th>Notes</th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td>The <a class="def" href="#glossary-default-action">default action</a> is
- prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
- </td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'\u0302'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'e'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'e'</code></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'e'</code></td>
- <td class="cell-center"></td>
- <td></td>
- </tr>
- </tbody></table>
- </div>
- </section>
-
- <section id="keys-Guide" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-Guide"><span class="secno">6.2.6 </span>Guidelines for selecting and defining key values</h4>
-
- <p><strong>This section is normative.</strong></p>
-
- <p>The list of key values contained in this specification is not exhaustive, and input devices <em class="rfc2119" title="MAY">MAY</em> have to define their own key values. Consider the current function
- of the key (i.e., with modifiers), taking into consideration the keyboard layout mapping in use, to determine if the key is represented by the set of defined key
- values, if a corresponding Unicode character exists from which a key value <em class="rfc2119" title="MAY">MAY</em> be derived, or if a new key value <em class="rfc2119" title="MUST">MUST</em> be defined. The following algorithm determines
- the <em>key value</em> and <em>character value</em> to use:</p>
-
- <ol class="algo" id="key-algorithm">
- <li>If the primary current function of the key is to generate a character, then:
- <ol class="algo">
- <li>If there exists an appropriate character in the <a href="#keys-keyvalues">key values set</a>, then
- the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
- of the <em>key value</em> of that character.</li>
- <li>If there is no appropriate key value in the <a href="#keys-keyvalues">key values set</a>, and there exists an appropriate <a class="def" href="#glossary-unicode-code-point">
- Unicode code point</a>, then
- the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
- of the <em>char value</em> of that character.</li>
- </ol>
- </li>
- <li>If the primary current function of the key is to serve as a function key, then:
- <ol class="algo">
- <li>If there exists an appropriate key value in the <a href="#keys-keyvalues">key values set</a>, then:
- the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
- of the <em>key value</em> of that character.</li>
- </ol>
- </li>
- </ol>
-
- <div class="example">
- <div class="example-title"></div>
- <ul>
- <li>On a PC/AT US keyboard with a right-handed single-hand Dvorak <a class="def" href="#glossary-key-mapping">key mapping</a>, the key labeled <code class="key">
- 'Q'</code> maps to the key values <code class="key">'5'</code> (unmodified) and <code class="key">'%'</code> (shifted). The primary function of this key
- is to generate the character <code class="key">'5'</code> (<code class="char">'\u0035'</code>). Since this character is a character (in Unicode general category
- <abbr title="Number, Decimal Digit">Nd</abbr>), the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
- attribute value for the unmodified key will be <code class="key">'5'</code>.
- </li>
- <li>On a French PC keyboard with a standard French mapping, the primary function of the <code class="key">'^'</code> key is as a
- <a class="def" href="#glossary-dead-key">dead key</a> for the circumflex diacritical mark.
- The Unicode value for this key is <code class="char">'\u0302'</code>.
- </li>
- <li>On a Korean PC keyboard with a standard Korean mapping, the primary function of the <code class="key">'Ha/En'</code> key is to switch between Hangul and English
- input. The predefined key value list has an appropriate entry for this key, <code class="key">'HangulMode'</code>, so this will be the key value.
- </li>
- <li>On some models of mobile devices, there are special keys to launch specific applications.
- For a standard application like Calendar, there is a predefined key value of <code class="key">'LaunchCalendar'</code>.
- For applications not listed in the key value list, a new value can be devised.
- </li>
- </ul>
- </div>
- </section>
- </section>
-
- <section id="key-value-tables" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_key-value-tables"><span class="secno">6.3 </span>Key Value Tables</h3>
-
- <p>This section defines a list of key values which implementations <em class="rfc2119" title="MUST">MUST</em> support, at a minimum, in addition to support for the full range of Unicode [<a href="#references-Unicode">Unicode</a>]
- codepoints. Implementations <em class="rfc2119" title="MAY">MAY</em> support additional key values, in a manner conforming to the <a href="#keys-Guide">guidelines for selecting and defining key values</a>.
- The <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute of an event <em class="rfc2119" title="MUST">MUST</em> always contain one of these control key
- or character values (even if the value is <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>). If the key represents one of the set of printable
- control characters which has a Unicode character entry, such as the tab key, the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute
- <em class="rfc2119" title="MUST">MUST</em> have the key value (e.g., <a href="#key-Tab"><code class="key">'Tab'</code></a>).</p>
-
- <p>Implementations that are unable to identify a key <em class="rfc2119" title="MUST">MUST</em> use the key value <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> Conforming implementations <em class="rfc2119" title="MUST">MUST</em> only use <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>
- as a key value when there is no way for the implementation to detect the key value.
- Exposing only this value <em class="rfc2119" title="MUST NOT">MUST NOT</em> indicate a conforming implementation.</p>
-
- <p>The <a class="def" href="#glossary-key-value">key values</a> defined in this specification are based in part on the sets of keycodes from
- the <code>java.awt.event.KeyEvent</code> interface of the Java Platform, Standard Edition 6 API Specification
- [<cite><a class="informative" href="#references-KeyEvent">KeyEvent for Java</a></cite>],
- and the <code>System.Windows.Forms.Keys</code> key enumeration of the Microsoft .NET Framework 4.0 Class Library
- [<cite><a class="informative" href="#references-Keys">Keys enumeration for .Net</a></cite>].
- </p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_97"><span>Note</span></div><p class=""><strong>Note:</strong> The keys on the numeric keypad (e.g., the keypad <code>'1'</code> key) do not generate distinct <code>key</code> values
- from their non-keypad counterparts (e.g., the <code>'1'</code> key in the main part of the keyboard).
- The <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> attribute can be used to determine if a key originated from the numeric keypad.</p></div>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_98"><span>Note</span></div><div class="">
- <p><strong>Note:</strong> There are special internationalization considerations for ECMAScript escaped characters. CharMod conformance [<cite><a class="normative" href="#references-charmod">CharMod</a></cite>] <a href="http://www.w3.org/TR/charmod/#C045">expects</a> the use of code points rather than surrogate pairs in escapes.
- ECMAScript escaped characters use surrogate pairs for characters outside the Basic Multilingual Plane (<code class="char">"\uD84E\uDDC2"</code> for <code class="glyph">'𣧂'</code>,
- a Chinese character meaning <q>untidy</q>), rather than C-style fixed-length characters (<code class="char">"\U000239c2"</code> for <code class="glyph">'𣧂'</code>) or delimited escapes
- such as Numeric Character References (<code>"&#x239C2;"</code>). Characters escaped in this manner:</p>
-
- <ul>
- <li>are based on UTF-16 encoding, in that it uses surrogate pairs for values outside the Basic Multilingual Plane</li>
- <li>are expressed using surrogate pairs, which makes it difficult for a human to look up the value, and might require unnecessary overhead for machine processing
- — this can also cause problems with software written in the incorrect belief that Unicode is a 16-bit character set</li>
- <li>are problematic for characters on supplementary planes (emoji, or Chinese characters on plane 2), some of which are expected to be input using a keyboard</li>
- <li>are not be suitable for Java or C, which use different escaping mechanisms (could be solved with a normalizing method)</li>
- </ul>
- </div></div>
-
- <p>The following sub-sections contain the normative list of case-sensitive key values, their character values (where applicable), an informative description of typical usage,
- and an informative categorization. A conforming implementation of the <a href="#interface-KeyboardEvent">KeyboardEvent</a> interface <em class="rfc2119" title="MUST">MUST</em> support at least this set
- of values for use in the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
- attributes, though not all values <em class="rfc2119" title="MAY">MAY</em> be available on all platforms or devices.</p>
-
- <p>Future versions of this specification <em class="rfc2119" title="MAY">MAY</em> include key values not included here, which have become common since the publication of this specification.</p>
-
- <section id="keys-special" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-special"><span class="secno">6.3.1 </span>Special Key Values</h4>
-
- <!-- Key tables. Note that all keys must be defined within a <div class="key-table"> -->
- <div id="key-table-general" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Unidentified" class="key">'Unidentified'</code></td><td>This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints.</td></tr></tbody></table></div>
- </section><!-- keys-general -->
-
- <section id="keys-modifier" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-modifier"><span class="secno">6.3.2 </span>Modifier Keys</h4>
- <div id="key-table-modifier" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Alt" class="key">'Alt'</code></td><td>The Alternative (Alt, Option, Menu) key. Enable alternate modifier function for interpreting concurrent or subsequent keyboard input.
- This key value is also used for the Apple <code>'Option'</code> key.
- </td></tr><tr><td class="key-table-key"><code id="key-AltGraph" class="key">'AltGraph'</code></td><td>The Alternate Graphics (AltGr or AltGraph) key.
- This key is used enable the ISO Level 3 shift modifier (the standard <code>'Shift'</code> key is the level 2 modifier).
- </td></tr><tr><td class="key-table-key"><code id="key-CapsLock" class="key">'CapsLock'</code></td><td>The Caps Lock (Capital) key.
- Toggle capital character lock function for interpreting subsequent keyboard input event.
- </td></tr><tr><td class="key-table-key"><code id="key-Control" class="key">'Control'</code></td><td>The Control (Ctrl) key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-Fn" class="key">'Fn'</code></td><td>The Function switch (Fn) key.
- Activating this key simultaneously with another key changes that key's value to an alternate character or function.
- This key is often handled directly in the keyboard hardware and does not usually generate key events.
- </td></tr><tr><td class="key-table-key"><code id="key-FnLock" class="key">'FnLock'</code></td><td>The Function-Lock (FnLock, F-Lock) key.
- Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function.
- This key is often handled directly in the keyboard hardware and does not usually generate key events.
- </td></tr><tr><td class="key-table-key"><code id="key-Hyper" class="key">'Hyper'</code></td><td>The Hyper key.</td></tr><tr><td class="key-table-key"><code id="key-Meta" class="key">'Meta'</code></td><td>The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input.
- This key value is also used for the Apple <code>'Command'</code> key.
- </td></tr><tr><td class="key-table-key"><code id="key-NumLock" class="key">'NumLock'</code></td><td>The Number Lock key, to toggle numer-pad mode function for interpreting subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-OS" class="key">'OS'</code></td><td>The operating system key (e.g. the <q>Windows Logo</q> key).</td></tr><tr><td class="key-table-key"><code id="key-Shift" class="key">'Shift'</code></td><td>The Shift key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-Super" class="key">'Super'</code></td><td>The Super key.</td></tr><tr><td class="key-table-key"><code id="key-Symbol" class="key">'Symbol'</code></td><td>The Symbol modifier key (used on some virtual keyboards).</td></tr><tr><td class="key-table-key"><code id="key-SymbolLock" class="key">'SymbolLock'</code></td><td>The Symbol Lock key.</td></tr></tbody></table></div>
- </section><!-- keys-modifier -->
-
- <section id="keys-whitespace" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-whitespace"><span class="secno">6.3.3 </span>Whitespace Keys</h4>
- <div id="key-table-whitespace" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Enter" class="key">'Enter'</code></td><td>The Enter key, to activate current selection or accept current input.
- This key value is also used for the <code class="key">'Return'</code> (Macintosh numpad) key.
- </td></tr><tr><td class="key-table-key"><code id="key-Separator" class="key">'Separator'</code></td><td>The Separator key, for context-sensitive text separators.</td></tr><tr><td class="key-table-key"><code id="key-Tab" class="key">'Tab'</code></td><td>The Horizontal Tabulation (Tab) key.</td></tr></tbody></table></div>
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_99"><span>Note</span></div><p class=""><strong>Note:</strong> The space or spacebar key is encoded as <code class="glyph">' '</code>.
- </p></div>
- </section><!-- keys-whitespace -->
-
- <section id="keys-navication" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-navication"><span class="secno">6.3.4 </span>Navigation Keys</h4>
- <div id="key-table-navigation" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-ArrowDown" class="key">'ArrowDown'</code></td><td>The down arrow key, to navigate or traverse downward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowLeft" class="key">'ArrowLeft'</code></td><td>The left arrow key, to navigate or traverse leftward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowRight" class="key">'ArrowRight'</code></td><td>The right arrow key, to navigate or traverse rightward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowUp" class="key">'ArrowUp'</code></td><td>The up arrow key, to navigate or traverse upward.</td></tr><tr><td class="key-table-key"><code id="key-End" class="key">'End'</code></td><td>The End key, used with keyboard entry to go to the end of content.</td></tr><tr><td class="key-table-key"><code id="key-Home" class="key">'Home'</code></td><td>The Home key, used with keyboard entry, to go to start of content.</td></tr><tr><td class="key-table-key"><code id="key-PageDown" class="key">'PageDown'</code></td><td>The Page Down key, to scroll down or display next page of content.</td></tr><tr><td class="key-table-key"><code id="key-PageUp" class="key">'PageUp'</code></td><td>The Page Up key, to scroll up or display previous page of content.</td></tr></tbody></table></div>
- </section><!-- keys-navigation -->
-
- <section id="keys-editing" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-editing"><span class="secno">6.3.5 </span>Editing Keys</h4>
- <div id="key-table-editing" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Backspace" class="key">'Backspace'</code></td><td>The Backspace key.
- This key value is also used for the key labeled <code>'delete'</code> on MacOS keyboards.
- </td></tr><tr><td class="key-table-key"><code id="key-Clear" class="key">'Clear'</code></td><td>The Clear key, for removing current selected input.</td></tr><tr><td class="key-table-key"><code id="key-Copy" class="key">'Copy'</code></td><td>The Copy key.</td></tr><tr><td class="key-table-key"><code id="key-CrSel" class="key">'CrSel'</code></td><td>The Cursor Select (Crsel) key.</td></tr><tr><td class="key-table-key"><code id="key-Cut" class="key">'Cut'</code></td><td>The Cut key.</td></tr><tr><td class="key-table-key"><code id="key-Delete" class="key">'Delete'</code></td><td>The Delete (Del) Key.
- This key value is also used for the key labeled <code>'delete'</code> on MacOS keyboards when modified by the <code class="key">'Fn'</code> key.
- </td></tr><tr><td class="key-table-key"><code id="key-EraseEof" class="key">'EraseEof'</code></td><td>The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field.</td></tr><tr><td class="key-table-key"><code id="key-ExSel" class="key">'ExSel'</code></td><td>The Extend Selection (Exsel) key.</td></tr><tr><td class="key-table-key"><code id="key-Insert" class="key">'Insert'</code></td><td>The Insert (Ins) key, to toggle between text modes for insertion or overtyping.</td></tr><tr><td class="key-table-key"><code id="key-Paste" class="key">'Paste'</code></td><td>The Paste key.</td></tr><tr><td class="key-table-key"><code id="key-Redo" class="key">'Redo'</code></td><td>The Redo key.</td></tr><tr><td class="key-table-key"><code id="key-Undo" class="key">'Undo'</code></td><td>The Undo key.</td></tr></tbody></table></div>
- </section><!-- keys-editing -->
-
- <section id="keys-ui" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-ui"><span class="secno">6.3.6 </span>UI Keys</h4>
- <div id="key-table-ui" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Accept" class="key">'Accept'</code></td><td>The Accept (Commit, OK) key. Accept current option or input method sequence conversion.</td></tr><tr><td class="key-table-key"><code id="key-Again" class="key">'Again'</code></td><td>The Again key, to redo or repeat an action.</td></tr><tr><td class="key-table-key"><code id="key-Attn" class="key">'Attn'</code></td><td>The Attention (Attn) key.</td></tr><tr><td class="key-table-key"><code id="key-Cancel" class="key">'Cancel'</code></td><td>The Cancel key.</td></tr><tr><td class="key-table-key"><code id="key-ContextMenu" class="key">'ContextMenu'</code></td><td>Show the application's context menu.
- This key is commonly found between the right <code>'OS'</code> key and the right <code>'Control'</code> key.
- </td></tr><tr><td class="key-table-key"><code id="key-Escape" class="key">'Escape'</code></td><td>The Escape (Esc) key, to initiate an escape sequence.</td></tr><tr><td class="key-table-key"><code id="key-Execute" class="key">'Execute'</code></td><td>The Execute key.</td></tr><tr><td class="key-table-key"><code id="key-Find" class="key">'Find'</code></td><td>The Find key.</td></tr><tr><td class="key-table-key"><code id="key-Help" class="key">'Help'</code></td><td>Toggle display of help information.</td></tr><tr><td class="key-table-key"><code id="key-Pause" class="key">'Pause'</code></td><td>Pause the current state or application (as appropriate).
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_100"><span>Note</span></div><p class=""><strong>Note:</strong> Do not use this value for the pause button on media controllers. Use <code>'MediaPause'</code> instead.</p></div>
- </td></tr><tr><td class="key-table-key"><code id="key-Play" class="key">'Play'</code></td><td>Play or resume the current state or application (as appropriate).
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_101"><span>Note</span></div><p class=""><strong>Note:</strong> Do not use this value for the play button on media controllers. Use <code>'MediaPlay'</code> instead.</p></div>
- </td></tr><tr><td class="key-table-key"><code id="key-Props" class="key">'Props'</code></td><td>The properties (Props) key.</td></tr><tr><td class="key-table-key"><code id="key-ScrollLock" class="key">'ScrollLock'</code></td><td>The Scroll Lock key, to toggle between scrolling and cursor movement modes.</td></tr><tr><td class="key-table-key"><code id="key-ZoomIn" class="key">'ZoomIn'</code></td><td>The ZoomIn key.</td></tr><tr><td class="key-table-key"><code id="key-ZoomOut" class="key">'ZoomOut'</code></td><td>The ZoomOut key.</td></tr></tbody></table></div>
- </section><!-- keys-ui -->
-
- <section id="keys-device" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-device"><span class="secno">6.3.7 </span>Device Keys</h4>
- <div id="key-table-device" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-BrightnessDown" class="key">'BrightnessDown'</code></td><td>The Brightness Down key. Typically controls the display brightness.</td></tr><tr><td class="key-table-key"><code id="key-BrightnessUp" class="key">'BrightnessUp'</code></td><td>The Brightness Up key. Typically controls the display brightness.</td></tr><tr><td class="key-table-key"><code id="key-Camera" class="key">'Camera'</code></td><td>The Camera key.</td></tr><tr><td class="key-table-key"><code id="key-Eject" class="key">'Eject'</code></td><td>Toggle removable media to eject (open) and insert (close) state.</td></tr><tr><td class="key-table-key"><code id="key-LogOff" class="key">'LogOff'</code></td><td>The LogOff key.</td></tr><tr><td class="key-table-key"><code id="key-Power" class="key">'Power'</code></td><td>Toggle power state.
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_102"><span>Note</span></div><p class=""><strong>Note:</strong> Some devices might not expose this key to the operating environment.</p></div>
- </td></tr><tr><td class="key-table-key"><code id="key-PowerOff" class="key">'PowerOff'</code></td><td>The PowerOff key. Sometime called "PowerDown".</td></tr><tr><td class="key-table-key"><code id="key-PrintScreen" class="key">'PrintScreen'</code></td><td>The Print Screen (PrintScrn, SnapShot) key, to initiate print-screen function.</td></tr><tr><td class="key-table-key"><code id="key-Hibernate" class="key">'Hibernate'</code></td><td>The Hibernate key.
- This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown.
- </td></tr><tr><td class="key-table-key"><code id="key-Standby" class="key">'Standby'</code></td><td>The Standby key.
- This key turns off the display and places the computer into a low-power mode without completely shutting down.
- It is sometimes called the "Suspend" or "Sleep" key.
- </td></tr><tr><td class="key-table-key"><code id="key-WakeUp" class="key">'WakeUp'</code></td><td>The WakeUp key.</td></tr></tbody></table></div>
- </section><!-- keys-device -->
-
- <section id="keys-composition" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_keys-composition"><span class="secno">6.3.8 </span>IME and Composition Keys</h4>
- <div id="key-table-composition" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-AllCandidates" class="key">'AllCandidates'</code></td><td>The All Candidates key, to initate the multi-candidate mode.</td></tr><tr><td class="key-table-key"><code id="key-Alphanumeric" class="key">'Alphanumeric'</code></td><td>The Alphanumeric key.</td></tr><tr><td class="key-table-key"><code id="key-CodeInput" class="key">'CodeInput'</code></td><td>The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points.</td></tr><tr><td class="key-table-key"><code id="key-Compose" class="key">'Compose'</code></td><td>The Compose key, also known as <em>Multi_key</em> on the X Window System. This key acts in a manner similar to a
- <a class="def" href="#glossary-dead-key">dead key</a>, triggering a mode where subsequent key presses are combined to produce a different character.
- </td></tr><tr><td class="key-table-key"><code id="key-Convert" class="key">'Convert'</code></td><td>The Convert key, to convert the current input method sequence.</td></tr><tr><td class="key-table-key"><code id="key-FinalMode" class="key">'FinalMode'</code></td><td>The Final Mode (Final) key used on some Asian keyboards, to enable the final mode for IMEs.</td></tr><tr><td class="key-table-key"><code id="key-GroupFirst" class="key">'GroupFirst'</code></td><td>Switch to the first character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupLast" class="key">'GroupLast'</code></td><td>Switch to the last character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupNext" class="key">'GroupNext'</code></td><td>Switch to the next character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupPrevious" class="key">'GroupPrevious'</code></td><td>Switch to the previous character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-ModeChange" class="key">'ModeChange'</code></td><td>The Mode Change key, to toggle between or cycle through input modes of IMEs.</td></tr><tr><td class="key-table-key"><code id="key-NextCandidate" class="key">'NextCandidate'</code></td><td>The Next Candidate function key.</td></tr><tr><td class="key-table-key"><code id="key-NonConvert" class="key">'NonConvert'</code></td><td>The Nonconvert (Don't Convert) key, to accept current input method sequence without conversion in IMEs.</td></tr><tr><td class="key-table-key"><code id="key-PreviousCandidate" class="key">'PreviousCandidate'</code></td><td>The Previous Candidate function key.</td></tr><tr><td class="key-table-key"><code id="key-Process" class="key">'Process'</code></td><td>The Process key.</td></tr><tr><td class="key-table-key"><code id="key-SingleCandidate" class="key">'SingleCandidate'</code></td><td>The Single Candidate function key.</td></tr></tbody></table></div>
-
- <p>Keys specific to Korean keyboards</p>
- <div id="key-table-ime-korean" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-RomanCharacters" class="key">'RomanCharacters'</code></td><td>The Roman Characters function key, also known as the <code>'Youngja'</code> or <code>'Young'</code> key.</td></tr><tr><td class="key-table-key"><code id="key-HangulMode" class="key">'HangulMode'</code></td><td>The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes.</td></tr><tr><td class="key-table-key"><code id="key-HanjaMode" class="key">'HanjaMode'</code></td><td>The Hanja (Korean characters) Mode key.</td></tr><tr><td class="key-table-key"><code id="key-JunjaMode" class="key">'JunjaMode'</code></td><td>The Junja (Korean characters) Mode key.</td></tr></tbody></table></div>
-
- <p>Keys specific to Japanese keyboards</p>
- <div id="key-table-ime-japanese" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Zenkaku" class="key">'Zenkaku'</code></td><td>The Zenkaku (Full-Width) Characters key.</td></tr><tr><td class="key-table-key"><code id="key-Hankaku" class="key">'Hankaku'</code></td><td>The (Half-Width) Characters key.</td></tr><tr><td class="key-table-key"><code id="key-ZenkakuHankaku" class="key">'ZenkakuHankaku'</code></td><td>The Zenkaku/Hankaku (full-width/half-width) toggle key.</td></tr><tr><td class="key-table-key"><code id="key-KanaMode" class="key">'KanaMode'</code></td><td>The Kana Mode (Kana Lock) key.</td></tr><tr><td class="key-table-key"><code id="key-KanjiMode" class="key">'KanjiMode'</code></td><td>The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.</td></tr><tr><td class="key-table-key"><code id="key-Hiragana" class="key">'Hiragana'</code></td><td>The Hiragana (Japanese Kana characters) key.</td></tr><tr><td class="key-table-key"><code id="key-Katakana" class="key">'Katakana'</code></td><td>The Katakana (Japanese Kana characters) key.</td></tr><tr><td class="key-table-key"><code id="key-HiraganaKatakana" class="key">'HiraganaKatakana'</code></td><td>The Hiragana/Katakana toggle key.</td></tr><tr><td class="key-table-key"><code id="key-Eisu" class="key">'Eisu'</code></td><td>The Eisu key. This key may close the IME, but it's purpose is defined by the current IME.</td></tr></tbody></table></div>
-
- <section id="keys-function" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keys-function">General-Purpose Function Keys</h5>
- <p>The exact number of these general purpose function keys varies on different platforms, and only the first
- few are defined explicitly here. Additional function key names are implicitly defined by incrementing the
- base-10 index at the end of the function key name. Thus, <span class="key">'F24'</span>
- and <span class="key">'Soft8'</span> are all valid key values.
- </p>
- <div id="key-table-function" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-F1" class="key">'F1'</code></td><td>The F1 key, a general purpose function key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-F2" class="key">'F2'</code></td><td>The F2 key, a general purpose function key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-F3" class="key">'F3'</code></td><td>The F3 key, a general purpose function key, as index 3.</td></tr><tr><td class="key-table-key"><code id="key-F4" class="key">'F4'</code></td><td>The F4 key, a general purpose function key, as index 4.</td></tr><tr><td class="key-table-key"><code id="key-F5" class="key">'F5'</code></td><td>The F5 key, a general purpose function key, as index 5.</td></tr><tr><td class="key-table-key"><code id="key-F6" class="key">'F6'</code></td><td>The F6 key, a general purpose function key, as index 6.</td></tr><tr><td class="key-table-key"><code id="key-F7" class="key">'F7'</code></td><td>The F7 key, a general purpose function key, as index 7.</td></tr><tr><td class="key-table-key"><code id="key-F8" class="key">'F8'</code></td><td>The F8 key, a general purpose function key, as index 8.</td></tr><tr><td class="key-table-key"><code id="key-F9" class="key">'F9'</code></td><td>The F9 key, a general purpose function key, as index 9.</td></tr><tr><td class="key-table-key"><code id="key-F10" class="key">'F10'</code></td><td>The F10 key, a general purpose function key, as index 10.</td></tr><tr><td class="key-table-key"><code id="key-F11" class="key">'F11'</code></td><td>The F11 key, a general purpose function key, as index 11.</td></tr><tr><td class="key-table-key"><code id="key-F12" class="key">'F12'</code></td><td>The F12 key, a general purpose function key, as index 12.</td></tr><tr><td class="key-table-key"><code id="key-Soft1" class="key">'Soft1'</code></td><td>General purpose virtual function key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-Soft2" class="key">'Soft2'</code></td><td>General purpose virtual function key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-Soft3" class="key">'Soft3'</code></td><td>General purpose virtual function key, as index 3.</td></tr><tr><td class="key-table-key"><code id="key-Soft4" class="key">'Soft4'</code></td><td>General purpose virtual function key, as index 4.</td></tr></tbody></table></div>
- </section><!-- keys-function -->
-
- <section id="keys-multimedia" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keys-multimedia">Mediamedia Keys</h5>
- <p>These are extra keys found on "multimedia" keyboards.</p>
-
- <div id="key-table-multimedia" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Close" class="key">'Close'</code></td><td>Close the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-MailForward" class="key">'MailForward'</code></td><td>Open an editor to forward the current message.</td></tr><tr><td class="key-table-key"><code id="key-MailReply" class="key">'MailReply'</code></td><td>Open an editor to reply to the current message.</td></tr><tr><td class="key-table-key"><code id="key-MailSend" class="key">'MailSend'</code></td><td>Send the current message.</td></tr><tr><td class="key-table-key"><code id="key-MediaPlayPause" class="key">'MediaPlayPause'</code></td><td>Toggle media between play and pause states.</td></tr><tr><td class="key-table-key"><code id="key-MediaSelect" class="key">'MediaSelect'</code></td><td>Select media.</td></tr><tr><td class="key-table-key"><code id="key-MediaStop" class="key">'MediaStop'</code></td><td>Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped.</td></tr><tr><td class="key-table-key"><code id="key-MediaTrackNext" class="key">'MediaTrackNext'</code></td><td>Seek to next media or program track.</td></tr><tr><td class="key-table-key"><code id="key-MediaTrackPrevious" class="key">'MediaTrackPrevious'</code></td><td>Seek to previous media or program track.</td></tr><tr><td class="key-table-key"><code id="key-New" class="key">'New'</code></td><td>Open a new document or message.</td></tr><tr><td class="key-table-key"><code id="key-Open" class="key">'Open'</code></td><td>Open an existing document or message.</td></tr><tr><td class="key-table-key"><code id="key-Print" class="key">'Print'</code></td><td>Print the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-Save" class="key">'Save'</code></td><td>Save the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-SpellCheck" class="key">'SpellCheck'</code></td><td>Spellcheck the current document or selection.</td></tr><tr><td class="key-table-key"><code id="key-VolumeDown" class="key">'VolumeDown'</code></td><td>Decrease audio volume.</td></tr><tr><td class="key-table-key"><code id="key-VolumeUp" class="key">'VolumeUp'</code></td><td>Increase audio volume.</td></tr><tr><td class="key-table-key"><code id="key-VolumeMute" class="key">'VolumeMute'</code></td><td>Toggle between muted state and prior volume level.</td></tr></tbody></table></div>
- </section><!-- keys-function -->
-
- <section id="keys-apps" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keys-apps">Application Keys</h5>
- <p>The exact number of these LaunchApplication keys varies on different platforms, and only the first
- few are defined explicitly here. Additional key names are implicitly defined by incrementing the
- base-10 index at the end of the function key name. Thus
- <span class="key">'LaunchApplication12'</span> is a valid key value.
- </p>
- <!-- Key tables. Note that all keys must be defined within a <div class="key-table"> -->
- <div id="key-table-apps" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-LaunchCalculator" class="key">'LaunchCalculator'</code></td><td>The 'Calculator' key. This is often the generic 'LaunchApplication' key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-LaunchCalendar" class="key">'LaunchCalendar'</code></td><td>The 'Calendar' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMail" class="key">'LaunchMail'</code></td><td>The 'Mail' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMediaPlayer" class="key">'LaunchMediaPlayer'</code></td><td>The 'Media Player' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMusicPlayer" class="key">'LaunchMusicPlayer'</code></td><td>The 'Music Player' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMyComputer" class="key">'LaunchMyComputer'</code></td><td>The 'My Computer' key. This is often the generic 'LaunchApplication' key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-LaunchScreenSaver" class="key">'LaunchScreenSaver'</code></td><td>The 'Screen Saver' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchSpreadsheet" class="key">'LaunchSpreadsheet'</code></td><td>The 'Spreadsheet' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWebBrowser" class="key">'LaunchWebBrowser'</code></td><td>The 'Web Browser' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWebCam" class="key">'LaunchWebCam'</code></td><td>The 'WebCam' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWordProcessor" class="key">'LaunchWordProcessor'</code></td><td>The 'Word Processor' key.</td></tr></tbody></table></div>
- </section><!-- keys-apps -->
-
- <section id="keys-browser" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keys-browser">Browser Keys</h5>
- <div id="key-table-browser" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-BrowserBack" class="key">'BrowserBack'</code></td><td>Navigate to previous content or page in current history.</td></tr><tr><td class="key-table-key"><code id="key-BrowserFavorites" class="key">'BrowserFavorites'</code></td><td>The Browser Favorites key.</td></tr><tr><td class="key-table-key"><code id="key-BrowserForward" class="key">'BrowserForward'</code></td><td>Navigate to next content or page in current history.</td></tr><tr><td class="key-table-key"><code id="key-BrowserHome" class="key">'BrowserHome'</code></td><td>The Browser Home key, used with keyboard entry, to go to the home page.</td></tr><tr><td class="key-table-key"><code id="key-BrowserRefresh" class="key">'BrowserRefresh'</code></td><td>The Browser Refresh key, to refresh the current page or content.</td></tr><tr><td class="key-table-key"><code id="key-BrowserSearch" class="key">'BrowserSearch'</code></td><td>The Browser Search key, to call up the user's preferred search page.</td></tr><tr><td class="key-table-key"><code id="key-BrowserStop" class="key">'BrowserStop'</code></td><td>The Browser Stop key, to stop loading the current page or content.</td></tr></tbody></table></div>
- </section><!-- keys-browser -->
-
- <section id="keys-media-controller" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keys-media-controller">Media Controller Keys</h5>
-
- <p>The <a class="def" href="#glossary-key-value">key values</a> for media controllers (e.g. remote controls for television, audio systems, and set-top boxes)
- are derived in part from the consumer electronics technical specifications:</p>
- <ul>
- <li>DTV Application Software Environment [<cite><a href="#references-DASE">DASE</a></cite>]</li>
- <li>Open Cable Application Platform 1.1.3 [<cite><a href="#references-OCAP">OCAP</a></cite>]</li>
- <li>ANSI/CEA-2014-B, Web-based Protocol and Framework for Remote User Interface on UPnPTM Networks and the Internet [<cite><a href="#references-WEB4CE">WEB4CE</a></cite>]</li>
- </ul>
- <p></p>
-
- <div id="key-table-media-controller" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-AudioBalanceLeft" class="key">'AudioBalanceLeft'</code></td><td>Adjust audio balance leftward. (VK_AUDIO_BALANCE_LEFT)</td></tr><tr><td class="key-table-key"><code id="key-AudioBalanceRight" class="key">'AudioBalanceRight'</code></td><td>Adjust audio balance rightward. (VK_AUDIO_BALANCE_RIGHT)</td></tr><tr><td class="key-table-key"><code id="key-AudioBassBoostDown" class="key">'AudioBassBoostDown'</code></td><td>Decrease audio bass boost or cycle down through bass boost states. (VK_BASS_BOOST_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-AudioBassBoostUp" class="key">'AudioBassBoostUp'</code></td><td>Increase audio bass boost or cycle up through bass boost states. (VK_BASS_BOOST_UP)</td></tr><tr><td class="key-table-key"><code id="key-AudioFaderFront" class="key">'AudioFaderFront'</code></td><td>Adjust audio fader towards front. (VK_FADER_FRONT)</td></tr><tr><td class="key-table-key"><code id="key-AudioFaderRear" class="key">'AudioFaderRear'</code></td><td>Adjust audio fader towards rear. (VK_FADER_REAR)</td></tr><tr><td class="key-table-key"><code id="key-AudioSurroundModeNext" class="key">'AudioSurroundModeNext'</code></td><td>Advance surround audio mode to next available mode. (VK_SURROUND_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-ChannelDown" class="key">'ChannelDown'</code></td><td>Select next (numerically or logically) lower channel. (VK_CHANNEL_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-ChannelUp" class="key">'ChannelUp'</code></td><td>Select next (numerically or logically) higher channel. (VK_CHANNEL_UP)</td></tr><tr><td class="key-table-key"><code id="key-ColorF0Red" class="key">'ColorF0Red'</code></td><td>General purpose color-coded media function key, as index 0 (red). (VK_COLORED_KEY_0)</td></tr><tr><td class="key-table-key"><code id="key-ColorF1Green" class="key">'ColorF1Green'</code></td><td>General purpose color-coded media function key, as index 1 (green). (VK_COLORED_KEY_1)</td></tr><tr><td class="key-table-key"><code id="key-ColorF2Yellow" class="key">'ColorF2Yellow'</code></td><td>General purpose color-coded media function key, as index 2 (yellow). (VK_COLORED_KEY_2)</td></tr><tr><td class="key-table-key"><code id="key-ColorF3Blue" class="key">'ColorF3Blue'</code></td><td>General purpose color-coded media function key, as index 3 (blue). (VK_COLORED_KEY_3)</td></tr><tr><td class="key-table-key"><code id="key-ColorF4Grey" class="key">'ColorF4Grey'</code></td><td>General purpose color-coded media function key, as index 4 (grey). (VK_COLORED_KEY_4)</td></tr><tr><td class="key-table-key"><code id="key-ColorF5Brown" class="key">'ColorF5Brown'</code></td><td>General purpose color-coded media function key, as index 5 (brown). (VK_COLORED_KEY_5)</td></tr><tr><td class="key-table-key"><code id="key-ClosedCaptionToggle" class="key">'ClosedCaptionToggle'</code></td><td>Toggle the display of Closed Captions. (VK_CC)</td></tr><tr><td class="key-table-key"><code id="key-Dimmer" class="key">'Dimmer'</code></td><td>Adjust brightness of device, by toggling between or cycling through states. (VK_DIMMER)</td></tr><tr><td class="key-table-key"><code id="key-DisplaySwap" class="key">'DisplaySwap'</code></td><td>Swap video sources. (VK_DISPLAY_SWAP)</td></tr><tr><td class="key-table-key"><code id="key-Exit" class="key">'Exit'</code></td><td>Exit the current application. (VK_EXIT)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear0" class="key">'FavoriteClear0'</code></td><td>Clear program or content stored as favorite 0. (VK_CLEAR_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear1" class="key">'FavoriteClear1'</code></td><td>Clear program or content stored as favorite 1. (VK_CLEAR_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear2" class="key">'FavoriteClear2'</code></td><td>Clear program or content stored as favorite 2. (VK_CLEAR_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear3" class="key">'FavoriteClear3'</code></td><td>Clear program or content stored as favorite 3. (VK_CLEAR_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall0" class="key">'FavoriteRecall0'</code></td><td>Select (recall) program or content stored as favorite 0. (VK_RECALL_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall1" class="key">'FavoriteRecall1'</code></td><td>Select (recall) program or content stored as favorite 1. (VK_RECALL_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall2" class="key">'FavoriteRecall2'</code></td><td>Select (recall) program or content stored as favorite 2. (VK_RECALL_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall3" class="key">'FavoriteRecall3'</code></td><td>Select (recall) program or content stored as favorite 3. (VK_RECALL_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore0" class="key">'FavoriteStore0'</code></td><td>Store current program or content as favorite 0. (VK_STORE_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore1" class="key">'FavoriteStore1'</code></td><td>Store current program or content as favorite 1. (VK_STORE_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore2" class="key">'FavoriteStore2'</code></td><td>Store current program or content as favorite 2. (VK_STORE_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore3" class="key">'FavoriteStore3'</code></td><td>Store current program or content as favorite 3. (VK_STORE_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-Guide" class="key">'Guide'</code></td><td>Toggle display of program or content guide. (VK_GUIDE)</td></tr><tr><td class="key-table-key"><code id="key-GuideNextDay" class="key">'GuideNextDay'</code></td><td>If guide is active and displayed, then display next day's content. (VK_NEXT_DAY)</td></tr><tr><td class="key-table-key"><code id="key-GuidePreviousDay" class="key">'GuidePreviousDay'</code></td><td>If guide is active and displayed, then display previous day's content. (VK_PREV_DAY)</td></tr><tr><td class="key-table-key"><code id="key-Info" class="key">'Info'</code></td><td>Toggle display of information about currently selected context or media. (VK_INFO)</td></tr><tr><td class="key-table-key"><code id="key-InstantReplay" class="key">'InstantReplay'</code></td><td>Toggle instant replay. (VK_INSTANT_REPLAY)</td></tr><tr><td class="key-table-key"><code id="key-Link" class="key">'Link'</code></td><td>Launch linked content, if available and appropriate. (VK_LINK)</td></tr><tr><td class="key-table-key"><code id="key-ListProgram" class="key">'ListProgram'</code></td><td>List the current program. (VK_LIST)</td></tr><tr><td class="key-table-key"><code id="key-LiveContent" class="key">'LiveContent'</code></td><td>Toggle display listing of currently available live content or programs. (VK_LIVE)</td></tr><tr><td class="key-table-key"><code id="key-Lock" class="key">'Lock'</code></td><td>Lock or unlock current content or program. (VK_LOCK)</td></tr><tr><td class="key-table-key"><code id="key-MediaApps" class="key">'MediaApps'</code></td><td>Show a list of media applications. (VK_APPS)
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_103"><span>Note</span></div><p class=""><strong>Note:</strong> Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as <code>'ContextMenu'</code>.</p></div>
- </td></tr><tr><td class="key-table-key"><code id="key-MediaFastForward" class="key">'MediaFastForward'</code></td><td>Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. (VK_FAST_FWD)</td></tr><tr><td class="key-table-key"><code id="key-MediaLast" class="key">'MediaLast'</code></td><td>Select previously selected channel or media. (VK_LAST)</td></tr><tr><td class="key-table-key"><code id="key-MediaPause" class="key">'MediaPause'</code></td><td>Pause the currently playing media. (VK_PAUSE)
- <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_104"><span>Note</span></div><p class=""><strong>Note:</strong> Media controller devices should use this value rather than <code>'Pause'</code> for their pause keys.</p></div>
- </td></tr><tr><td class="key-table-key"><code id="key-MediaPlay" class="key">'MediaPlay'</code></td><td>Initiate or continue media playback at normal speed, if not currently playing at normal speed. (VK_PLAY)</td></tr><tr><td class="key-table-key"><code id="key-MediaRecord" class="key">'MediaRecord'</code></td><td>Initiate or resume recording of currently selected media. (VK_RECORD)</td></tr><tr><td class="key-table-key"><code id="key-MediaRewind" class="key">'MediaRewind'</code></td><td>Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. (VK_REWIND)</td></tr><tr><td class="key-table-key"><code id="key-MediaSkip" class="key">'MediaSkip'</code></td><td>Skip forward to next content or program. (VK_SKIP)</td></tr><tr><td class="key-table-key"><code id="key-NextFavoriteChannel" class="key">'NextFavoriteChannel'</code></td><td>Cycle to next favorite channel (in favorites list). (VK_NEXT_FAVORITE_CHANNEL)</td></tr><tr><td class="key-table-key"><code id="key-NextUserProfile" class="key">'NextUserProfile'</code></td><td>Cycle to next user profile (if there are multiple user profiles). (VK_USER)</td></tr><tr><td class="key-table-key"><code id="key-OnDemand" class="key">'OnDemand'</code></td><td>Access on-demand content or programs. (VK_ON_DEMAND)</td></tr><tr><td class="key-table-key"><code id="key-PinPDown" class="key">'PinPDown'</code></td><td>Move picture-in-picture window down. (VK_PINP_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-PinPMove" class="key">'PinPMove'</code></td><td>Move picture-in-picture window. (VK_PINP_MOVE)</td></tr><tr><td class="key-table-key"><code id="key-PinPToggle" class="key">'PinPToggle'</code></td><td>Toggle display of picture-in-picture window. (VK_PINP_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-PinPUp" class="key">'PinPUp'</code></td><td>Move picture-in-picture window up. (VK_PINP_UP)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedDown" class="key">'PlaySpeedDown'</code></td><td>Decrease media playback speed. (VK_PLAY_SPEED_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedReset" class="key">'PlaySpeedReset'</code></td><td>Reset playback to normal speed. (VK_PLAY_SPEED_RESET)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedUp" class="key">'PlaySpeedUp'</code></td><td>Increase media playback speed. (VK_PLAY_SPEED_UP)</td></tr><tr><td class="key-table-key"><code id="key-RandomToggle" class="key">'RandomToggle'</code></td><td>Toggle random media or content shuffle mode. (VK_RANDOM_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-RcLowBattery" class="key">'RcLowBattery'</code></td><td>Not a physical key, but this key code is sent when the remote control battery is low. (VK_RC_LOW_BATTERY)</td></tr><tr><td class="key-table-key"><code id="key-RecordSpeedNext" class="key">'RecordSpeedNext'</code></td><td>Toggle or cycle between media recording speeds. (VK_RECORD_SPEED_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-RfBypass" class="key">'RfBypass'</code></td><td>Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). (VK_RF_BYPASS)</td></tr><tr><td class="key-table-key"><code id="key-ScanChannelsToggle" class="key">'ScanChannelsToggle'</code></td><td>Toggle scan channels mode. (VK_SCAN_CHANNELS_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-ScreenModeNext" class="key">'ScreenModeNext'</code></td><td>Advance display screen mode to next available mode. (VK_SCREEN_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-Settings" class="key">'Settings'</code></td><td>Toggle display of device settings screen. (VK_SETTINGS)</td></tr><tr><td class="key-table-key"><code id="key-SplitScreenToggle" class="key">'SplitScreenToggle'</code></td><td>Toggle split screen mode. (VK_SPLIT_SCREEN_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-Subtitle" class="key">'Subtitle'</code></td><td>Toggle display of subtitles, if available. (VK_SUBTITLE)</td></tr><tr><td class="key-table-key"><code id="key-Teletext" class="key">'Teletext'</code></td><td>Toggle display of teletext, if available (VK_TELETEXT).</td></tr><tr><td class="key-table-key"><code id="key-VideoModeNext" class="key">'VideoModeNext'</code></td><td>Advance video mode to next available mode.(VK_VIDEO_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-Wink" class="key">'Wink'</code></td><td>Cause device to identify itself in some manner, e.g., audibly or visibly. (VK_WINK)</td></tr><tr><td class="key-table-key"><code id="key-ZoomToggle" class="key">'ZoomToggle'</code></td><td>Toggle between full-screen and scaled content, or alter magnification level. (VK_ZOOM)</td></tr></tbody></table></div>
-
- <p>Some of the keys defined in the media controller standards already have appropriate keys defined in other sections of this specification.
- These following table summarizes the key values that <em class="rfc2119" title="MUST">MUST</em> be used:
- </p>
-
- <div id="key-table-media-controller-dup" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code class="key">'BrowserBack'</code></td><td>Navigate to previous content or page in current history. (VK_BACK)</td></tr><tr><td class="key-table-key"><code class="key">'BrowserForward'</code></td><td>Navigate to next content or page in current history. (VK_FORWARD)</td></tr><tr><td class="key-table-key"><code class="key">'ContextMenu'</code></td><td>Toggle display of the on-screen menu. (VK_MENU)</td></tr><tr><td class="key-table-key"><code class="key">'Eject'</code></td><td>Toggle removable media to eject (open) and insert (close) state. (VK_EJECT_TOGGLE)</td></tr><tr><td class="key-table-key"><code class="key">'End'</code></td><td>The End key, used with keyboard entry to go to the end of content. (VK_GO_TO_END)</td></tr><tr><td class="key-table-key"><code class="key">'Enter'</code></td><td>The Enter key, to activate current selection or accept current input. (VK_SELECT)</td></tr><tr><td class="key-table-key"><code class="key">'Home'</code></td><td>The Home key, used with keyboard entry, to go to start of content. (VK_GO_TO_START)</td></tr><tr><td class="key-table-key"><code class="key">'MediaPlayPause'</code></td><td>Toggle media between play and pause states. (VK_PLAY_PAUSE)</td></tr><tr><td class="key-table-key"><code class="key">'MediaStop'</code></td><td>Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. (VK_STOP)</td></tr><tr><td class="key-table-key"><code class="key">'MediaTrackNext'</code></td><td>Seek to next media or program track. (VK_TRACK_NEXT)</td></tr><tr><td class="key-table-key"><code class="key">'MediaTrackPrevious'</code></td><td>Seek to previous media or program track. (VK_TRACK_PREV)</td></tr><tr><td class="key-table-key"><code class="key">'Power'</code></td><td>Toggle power state. (VK_POWER)</td></tr><tr><td class="key-table-key"><code class="key">'Unidentified'</code></td><td>This key value is used when an implementations is unable to identify another key value, due to either hardware, platform, or software constraints. (VK_UNDEFINED)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeDown'</code></td><td>Decrease audio volume. (VK_VOLUME_DOWN)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeUp'</code></td><td>Increase audio volume. (VK_VOLUME_UP)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeMute'</code></td><td>Toggle between muted state and prior volume level. (VK_VOLUME_MUTE)</td></tr></tbody></table></div>
-
- </section><!-- keys-media-controller -->
-
- </section>
-
- </section>
-
- <!-- Appendix A: Initializing New Event Interfaces ========================================================-->
- <section id="new-event-interface-initializers" class="appendix" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_new-event-interface-initializers"><span class="secno">6.4 </span>Initializing New Event Interfaces</h3>
-
- <p><em>This section is informative</em></p>
-
- <p>This specification defines several new event interfaces without a mechanism for content authors to initialize their respective events.</p>
-
- <p>These new event interfaces are:</p>
-
- <ul>
- <li><a href="#interface-CustomEvent"><code>CustomEvent</code></a></li>
- <li><a href="#interface-FocusEvent"><code>FocusEvent</code></a></li>
- <li><a href="#interface-WheelEvent"><code>WheelEvent</code></a></li>
- <li><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></li>
- <li><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></li>
- </ul>
-
- <p>In DOM Level 2 Events, the initialization of these event interfaces was possible through an init method on the interface (for example <code>initMouseEvent</code>).
- These init methods needed a long list of parameters that, in most cases, did not fully initialize all attributes of the event object. In order to fully initialize
- an event interface which was derived from the basic <code>Event</code> interface, it was necessary to call the initializer of each of the derived interfaces explicitly.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>Initializing all the attributes of a MutationEvent requires calls to two initializer methods: <code>initEvent</code> and
- <code>initMutationEvent</code>.</p>
- </div>
-
- <p>Due in part to the length of time in the development of this standard, some implementations <em class="rfc2119" title="MAY">MAY</em> have taken a dependency on a set of initializer methods that were
- formerly defined in this specification. For completeness, these legacy event intializers are described in this Appendix.</p>
-
- <p>The initialization of new derived event objects becomes easier with the introduction of event constructors in
- [<a href="#references-UIEvents">UI Events</a>]. Event constructors
- are a new mechanism for initializing the event object's attributes that allows authors to pick-and-choose which of all the possible event attributes <em class="rfc2119" title="SHOULD">SHOULD</em> be initialized to
- a value. For the omitted values, a suitable default is applied.</p>
-
- <p>This specification does not require a conforming implementation to support event constructors. Likewise it does not require a conforming implementation to support
- the legacy event initializers. However, it would be prudent for a conforming implementation to support one or the other, so that authors have some mechanism to initilize
- the new event interfaces defined in this specification.</p>
-
- <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_105"><span>Note</span></div><p class=""><strong>Note: </strong>Event constructors are a relatively new concept and are subject to change. For the latest syntax, please refer to the UI Events specification
- [<a href="#references-UIEvents">UI Events</a>].</p></div>
-
- <section id="event-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_event-initializers"><span class="secno">6.4.1 </span>Supplemental Initializer Interfaces</h4>
- <p><em>This section is informative</em></p>
- <p>
- This section documents legacy initializer methods <b>and</b> suggested event constructors for the following event interfaces introduced in DOM Level 3 Events:
- </p>
- <ul>
- <li><a href="#idl-interface-CustomEvent-initializers"><code>CustomEvent</code></a></li>
- <li><a href="#idl-interface-FocusEvent-initializers"><code>FocusEvent</code></a></li>
- <li><a href="#idl-interface-WheelEvent-initializers"><code>WheelEvent</code></a></li>
- <li><a href="#idl-interface-KeyboardEvent-initializers"><code>KeyboardEvent</code></a></li>
- <li><a href="#idl-interface-CompositionEvent-initializers"><code>CompositionEvent</code></a></li>
- </ul>
- <p>
- This section also documents suggested event constructors for the following event interfaces which were introduced in DOM Level 2 Events [<a href="#references-DOM2Events">DOM2 Events</a>] and deprecated in this specification:
- </p>
- <ul>
- <li><a href="#idl-interface-UIEvent-initializers"><code>UIEvent</code></a></li>
- <li><a href="#idl-interface-MouseEvent-initializers"><code>MouseEvent</code></a></li>
- </ul>
- <p>
- For completeness, this section also documents suggested event constructors for the following event interfaces which were introduced in DOM Level 2 Events [<a href="#references-DOM2Events">DOM2 Events</a>] but not deprecated in this specification:
- </p>
- <ul>
- <li><a href="#idl-interface-Event-initializers"><code>Event</code></a></li>
- </ul>
-
- <section id="idl-interface-Event-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-Event-initializers">Initializers for interface Event</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-EventInit">dictionary <span class="idlDictionaryID">EventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-EventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-EventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-};</span></pre><section><h6 id="dictionary-eventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-EventInit"><code>EventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-EventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-EventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-Event-1">[<span class="extAttr">Constructor(DOMString typeArg, optional EventInit eventInitDict</span>]
-partial interface <span class="idlInterfaceID">Event</span> {
-};</span></pre>
- </section>
-
- <section id="idl-interface-CustomEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-CustomEvent-initializers">Initializers for interface CustomEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-CustomEventInit">dictionary <span class="idlDictionaryID">CustomEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">any</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-detail">detail</a></span> = <span class="idlMemberValue">null</span>;</span>
-};</span></pre><section><h6 id="dictionary-customeventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-CustomEventInit"><code>CustomEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-CustomEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CustomEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CustomEventInit-detail"><code>detail</code> of type <span class="idlMemberType">any</span>, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-CustomEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional CustomEventInit customEventInitDict</span>]
-partial interface <span class="idlInterfaceID">CustomEvent</span> {
-<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-CustomEvent-initCustomEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-any-detailArg">initCustomEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">any</span> <span class="idlParamName">detailArg</span></span>);</span>
-};</span></pre><section><h6 id="methods-6" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-CustomEvent-initCustomEvent"><code>initCustomEvent</code></dt><dd>
- <p>Initializes attributes of a <code>CustomEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initCustomEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
- syntax for initializing a <code>CustomEvent</code>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-CustomEvent-detail"><code>CustomEvent.detail</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-UIEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-UIEvent-initializers">Initializers for interface UIEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-UIEventInit">dictionary <span class="idlDictionaryID">UIEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-UIEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-UIEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-UIEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-UIEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-};</span></pre><section><h6 id="dictionary-uieventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-UIEventInit"><code>UIEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-UIEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-UIEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-UIEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-UIEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-UIEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional UIEventInit uiEventInitDict</span>]
-partial interface <span class="idlInterfaceID">UIEvent</span> {
-<span class="idlSectionComment"> // Deprecated in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-UIEvent-initUIEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg">initUIEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>);</span>
-};</span></pre><section><h6 id="methods-7" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-UIEvent-initUIEvent"><code>initUIEvent</code></dt><dd>
- <p>Initializes attributes of an <code>UIEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initUIEvent</code> method is deprecated, but supported for backwards-compatibility with widely-deployed
- implementations. See [<a href="#references-UIEvents">UI Events</a>] for an alternate initializer syntax.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-UIEvent-view"><code>UIEvent.view</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p>
- </td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-FocusEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-FocusEvent-initializers">Initializers for interface FocusEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-FocusEventInit">dictionary <span class="idlDictionaryID">FocusEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
-};</span></pre><section><h6 id="dictionary-focuseventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-FocusEventInit"><code>FocusEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-FocusEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-FocusEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-FocusEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-FocusEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-FocusEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-FocusEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict</span>]
-partial interface <span class="idlInterfaceID">FocusEvent</span> {
-<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-FocusEvent-initFocusEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-EventTarget-relatedTargetArg">initFocusEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>);</span>
-};</span></pre><section><h6 id="methods-8" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-FocusEvent-initFocusEvent"><code>initFocusEvent</code></dt><dd>
- <p>Initializes attributes of a <code>FocusEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initFocusEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
- syntax for initializing a <code>FocusEvent</code>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-FocusEvent-relatedTarget"><code>FocusEvent.relatedTarget</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-MouseEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-MouseEvent-initializers">Initializers for interface MouseEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-MouseEventInit">dictionary <span class="idlDictionaryID">MouseEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-screenX">screenX</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-screenY">screenY</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-clientX">clientX</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-clientY">clientY</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-button">button</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-buttons">buttons</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
-};</span></pre><section><h6 id="dictionary-mouseeventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-MouseEventInit"><code>MouseEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-MouseEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-button"><code>button</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-buttons"><code>buttons</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-clientX"><code>clientX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-clientY"><code>clientY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-MouseEventInit-screenX"><code>screenX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-screenY"><code>screenY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-MouseEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict</span>]
-partial interface <span class="idlInterfaceID">MouseEvent</span> {
-<span class="idlSectionComment"> // Deprecated in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-MouseEvent-initMouseEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-long-screenXArg-long-screenYArg-long-clientXArg-long-clientYArg-boolean-ctrlKeyArg-boolean-altKeyArg-boolean-shiftKeyArg-boolean-metaKeyArg-unsigned-short-buttonArg-EventTarget-relatedTargetArg">initMouseEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenYArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientYArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">ctrlKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">altKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">shiftKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">metaKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">buttonArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>);</span>
-};</span></pre><section><h6 id="methods-9" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-MouseEvent-initMouseEvent"><code>initMouseEvent</code></dt><dd>
- <p>Initializes attributes of a <code>MouseEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initMouseEvent</code> method is deprecated, but supported for backwards-compatibility with widely-deployed
- implementations. See [<a href="#references-UIEvents">UI Events</a>] for an alternate initializer syntax.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">screenXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-screenX"><code>MouseEvent.screenX</code></a>.</p>
- </td></tr><tr><td class="prmName">screenYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-screenY"><code>MouseEvent.screenY</code></a>.</p>
- </td></tr><tr><td class="prmName">clientXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-clientX"><code>MouseEvent.clientX</code></a>.</p>
- </td></tr><tr><td class="prmName">clientYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-clientY"><code>MouseEvent.clientY</code></a>.</p>
- </td></tr><tr><td class="prmName">ctrlKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-ctrlKey"><code>MouseEvent.ctrlKey</code></a>.</p>
- </td></tr><tr><td class="prmName">altKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-altKey"><code>MouseEvent.altKey</code></a>.</p>
- </td></tr><tr><td class="prmName">shiftKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-shiftKey"><code>MouseEvent.shiftKey</code></a>.</p>
- </td></tr><tr><td class="prmName">metaKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-metaKey"><code>MouseEvent.metaKey</code></a>.</p>
- </td></tr><tr><td class="prmName">buttonArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a>.</p>
- </td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MouseEvent-relatedTarget"><code>MouseEvent.relatedTarget</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-WheelEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-WheelEvent-initializers">Initializers for interface WheelEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-WheelEventInit">dictionary <span class="idlDictionaryID">WheelEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-screenX">screenX</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-screenY">screenY</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-clientX">clientX</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-clientY">clientY</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-button">button</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-buttons">buttons</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaX">deltaX</a></span> = <span class="idlMemberValue">0.0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaY">deltaY</a></span> = <span class="idlMemberValue">0.0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaZ">deltaZ</a></span> = <span class="idlMemberValue">0.0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaMode">deltaMode</a></span> = <span class="idlMemberValue">0</span>;</span>
-};</span></pre><section><h6 id="dictionary-wheeleventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-WheelEventInit"><code>WheelEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-WheelEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-button"><code>button</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-buttons"><code>buttons</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-clientX"><code>clientX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-clientY"><code>clientY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaMode"><code>deltaMode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaX"><code>deltaX</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaY"><code>deltaY</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaZ"><code>deltaZ</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-WheelEventInit-screenX"><code>screenX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-screenY"><code>screenY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-WheelEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict</span>]
-partial interface <span class="idlInterfaceID">WheelEvent</span> {
-<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-WheelEvent-initWheelEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-long-screenXArg-long-screenYArg-long-clientXArg-long-clientYArg-unsigned-short-buttonArg-EventTarget-relatedTargetArg-DOMString-modifiersListArg-double-deltaXArg-double-deltaYArg-double-deltaZArg-unsigned-long-deltaMode">initWheelEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenYArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientYArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">buttonArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">modifiersListArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaXArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaYArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaZArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned long</span> <span class="idlParamName">deltaMode</span></span>);</span>
-};</span></pre><section><h6 id="methods-10" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-WheelEvent-initWheelEvent"><code>initWheelEvent</code></dt><dd>
- <p>Initializes attributes of a <code>WheelEvent</code> object. This method has the same behavior as <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initWheelEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
- syntax for initializing a <code>WheelEvent</code>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">screenXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">screenYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">clientXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">clientYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">buttonArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">modifiersListArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>A <a class="normative" href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S"><em>white space</em></a> separated list of modifier key values to be activated
- on this object. As an example, <code>"Control Shift"</code> marks the control and shift modifiers as activated (the <a href="#widl-MouseEvent-ctrlKey">
- <code>MouseEvent.ctrlKey</code></a> and <a href="#widl-MouseEvent-shiftKey"><code>MouseEvent.shiftKey</code></a> inherited attributes will be <code>true</code>
- on the initialized <code>WheelEvent</code> object).</p>
- </td></tr><tr><td class="prmName">deltaXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaX"><code>WheelEvent.deltaX</code></a>.</p></td></tr><tr><td class="prmName">deltaYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaY"><code>WheelEvent.deltaY</code></a>.</p></td></tr><tr><td class="prmName">deltaZArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaZ"><code>WheelEvent.deltaZ</code></a>.</p></td></tr><tr><td class="prmName">deltaMode</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaMode"><code>WheelEvent.deltaMode</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-KeyboardEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-KeyboardEvent-initializers">Initializers for interface KeyboardEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-KeyboardEventInit">dictionary <span class="idlDictionaryID">KeyboardEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">DOMString</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-key">key</a></span> = <span class="idlMemberValue">""</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-location">location</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-repeat">repeat</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-charCode">charCode</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-keyCode">keyCode</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-which">which</a></span> = <span class="idlMemberValue">0</span>;</span>
-};</span></pre><section><h6 id="dictionary-keyboardeventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-KeyboardEventInit"><code>KeyboardEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-KeyboardEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-charCode"><code>charCode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-key"><code>key</code> of type <span class="idlMemberType">DOMString</span>, defaulting to <code>""</code></dt><dd></dd><dt id="widl-KeyboardEventInit-keyCode"><code>keyCode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-location"><code>location</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-repeat"><code>repeat</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-KeyboardEventInit-which"><code>which</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict</span>]
-partial interface <span class="idlInterfaceID">KeyboardEvent</span> {
-<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-KeyboardEvent-initKeyboardEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-DOMString-keyArg-unsigned-long-locationArg-DOMString-modifiersListArg-boolean-repeat">initKeyboardEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned long</span> <span class="idlParamName">locationArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">modifiersListArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">repeat</span></span>);</span>
-};</span></pre><section><h6 id="methods-11" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-KeyboardEvent-initKeyboardEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-DOMString-keyArg-unsigned-long-locationArg-DOMString-modifiersListArg-boolean-repeat"><code>initKeyboardEvent</code></dt><dd>
- <p>Initializes attributes of a <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.
- The value of <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a> remains undefined.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initKeyboardEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected
- future syntax for initializing a <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>.</p></td></tr><tr><td class="prmName">locationArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>.</p></td></tr><tr><td class="prmName">modifiersListArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>A <a class="normative" href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S"><em>white space</em></a> separated list of modifier key values to be activated on
- this object. As an example, <code>"Control Alt"</code> marks the control and alt modifiers as activated.</p>
- </td></tr><tr><td class="prmName">repeat</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies whether the key event is repeating. See <a href="#widl-KeyboardEvent-repeat"><code>KeyboardEvent.repeat</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- <section id="idl-interface-CompositionEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_idl-interface-CompositionEvent-initializers">Initializers for interface CompositionEvent</h5>
- <pre class="idl"><span class="idlDictionary" id="idl-def-CompositionEventInit">dictionary <span class="idlDictionaryID">CompositionEventInit</span> {
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
-<span class="idlMember"> <span class="idlMemberType">DOMString?</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-data">data</a></span> = <span class="idlMemberValue">null</span>;</span>
-};</span></pre><section><h6 id="dictionary-compositioneventinit-members" aria-level="5" role="heading">Dictionary <a class="idlType" href="#idl-def-CompositionEventInit"><code>CompositionEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-CompositionEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CompositionEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CompositionEventInit-data"><code>data</code> of type <span class="idlMemberType">DOMString</span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-CompositionEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-CompositionEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></section>
- <pre class="idl"><span class="idlInterface" id="idl-def-CompositionEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional CompositionEventInit compositionEventInitDict</span>]
-partial interface <span class="idlInterfaceID">CompositionEvent</span> {
-<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-CompositionEvent-initCompositionEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-DOMString-dataArg">initCompositionEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString?</span> <span class="idlParamName">dataArg</span></span>);</span>
-};</span></pre><section><h6 id="methods-12" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-CompositionEvent-initCompositionEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-DOMString-dataArg"><code>initCompositionEvent</code></dt><dd>
- <p>Initializes attributes of a <code>CompositionEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.
- The value of <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a> remains undefined.</p>
-
- <p class="warning"><strong>Warning!</strong> The <code>initCompositionEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected
- future syntax for initializing a <code>CompositionEvent</code>.</p>
-
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">dataArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section>
- </section>
-
- </section>
- </section>
-
- <!-- Appendix B: Legacy Key Attributes ========================================================-->
- <section id="legacy-key-attributes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_legacy-key-attributes"><span class="secno">6.5 </span>Legacy Key Attributes</h3>
- <p><em>This section is informative</em></p>
-
- <p>This section provides a non-normative description of the attributes that are currently used when handling keyboard events.</p>
-
- <p>These features were never formally specified and the current browser implementations vary in significant ways.
- The large amount of legacy content, including script libraries, that relies upon detecting the <a class="def" href="#glossary-user-agent">user agent</a>
- and acting accordingly means that any attempt to formalize these legacy attributes and events would risk breaking as much content as it would fix or enable.
- Additionally, these attributes are not suitable for international usage, nor do they address accessibility concerns.</p>
-
- <p>Therefore, this specification does not normatively define the events and attributes commonly employed for handling keyboard input,
- though they <em class="rfc2119" title="MAY">MAY</em> be present in <a class="def" href="#glossary-user-agent">user agents</a> for compatibility with legacy content.
- Authors <em class="rfc2119" title="SHOULD">SHOULD</em> use the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute instead of the <code class="attribute-name">charCode</code>
- and <code class="attribute-name">keyCode</code> attributes.</p>
-
- <p>However, for the purpose of documenting the current state of these features and their relation to normative events and attributes, this section provides an
- informative description.
- For implementations which do support these attributes and events, it is suggested that the definitions provided in this section be used.</p>
-
- <section id="KeyboardEvent-supplemental-interface" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_KeyboardEvent-supplemental-interface"><span class="secno">6.5.1 </span>Legacy <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> supplemental interface</h4>
- <p><em>This section is informative</em></p>
-
- <p>Browser support for keyboards has traditionally relied on three ad-hoc attributes, <code class="attribute-name">keyCode</code>, <code class="attribute-name">charCode</code>,
- and <code class="attribute-name">which</code>.</p>
-
- <p>All three of these attributes return a numerical code that represents some aspect of the key pressed: <code class="attribute-name">keyCode</code> is an index of
- the key itself. <code class="attribute-name">charCode</code> is the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> value of the character keys. <code class="attribute-name">which</code> is the character
- value where available and otherwise the key index. The values for these attributes, and the availability of the attribute, is inconsistent across platforms, keyboard
- languages and layouts, <a class="def" href="#glossary-user-agent">user agents</a>, versions, and even event types.</p>
-
- <dl>
- <dt><strong>Interface <em>KeyboardEvent (supplemental)</em></strong></dt>
- <dd>
- <p class="intro-dom">Introduced in DOM Level 3</p>
-
- <p>The partial
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
- interface is an informative extension of the
- <a href="#interface-KeyboardEvent">KeyboardEvent</a>
- interface, which adds the
- <a href="#widl-KeyboardEvent-charCode">charCode</a>,
- <a href="#widl-KeyboardEvent-keyCode">keyCode</a>,
- and <a href="#widl-KeyboardEvent-which">which</a>
- attributes.</p>
-
- <p>The partial
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
- interface can be obtained by using the
- <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("KeyboardEvent")</code></a>
- method call in implementations that support this extension.</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent-2">partial interface <span class="idlInterfaceID">KeyboardEvent</span> {
-<span class="idlSectionComment"> // The following support legacy user agents</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-charCode">charCode</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-keyCode">keyCode</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-which">which</a></span>;</span>
-};</span></pre><section><h5 id="attributes-9" aria-level="4" role="heading">Attributes</h5><dl class="attributes"><dt id="widl-KeyboardEvent-charCode"><code>charCode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
- <p><code class="attribute-name">charCode</code> holds a character value, for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events which
- generate character input. The value is the Unicode reference number (code point) of that character (e.g. <code>event.charCode = event.char.charCodeAt(0)</code>).
- For <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> or <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events, the
- value of <code class="attribute-name">charCode</code> is <code>0</code>.</p>
- </dd><dt id="widl-KeyboardEvent-keyCode"><code>keyCode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
- <p><code class="attribute-name">keyCode</code> holds a system- and implementation-dependent numerical code signifying the unmodified identifier associated with the
- key pressed. Unlike the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
- attribute, the set of possible values are not normatively defined in this specification. Typically, these value of the <code class="attribute-name">keyCode</code>
- <em class="rfc2119" title="SHOULD">SHOULD</em> represent the decimal codepoint in <acronym title="American Standard Code for Information Interchange">ASCII</acronym> [<a href="#ref-rfc20">RFC20</a>][<a href="#ref-US-ASCII">US-<acronym title="American Standard Code for Information Interchange">ASCII</acronym></a>] or Windows 1252 [<a href="#ref-WIN1252">WIN1252</a>],
- but <em class="rfc2119" title="MAY">MAY</em> be drawn from a different appropriate character set. Implementations that are unable to identify a key use the key value <code class="key">'0'</code>.</p>
-
- <p>See <a href="#legacy-key-models">Legacy key models</a> for more details on how to determine the values for <code class="attribute-name">keyCode</code>.</p>
- </dd><dt id="widl-KeyboardEvent-which"><code>which</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
- <p><code>which</code> holds a system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. In most cases,
- the value is identical to <code class="attribute-name"><a href="#widl-KeyboardEvent-keyCode">keyCode</a></code>.</p>
- </dd></dl></section>
-
- </dd>
- </dl>
- </section>
-
- <section id="legacy-key-models" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_legacy-key-models"><span class="secno">6.5.2 </span>Legacy key models</h4>
- <p><em>This section is informative</em></p>
-
- <p>Implementations differ on which values are exposed on these attributes for different event types. An implementation <em class="rfc2119" title="MAY">MAY</em> choose to expose both virtual key codes
- and character codes in the <code class="attribute-name">keyCode</code> property (<em>conflated model</em>), or report separate <code class="attribute-name">keyCode</code>
- and <code class="attribute-name">charCode</code> properties (<em>split model</em>).</p>
-
- <section id="determine-keydown-keyup-keyCode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_determine-keydown-keyup-keyCode">How to determine <code class="attribute-name">keyCode</code> for <code>keydown</code>
- and <code>keyup</code> events</h5>
-
- <p>The <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> or <a class="eventtype" href="#event-type-keyup">
- <code>keyup</code></a> events is calculated as follows:</p>
-
- <ol>
- <li>Read the virtual key code from the operating system's event information, if such information is available.</li>
- <li>If an Input Method Editor is processing key input and the event is <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>, return 229.</li>
- <li>If input key when pressed without modifiers would insert a numerical character (0-9), return the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> code of that numerical character.</li>
- <li>If input key when pressed without modifiers would insert a a lower case character in the a-z alphabetical range, return the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> code of the upper case equivalent.</li>
- <li>If the implementation supports a key code conversion table for the operating system and platform, look up the value. If the conversion table specifies an alternate
- virtual key value for the given input, return the specified value.</li>
- <li>If the key's function, as determined in an implementation-specific way, corresponds to one of the keys in the <a href="#fixed-virtual-key-codes">table of fixed
- virtual key codes</a>, return the corresponding key code.</li>
- <li>Return the virtual key code from the operating system.</li>
- <li>If no key code was found, return 0.</li>
- </ol>
- </section>
-
- <section id="determine-keypress-keyCode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_determine-keypress-keyCode">How to determine <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events</h5>
-
- <p>The <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events is calculated as follows:</p>
-
- <ol>
- <li>If the implementation supports a <em>conflated model</em>, set <code class="attribute-name">keyCode</code> to the Unicode code point of the character being entered.
- </li>
- <li>If the implementation supports a <em>split model</em>, set <code class="attribute-name">keyCode</code> to 0.</li>
- </ol>
- </section>
-
- <section id="fixed-virtual-key-codes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_fixed-virtual-key-codes">Fixed virtual key codes</h5>
-
- <p>The virtual key codes for the following keys do not usually change with keyboard layouts on desktop systems:</p>
-
- <table class="legacy-key-table">
- <tbody><tr>
- <th>Key</th>
- <th class="cell-center">Virtual Key<br>Code</th>
- <th>Notes</th>
- </tr>
- <tr><td><code class="key">'Backspace'</code></td> <td class="cell-center">8</td> <td></td> </tr>
- <tr><td><code class="key">'Tab'</code></td> <td class="cell-center">9</td> <td></td> </tr>
- <tr><td><code class="key">'Enter'</code></td> <td class="cell-center">13</td> <td></td> </tr>
- <tr><td><code class="key">'Shift'</code></td> <td class="cell-center">16</td> <td></td> </tr>
- <tr><td><code class="key">'Control'</code></td> <td class="cell-center">17</td> <td></td> </tr>
- <tr><td><code class="key">'Alt'</code></td> <td class="cell-center">18</td> <td></td> </tr>
- <tr><td><code class="key">'CapsLock'</code></td> <td class="cell-center">20</td> <td></td> </tr>
- <tr><td><code class="key">'Escape'</code></td> <td class="cell-center">27</td> <td><em>Esc</em></td> </tr>
- <tr><td><code class="key">' '</code></td> <td class="cell-center">32</td> <td><em>Space</em></td> </tr>
- <tr><td><code class="key">'PageUp'</code></td> <td class="cell-center">33</td> <td></td> </tr>
- <tr><td><code class="key">'PageDown'</code></td> <td class="cell-center">34</td> <td></td> </tr>
- <tr><td><code class="key">'End'</code></td> <td class="cell-center">35</td> <td></td> </tr>
- <tr><td><code class="key">'Home'</code></td> <td class="cell-center">36</td> <td></td> </tr>
- <tr><td><code class="key">'Left'</code></td> <td class="cell-center">37</td> <td></td> </tr>
- <tr><td><code class="key">'Up'</code></td> <td class="cell-center">38</td> <td></td> </tr>
- <tr><td><code class="key">'Right'</code></td> <td class="cell-center">39</td> <td></td> </tr>
- <tr><td><code class="key">'Down'</code></td> <td class="cell-center">40</td> <td></td> </tr>
- <tr><td><code class="key">'Delete'</code></td> <td class="cell-center">46</td> <td><em>Del</em></td> </tr>
- </tbody></table>
- </section>
-
- <section id="optionally-fixed-virtual-key-codes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_optionally-fixed-virtual-key-codes">Optionally fixed virtual key codes</h5>
-
- <p>The following punctuation characters <em class="rfc2119" title="MAY">MAY</em> change virtual codes between keyboard layouts, but reporting these values will likely be more compatible with legacy content
- expecting US-English keyboard layout:</p>
-
- <table class="legacy-key-table">
- <tbody><tr>
- <th>Key</th>
- <th class="cell-center">Character</th>
- <th class="cell-center">Virtual Key<br>Code</th>
- </tr>
- <tr><td>Semicolon</td> <td class="cell-center"><code class="glyph">';'</code></td> <td class="cell-center">186</td> </tr>
- <tr><td>Colon</td> <td class="cell-center"><code class="glyph">':'</code></td> <td class="cell-center">186</td> </tr>
- <tr><td>Equals sign</td> <td class="cell-center"><code class="glyph">'='</code></td> <td class="cell-center">187</td> </tr>
- <tr><td>Plus</td> <td class="cell-center"><code class="glyph">'+'</code></td> <td class="cell-center">187</td> </tr>
- <tr><td>Comma</td> <td class="cell-center"><code class="glyph">','</code></td> <td class="cell-center">188</td> </tr>
- <tr><td>Less than sign</td> <td class="cell-center"><code class="glyph">'<'</code></td> <td class="cell-center">188</td> </tr>
- <tr><td>Minus</td> <td class="cell-center"><code class="glyph">'-'</code></td> <td class="cell-center">189</td> </tr>
- <tr><td>Underscore</td> <td class="cell-center"><code class="glyph">'_'</code></td> <td class="cell-center">189</td> </tr>
- <tr><td>Period</td> <td class="cell-center"><code class="glyph">'.'</code></td> <td class="cell-center">190</td> </tr>
- <tr><td>Greater than sign</td> <td class="cell-center"><code class="glyph">'>'</code></td> <td class="cell-center">190</td> </tr>
- <tr><td>Forward slash</td> <td class="cell-center"><code class="glyph">'/'</code></td> <td class="cell-center">191</td> </tr>
- <tr><td>Question mark</td> <td class="cell-center"><code class="glyph">'?'</code></td> <td class="cell-center">191</td> </tr>
- <tr><td>Backtick</td> <td class="cell-center"><code class="glyph">'`'</code></td> <td class="cell-center">192</td> </tr>
- <tr><td>Tilde</td> <td class="cell-center"><code class="glyph">'~'</code></td> <td class="cell-center">192</td> </tr>
- <tr><td>Opening square bracket</td> <td class="cell-center"><code class="glyph">'['</code></td> <td class="cell-center">219</td> </tr>
- <tr><td>Opening curly brace</td> <td class="cell-center"><code class="glyph">'{'</code></td> <td class="cell-center">219</td> </tr>
- <tr><td>Backslash</td> <td class="cell-center"><code class="glyph">'\'</code></td> <td class="cell-center">220</td> </tr>
- <tr><td>Pipe</td> <td class="cell-center"><code class="glyph">'|'</code></td> <td class="cell-center">220</td> </tr>
- <tr><td>Closing square bracket</td> <td class="cell-center"><code class="glyph">']'</code></td> <td class="cell-center">221</td> </tr>
- <tr><td>Closing curly brace</td> <td class="cell-center"><code class="glyph">'}'</code></td> <td class="cell-center">221</td> </tr>
- <tr><td>Single quote</td> <td class="cell-center"><code class="glyph">'''</code></td> <td class="cell-center">222</td> </tr>
- <tr><td>Double quote</td> <td class="cell-center"><code class="glyph">'"'</code></td> <td class="cell-center">222</td> </tr>
- </tbody></table>
- </section>
- </section>
- </section>
-
- <!-- Appendix C: Legacy Event Types ========================================================-->
- <section id="legacy-event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_legacy-event-types"><span class="secno">6.6 </span>Legacy Event Types</h3>
- <p><em>This section is informative</em></p>
-
- <p>This section provides a non-normative description of the event types that are deprecated in this document.</p>
-
- <p>The purpose of this section is to document the current state of these features and their relation to normative events.
- For implementations which do support these events, it is suggested that the definitions provided in this section be used.</p>
-
- <p>The following table provides an informative summary of the event types which are deprecated in this specification. They are included here for reference and completeness.</p>
-
- <table class="data-table" summary="This table contains the complete list of the deprecated 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.">
- <tbody><tr>
- <th>Event Type</th>
- <th>Sync / Async</th>
- <th>Bubbling phase</th>
- <th>Trusted event target types</th>
- <th>DOM interface</th>
- <th>Cancelable</th>
- <th>Default Action</th>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- <td>Yes</td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Text</code>, <code>Comment</code>, <code>CDATASection</code>, <code>ProcessingInstruction</code></td>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Element</code></td>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a></td>
- <td>Sync</td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>DocumentFragment</code>, <code>Element</code>, <code>Attr</code>
- </td>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- <td><abbr title="Number, Other">No</abbr></td>
- <td>None</td>
- </tr>
- <tr>
- <td><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></td>
- <td>Sync</td>
- <td>Yes</td>
- <td><code>Document</code>, <code>Element</code></td>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- <td>Yes</td>
- <td>Varies:
- launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
- <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
- <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
- other event</td>
- </tr>
- </tbody></table>
-
- <section id="legacy-uievent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_legacy-uievent-events"><span class="secno">6.6.1 </span>Legacy <a href="#interface-UIEvent"><code>UIEvent</code></a> events</h4>
-
- <!-- DOMActivate -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMActivate"><dfn id="dfn-domactivate"><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMActivate</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element being activated</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a button, link, or other state-changing element is activated. Refer to
- <a href="#event-flow-activation">Activation triggers and behavior</a> for more details.</p>
-
- <p class="warning" id="DOMActivate-deprecated"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a> is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">
- deprecates</a> the use of this event type in favor of the related <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click">
- <code>click</code></a>. Other specifications <em class="rfc2119" title="MAY">MAY</em> define and maintain their own <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a>
- <a class="def" href="#glossary-event-type">event type</a> for backwards compatibility.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_106"><span>Note</span></div><p class="" id="DOMActivate-click"><strong>Note:</strong> While <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> and <a class="eventtype" href="#event-type-click"><code>click</code></a> are not completely equivalent, implemented behavior for the <a class="eventtype" href="#event-type-click"><code>click</code></a>
- <a class="def" href="#glossary-event-type">event type</a> has developed to encompass the most critical accessibility aspects for which the <a class="eventtype" href="#event-type-DOMActivate">
- <code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a> was designed, and is more widely implemented. Content authors are encouraged
- to use the <a class="eventtype" href="#event-type-click"><code>click</code></a> <a class="def" href="#glossary-event-type">event type</a> rather than the related
- <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> or <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> <a class="def" href="#glossary-event-type">event type</a> to ensure maximum accessibility.</p></div>
- </dd>
- </dl>
- </div>
-
- <p>Implementations which support the <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event
- type</a> <em class="rfc2119" title="SHOULD">SHOULD</em> also dispatch a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event as a <a class="def" href="#glossary-default-action">
- default action</a> of a <a class="eventtype" href="#event-type-click"><code>click</code></a> event which is associated with an <a class="def" href="#glossary-activation-trigger">
- activation trigger</a>. However, such implementations <em class="rfc2119" title="SHOULD">SHOULD</em> only initiate the associated <a class="def" href="#glossary-activation-behavior">activation behavior</a>
- once for any given occurrence of an <a class="def" href="#glossary-activation-trigger">activation trigger</a>.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a>
- <a class="def" href="#glossary-event-type">event type</a> is <em class="rfc2119" title="REQUIRED">REQUIRED</em> to be supported for XForms [<cite><a class="informative" href="#ref-xforms">XFORMS</a></cite>],
- which is intended for implementation within a <a class="def" href="#glossary-host-language">host language</a>. In a scenario where a plugin or script-based implementation
- of XForms is intended for installation in a native implementation of this specification which does not support the <a class="eventtype" href="#event-type-DOMActivate">
- <code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a>, the XForms <a class="def" href="#glossary-user-agent">user agent</a>
- has to synthesize and dispatch its own <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events based on the appropriate <a class="def" href="#glossary-activation-trigger">activation triggers</a>. Thus, when a <a class="eventtype" href="#event-type-click"><code>click</code></a> event is dispatched
- by the DOM Level 3 Events <a class="def" href="#glossary-user-agent">user agent</a>, the XForms <a class="def" href="#glossary-user-agent">user agent</a> has to
- determine whether to synthesize a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event with the same relevant properties as a
- <a class="def" href="#glossary-default-action">default action</a> of that <a class="eventtype" href="#event-type-click"><code>click</code></a> event. Appropriate
- cues might be whether the <a class="eventtype" href="#event-type-click"><code>click</code></a> event is <a href="#trusted-events">trusted</a>, or whether its <a class="def" href="#glossary-event-target">event target</a> has a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event listener
- registered.</p>
- </div>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_107"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Don't rely upon the interoperable support of <a class="eventtype" href="#event-type-DOMActivate">
- <code>DOMActivate</code></a> in many <a class="def" href="#glossary-user-agent">user agents</a>. Use the <a class="eventtype" href="#event-type-click"><code>click</code></a>
- <a class="def" href="#glossary-event-type">event type</a> for more accessible behavior instead, due to wider implementation.</p></div>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">
- event type</a> is deprecated in this specification.</p>
-
- <section id="legacy-uievent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_legacy-uievent-event-order">Activation event order</h5>
-
- <p>If the <code>DOMActivate</code> event is supported by the <a class="def" href="#glossary-user-agent">user agent</a>, then the
- events <em class="rfc2119" title="MUST">MUST</em> be dispatched in a set order relative to each other: (with only pertinent events listed):</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
- <td><a class="def" href="#glossary-default-action">default action</a>, if supported
- by the <a class="def" href="#glossary-user-agent">user agent</a>; synthesized; <code>trusted="false"</code></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td colspan="2">
- <em>All other <a class="def" href="#glossary-default-action">default actions</a>,
- including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
- </td>
- </tr>
- </tbody></table>
-
- <p>If the focused element is activated by a key event, then the following shows the typical sequence of events (with only pertinent events listed):</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td><em class="rfc2119" title="MUST">MUST</em> be a key which can activate the element, such as the
- <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key,
- or the element is not activated</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
- <td><a class="def" href="#glossary-default-action">default action</a>; synthesized; <code>trusted="false"</code></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
- <td><a class="def" href="#glossary-default-action">default action</a>, if supported
- by the <a class="def" href="#glossary-user-agent">user agent</a>; synthesized; <code>trusted="false"</code></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td colspan="2">
- <em>All other <a class="def" href="#glossary-default-action">default actions</a>,
- including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
- </td>
- </tr>
- </tbody></table>
- </section>
- </section>
-
- <section id="legacy-focusevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_legacy-focusevent-events"><span class="secno">6.6.2 </span>Legacy <a href="#interface-FocusEvent"><code>FocusEvent</code></a> events</h4>
-
- <!-- DOMFocusIn -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMFocusIn"><dfn id="dfn-domfocusin"><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMFocusIn</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> receives
- focus. The focus <em class="rfc2119" title="MUST">MUST</em> be given to the element before the dispatch of this event type. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type <a class="eventtype" href="#event-type-focus"><code>focus</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a> event type is defined in this
- specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in favor
- of the related event types <a class="eventtype" href="#event-type-focus"><code>focus</code></a> and <a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a>.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMFocusOut -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMFocusOut"><dfn id="dfn-domfocusout"><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMFocusOut</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
- <code>null</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> loses
- focus. The focus <em class="rfc2119" title="MUST">MUST</em> be taken from the element before the dispatch of this event type. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type <a class="eventtype" href="#event-type-blur"><code>blur</code></a>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a> event type is defined in
- this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in
- favor of the related event types <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focusout"><code>focusout</code></a>.</p>
- </dd>
- </dl>
- </div>
-
- <section id="legacy-focusevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_legacy-focusevent-event-order">Legacy FocusEvent event order</h5>
- <p>
- The following is the typical sequence of events when a focus is shifted between elements, including the deprecated
- <a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a>
- and <a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a>
- events. The order shown assumes that no element is initially focused.</p>
-
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User shifts focus</em></td>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
- <td>Sent before first target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
- <td>Sent after first target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
- <td>If supported</td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colspan="2"><em>User shifts focus</em></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
- <td>Sent before first target element loses focus</td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
- <td>Sent before second target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">6.</td>
- <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
- <td>Sent after first target element loses focus</td>
- </tr>
- <tr>
- <td class="cell-number">7.</td>
- <td><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></td>
- <td>If supported</td>
- </tr>
- <tr>
- <td class="cell-number">8.</td>
- <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
- <td>Sent after second target element receives focus</td>
- </tr>
- <tr>
- <td class="cell-number">9.</td>
- <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
- <td>If supported</td>
- </tr>
- </tbody></table>
- </section>
-
- </section>
-
- <section id="legacy-keyboardevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_legacy-keyboardevent-events"><span class="secno">6.6.3 </span>Legacy <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> events</h4>
-
- <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is the traditional method for capturing key events and
- processing them before the DOM is updated with the effects of the key press. Code that makes use of the
- <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
- event typically relies on the legacy
- <a href="#widl-KeyboardEvent-charCode">charCode</a>,
- <a href="#widl-KeyboardEvent-keyCode">keyCode</a>,
- and <a href="#widl-KeyboardEvent-which">which</a>
- attributes.</p>
-
- <p>Note that the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is specific to key events, and has been replaced
- by the more general event sequence of <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
- and <a class="eventtype" href="#event-type-input"><code>input</code></a> events.
- These new input events are not specific to keyboard actions and can be used to capture user input regardless of the original source.
- </p>
-
- <!-- keypress -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-keypress"><dfn id="dfn-keypress"><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>keypress</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Document</code>, <code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>Varies:
- launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
- <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
- <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
- other event</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- focused element processing the key event, root element if no suitable input element focused</li>
- <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
- <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
- <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
- <code>0</code></li>
- <li><a href="#widl-KeyboardEvent-charCode"><code class="attribute-name">KeyboardEvent.charCode</code></a>:
- legacy character value for this event</li>
- <li><a href="#widl-KeyboardEvent-keyCode"><code class="attribute-name">KeyboardEvent.keyCode</code></a>:
- legacy numerical code for this key</li>
- <li><a href="#widl-KeyboardEvent-which"><code class="attribute-name">KeyboardEvent.which</code></a>:
- legacy numerical code for this key</li>
- <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
- the key value of the key pressed.</li>
- <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
- the location of the key on the device.</li>
- <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
- <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
- <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
- <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
- <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
- <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
- <code>true</code> if a key has been depressed long enough to trigger key repetition, otherwise <code>false</code></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>If supported by a <a class="def" href="#glossary-user-agent">user agent</a>, this event <em class="rfc2119" title="MUST">MUST</em> be dispatched when a key is pressed down, if and only if that key normally produces a <a class="def" href="#glossary-character-value">character value</a>. The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is device
- dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>. It <em class="rfc2119" title="MUST NOT">MUST NOT</em> be fired when using an <a class="def" href="#glossary-ime">input method editor</a>.
- If this event is canceled, it should prevent the
- <a class="eventtype" href="#event-type-input"><code>input</code></a>
- event from firing, in addition to canceling the
- <a class="def" href="#glossary-default-action">default action</a>.</p>
-
- <p>Authors <em class="rfc2119" title="SHOULD">SHOULD</em> use the
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
- event instead of the
- <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
- event.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_108"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is traditionally associated with detecting a
- <a class="def" href="#glossary-character-value">character value</a> rather than a physical key, and might not be available on all keys in some configurations.</p></div>
-
- <div class="warning">
- <p><strong>Warning!</strong></p>
- <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is defined in this specification for
- reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.
- When in editing contexts, authors can subscribe to the <code>beforeinput</code> event instead.
- </p>
- </div>
-
- </dd>
- </dl>
- </div>
-
- <section id="keypress-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_keypress-event-order"><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event order</h5>
-
- <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
- <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event and before the
- <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event associated with the same key.</p>
-
- <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
- <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> event and before the
- <a class="eventtype" href="#event-type-input"><code>input</code></a> event associated with the same key.</p>
-
- <p>The sequence of key events for user-agents the support the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event
- is demonstrated in the following example:</p>
-
- <div class="example">
- <div class="example-title"></div>
- <table class="event-sequence-table">
- <tbody><tr>
- <td class="cell-number"></td>
- <th>Event Name</th>
- <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br>key</code></a></th>
- <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br>data</code></a></th>
- </tr>
- <tr>
- <td class="cell-number">1.</td>
- <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
- <td class="cell-center"><code class="key">'a'</code></td>
- <td class="cell-center"></td>
- </tr>
- <tr>
- <td class="cell-number">2.</td>
- <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"><code class="key">'a'</code></td>
- </tr>
- <tr>
- <td class="cell-number">3.</td>
- <td><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></td>
- <td class="cell-center"><code class="key">'a'</code></td>
- <td class="cell-center"></td>
- </tr>
- <tr>
- <td class="cell-number"></td>
- <td colapsan="3"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
- character in to the DOM.</em></td>
- </tr>
- <tr>
- <td class="cell-number">4.</td>
- <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
- <td class="cell-center"></td>
- <td class="cell-center"></td>
- </tr>
- <tr>
- <td class="cell-number">5.</td>
- <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
- <td class="cell-center"><code class="key">'a'</code></td>
- <td class="cell-center"></td>
- </tr>
- </tbody></table>
- </div>
- </section>
- </section>
-
- <section id="legacy-mutationevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_legacy-mutationevent-events"><span class="secno">6.6.4 </span>Legacy <a href="#interface-MutationEvent"><code>MutationEvent</code></a> events</h4>
-
- <p>The mutation and mutation name event modules are designed to allow notification of any changes to the structure of a document, including attribute, text, or name
- modifications.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_109"><span>Note</span></div><p class=""><strong>Note:</strong> None of the event types associated with the <code>MutationEvent</code> interface are designated as cancelable. This stems from
- the fact that it is very difficult to make use of existing DOM interfaces which cause document modifications if any change to the document might or might not take
- place due to cancelation of the resulting event. Although this is still a desired capability, it was decided that it would be better left until the addition of
- transactions into the DOM.</p></div>
-
- <p>Many single modifications of the tree can cause multiple mutation events to be dispatched. Rather than attempt to specify the ordering of mutation events due to
- every possible modification of the tree, the ordering of these events is left to the implementation.</p>
-
- <div class="warning">
- <p><strong>Warning!</strong></p>
- <p>The <a href="#interface-MutationEvent">MutationEvent interface</a> was introduced in DOM Level 2 Events, but has not yet been
- completely and interoperably implemented across <a class="def" href="#glossary-user-agent">user agents</a>.
- In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge.
- </p>
- <p>DOM4 [<a href="#references-DOM4">DOM4</a>] provides a new mechanism using a <code>MutationObserver</code> interface which
- addresses the use cases that mutation events solve, but in a more performant manner.
- Thus, this specification describes mutation events for reference and completeness of legacy behavior, but
- <a class="def" href="#glossary-deprecated">deprecates</a> the use of the <a href="#interface-MutationEvent"><code>MutationEvent</code></a> interface.
- </p>
- </div>
-
- <section id="interface-MutationEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_interface-MutationEvent">Interface MutationEvent</h5>
-
- <p class="intro-dom">Introduced in DOM Level 2, deprecated in DOM Level 3</p>
-
- <p>The <code>MutationEvent</code> interface provides specific contextual information associated with Mutation events.</p>
-
- <p>To create an instance of the <code>MutationEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("MutationEvent")</code></a>
- method call.</p>
-
- <pre class="idl"><span class="idlInterface" id="idl-def-MutationEvent">interface <span class="idlInterfaceID">MutationEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
-<span class="idlSectionComment"> // attrChangeType</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#MODIFICATION">MODIFICATION</a></span> = <span class="idlConstValue">1</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#ADDITION">ADDITION</a></span> = <span class="idlConstValue">2</span>;</span>
-<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#REMOVAL">REMOVAL</a></span> = <span class="idlConstValue">3</span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">Node?</span> <span class="idlAttrName"><a href="#widl-MutationEvent-relatedNode">relatedNode</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-prevValue">prevValue</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-newValue">newValue</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-attrName">attrName</a></span>;</span>
-<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MutationEvent-attrChange">attrChange</a></span>;</span>
-<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-MutationEvent-initMutationEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-Node-relatedNodeArg-DOMString-prevValueArg-DOMString-newValueArg-DOMString-attrNameArg-unsigned-short-attrChangeArg">initMutationEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">Node?</span> <span class="idlParamName">relatedNodeArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">prevValueArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">newValueArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">attrNameArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">attrChangeArg</span></span>);</span>
-};</span></pre><section><h6 id="attributes-10" aria-level="5" role="heading">Attributes</h6><dl class="attributes"><dt id="widl-MutationEvent-attrChange"><code>attrChange</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
- <p><code>attrChange</code> indicates the type of change which triggered the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event. The values can be <code>MODIFICATION</code>, <code>ADDITION</code>, or <code>REMOVAL</code>.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
-
- <div class="note"><div class="note-title" aria-level="6" role="heading" id="h_note_110"><span>Note</span></div><p class=""><strong>Note:</strong> There is no defined constant for the attrChange value of 0 (the un-initialized value).</p></div>
- </dd><dt id="widl-MutationEvent-attrName"><code>attrName</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p><code>attrName</code> indicates the name of the changed <code>Attr</code> node in a <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd><dt id="widl-MutationEvent-newValue"><code>newValue</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p><code>newValue</code> indicates the new value of the <code>Attr</code> node in <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- events, and of the <code>CharacterData</code> node in <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
- events.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd><dt id="widl-MutationEvent-prevValue"><code>prevValue</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
- <p><code>prevValue</code> indicates the previous value of the <code>Attr</code> node in <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- events, and of the <code>CharacterData</code> node in <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
- events.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
- </dd><dt id="widl-MutationEvent-relatedNode"><code>relatedNode</code> of type <span class="idlAttrType">Node</span>, readonly , nullable</dt><dd>
- <p><code>relatedNode</code> <em class="rfc2119" title="MUST">MUST</em> be used to identify a secondary node related to a mutation event. For example, if a mutation event is dispatched to a node indicating
- that its parent has changed, the <code>relatedNode</code> will be the changed parent. If an event is instead dispatched to a subtree indicating a node was changed
- within it, the <code>relatedNode</code> <em class="rfc2119" title="MUST">MUST</em> be the changed node. In the case of the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event it indicates the <code>Attr</code> node which was modified, added, or removed.</p>
-
- <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
- </dd></dl></section><section><h6 id="methods-13" aria-level="5" role="heading">Methods</h6><dl class="methods"><dt id="widl-MutationEvent-initMutationEvent"><code>initMutationEvent</code></dt><dd>
- <p>Initializes attributes of a <code>MutationEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
-
- <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
- </td></tr><tr><td class="prmName">relatedNodeArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span role="img" aria-label="True">✔</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MutationEvent-relatedNode"><code>MutationEvent.relatedNode</code></a>.</p>
- </td></tr><tr><td class="prmName">prevValueArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MutationEvent-prevValue"><code>MutationEvent.prevValue</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">
- empty string</a>.</p>
- </td></tr><tr><td class="prmName">newValueArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MutationEvent-newValue"><code>MutationEvent.newValue</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty
- string</a>.</p>
- </td></tr><tr><td class="prmName">attrNameArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MutationEvent-attrName"><code>MutationEvent.attrName</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty
- string</a>.</p>
- </td></tr><tr><td class="prmName">attrChangeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc">
- <p>Specifies <a href="#widl-MutationEvent-attrChange"><code>MutationEvent.attrChange</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>0</code>.</p>
- </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></section><section><h6 id="constants-3" aria-level="5" role="heading">Constants</h6><dl class="constants"><dt id="widl-MutationEvent-ADDITION"><code>ADDITION</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The <code>Attr</code> was just added.</p>
- </dd><dt id="widl-MutationEvent-MODIFICATION"><code>MODIFICATION</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The <code>Attr</code> was modified in place.</p>
- </dd><dt id="widl-MutationEvent-REMOVAL"><code>REMOVAL</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
- <p>The <code>Attr</code> was just removed.</p>
- </dd></dl></section>
- </section>
-
- <p>The mutation event types are listed below.</p>
-
- <!-- DOMAttrModified -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMAttrModified"><dfn id="dfn-domattrmodified"><a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMAttrModified</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Element</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element whose attribute is being modified</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the name of the changed <code>Attr</code> node</li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- the numerical code corresponding to the most applicable <a href="#widl-MutationEvent-attrChangeType">attrChangeType</a></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- the <code>Attr</code> node that has been modified, added, or removed.</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- new value of the attribute, if the <code>Attr</code> node has been added or modified</li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- previous value of the attribute, if the <code>Attr</code> node has been removed or modified</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event after an <code>Attr.value</code> has been modified and after an <code>Attr</code>
- node has been added to or removed from an <code>Element</code>. The <a class="def" href="#glossary-event-target">event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the <code>Element</code>
- node where the change occurred. It is implementation dependent whether this event type occurs when the children of the <code>Attr</code> node are changed in ways
- that do not affect the value of <code>Attr.value</code>.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a> event type is defined
- in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMCharacterDataModified -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMCharacterDataModified"><dfn id="dfn-domcharacterdatamodified"><a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMCharacterDataModified</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><code>Text</code>, <code>Comment</code>, <code>CDATASection</code>, <code>ProcessingInstruction</code></td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- object whose content is being modified</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- parent node of the object whose content is being modified</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- new value of the object</li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- previous value of the object</li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event after <code>CharacterData.data</code> or <code>ProcessingInstruction.data</code>
- have been modified, but the node itself has not been inserted or deleted. The <a class="def" href="#glossary-event-target">event target</a> of this event <em class="rfc2119" title="MUST">MUST</em>
- be the <code>CharacterData</code> node or the <code>ProcessingInstruction</code> node.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
- event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
- use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMNodeInserted -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMNodeInserted"><dfn id="dfn-domnodeinserted"><a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMNodeInserted</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><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>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element which is being inserted</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event type when a node other than an <code>Attr</code> node has been added as a child
- of another node. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> dispatch this event when an <code>Attr</code> node has been added to an <code>Element</code>
- node (see <a href="#DOMNodeInserted-attr">note</a> below). This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the insertion has taken place. The <a class="def" href="#glossary-event-target">
- event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being inserted.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_111"><span>Note</span></div><p class="" id="DOMNodeInserted-attr"><strong>Note:</strong> For detecting attribute insertion, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event type instead.</p></div>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a> event type is defined in this specification
- for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMNodeInsertedIntoDocument -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMNodeInsertedIntoDocument"><dfn id="dfn-domnodeinsertedintodocument"><a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMNodeInsertedIntoDocument</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><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>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element which is being inserted</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node has been inserted into a document, either through direct insertion
- of the node or insertion of a subtree in which it is contained. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> treat an <code>Attr</code>
- node as part of an <code>Element</code>'s subtree. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the insertion has taken place. The <a class="def" href="#glossary-event-target">
- event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being inserted. If the node is being directly inserted, the event type <a class="eventtype" href="#event-type-DOMNodeInserted">
- <code>DOMNodeInserted</code></a> <em class="rfc2119" title="MUST">MUST</em> occur before this event type.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a>
- event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
- use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMNodeRemoved -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMNodeRemoved"><dfn id="dfn-domnoderemoved"><a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMNodeRemoved</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><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>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element which is being removed</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node other than an <code>Attr</code> node is being removed from its
- parent node. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> dispatch this event when an <code>Attr</code> node is being removed from its <code>ownerElement</code>
- (see <a href="#DOMNodeRemoved-attr">note</a> below). This event <em class="rfc2119" title="MUST">MUST</em> be dispatched before the removal takes place. The <a class="def" href="#glossary-event-target">
- event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being removed.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_112"><span>Note</span></div><p class="" id="DOMNodeRemoved-attr"><strong>Note:</strong> For reliably detecting attribute removal, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event type instead.</p></div>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a> event type is defined
- in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.
- </p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMNodeRemovedFromDocument -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMNodeRemovedFromDocument"><dfn id="dfn-domnoderemovedfromdocument"><a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMNodeRemovedFromDocument</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Target</th>
- <td><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>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- element which is being removed</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node is being removed from a document, either through direct removal
- of the node or removal of a subtree in which it is contained. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> treat an <code>Attr</code>
- node as part of an <code>Element</code>'s subtree. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched before the removal takes place. The <a class="def" href="#glossary-event-target">event
- target</a> of this event type <em class="rfc2119" title="MUST">MUST</em> be the node being removed. If the node is being directly removed, the event type <a class="eventtype" href="#event-type-DOMNodeRemoved">
- <code>DOMNodeRemoved</code></a> <em class="rfc2119" title="MUST">MUST</em> occur before this event type.</p>
-
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_113"><span>Note</span></div><p class=""><strong>Note:</strong> For reliably detecting attribute removal, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
- event type instead.</p></div>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a>
- event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
- use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- <!-- DOMSubtreeModified -->
- <div class="event-definition">
- <dl>
- <dt id="event-type-DOMSubtreeModified"><dfn id="dfn-domsubtreemodified"><a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a></dfn></dt>
- <dd>
- <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
- <tbody><tr>
- <th>Type</th>
- <td><strong><code>DOMSubtreeModified</code></strong></td>
- </tr>
- <tr>
- <th>Interface</th>
- <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
- </tr>
- <tr>
- <th>Sync / Async</th>
- <td>Sync</td>
- </tr>
- <tr>
- <th>Bubbles</th>
- <td>Yes</td>
- </tr>
- <tr>
- <th>Target</th>
- <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>DocumentFragment</code>, <code>Element</code>, <code>Attr</code>
- </td>
- </tr>
- <tr>
- <th>Cancelable</th>
- <td><abbr title="Number, Other">No</abbr></td>
- </tr>
- <tr>
- <th>Default action</th>
- <td>None</td>
- </tr>
- <tr>
- <th>Context info</th>
- <td>
- <ul>
- <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
- parent node of subtree being modified</li>
- <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
- <code>0</code></li>
- <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
- <code>null</code></li>
- <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
- the <a class="def" href="#glossary-empty-string">empty string</a></li>
- </ul>
- </td>
- </tr>
- </tbody></table>
-
- <p>This is a general event for notification of all changes to the document. It can be used instead of the more specific mutation and mutation name events. It <em class="rfc2119" title="MAY">MAY</em> be
- dispatched after a single modification to the document or, at the implementation's discretion, after multiple changes have occurred. The latter case <em class="rfc2119" title="SHOULD">SHOULD</em> generally
- be used to accommodate multiple changes which occur either simultaneously or in rapid succession. The target of this event <em class="rfc2119" title="MUST">MUST</em> be the lowest common parent of the
- changes which have taken place. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after any other events caused by the mutation(s) have occurred.</p>
-
- <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a> event type is defined in this
- specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
- </dd>
- </dl>
- </div>
-
- </section>
-
- </section>
-
- <!-- Appendix D: Extending Events ========================================================-->
- <section id="extending_events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_extending_events"><span class="secno">6.7 </span>Extending Events</h3>
- <p><em>This section is informative</em></p>
-
- <section id="extending_events-intro" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_extending_events-intro"><span class="secno">6.7.1 </span>Introduction</h4>
- <p>This specification defines several interfaces and many events, however, this is not an exhaustive set of events for all purposes. To allow content
- authors and implementers to add desired functionality, this specification provides two mechanisms for extend this set of interfaces and events without creating
- conflicts: <a href="#extending_events-Custom_Events">custom events</a> and <a href="#extending_events-Impl_Extensions">implementation-specific extensions</a>.</p>
- </section>
-
- <section id="extending_events-Custom_Events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_extending_events-Custom_Events"><span class="secno">6.7.2 </span>Custom Events</h4>
- <p>A script author <em class="rfc2119" title="MAY">MAY</em> wish to define an application in terms of functional components, with event types that are meaningful to the application architecture. The
- content author can use the <a href="#interface-CustomEvent"><code>CustomEvent</code></a> interface to create their own events appropriate to the level of abstraction
- they are using.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A content author might have created an application which features a dynamically generated bar chart. This bar chart is meant to be updated
- every 5 minutes, or when a feed shows new information, or when the user refreshes it manually by clicking a button. There are several handlers that have to be
- called when the chart needs to be updated: the application has to fetch the most recent data, show an icon to the user that the event is being updated, and rebuild
- the chart. To manage this, the content author can choose to create a custom <q>updateChart</q> event, which is fired whenever one of the trigger conditions is
- met:</p>
- <pre><code>
-var chartData = ...;
-var evt = document.createEvent("CustomEvent");
-evt.initCustomEvent( "updateChart", true, false, { data: chartData });
-document.documentElement.dispatchEvent(evt);
-</code></pre>
- </div>
- </section>
-
- <section id="extending_events-Impl_Extensions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_extending_events-Impl_Extensions"><span class="secno">6.7.3 </span>Implementation-Specific Extensions</h4>
- <p>While a new event is being designed and prototyped, or when an event is intended for implementation-specific functionality, it is desirable to distinguish it from
- standardized events. Implementors <em class="rfc2119" title="SHOULD">SHOULD</em> prefix event types specific to their implementations with a short string to distinguish it from the same event in other
- implementations and from standardized events. This is similar to the <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords" title="CSS 2.1: Syntax and basic data types">
- vendor-specific keyword prefixes</a> in CSS, though without the dashes (<code>"-"</code>) used in CSS, since that can cause problems when used as an attribute
- name in Javascript.</p>
-
- <div class="example">
- <div class="example-title"></div>
- <p>A particular browser vendor, <q>FooCorp</q>, might wish to introduce a new event, <code>jump</code>. This vendor implements
- <code>fooJump</code> in their browser, using their vendor-specific prefix, <code>'foo'</code>. Early adopters start experimenting with the event,
- using <code>someElement.addEventListener("fooJump", doJump, false )</code>, and provide feedback to FooCorp, who change the behavior of <code>fooJump</code>
- accordingly.</p>
-
- <p>After some time, another vendor, <q>BarOrg</q>, decides they also want the functionality, but implement it slightly differently, so they use their own vendor-specific
- prefix, <code>"bar"</code> in their event type name, <code>barJump</code>. Content authors experimenting with this version of the
- <code>jump</code> event type register events with BarOrg's event type name. Content authors who wish to write code that accounts for both browsers
- can either register each event type separately with specific handlers, or use the same handler and switch on the name of the event type. Thus, early experiments in different
- codebases do not conflict, and the early adopter is able to write easily-maintained code for multiple implementations.</p>
-
- <p>Eventually, as the feature matures, the behavior of both browsers stabilize and might converge due to content author and user feedback or through formal standardization.
- As this stabilization occurs, and risk of conflicts decrease, content authors can remove the forked code, and use the <code>jump</code> event type name (even
- before it is formally standardized) using the same event handler and the more generic registration method <code>someElement.addEventListener( "jump", doJump, false)</code>.</p>
- </div>
-
- <section id="extending_events-prefixes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_extending_events-prefixes">Known Implementation-Specific Prefixes</h5>
- <p>At the time of writing, the following event-type name prefixes are known to exist:</p>
- <table border="1" cellpadding="2" cellspacing="0" summary="Known event-type name prefixes">
- <thead>
- <tr>
- <th>Prefix</th>
- <th>Web Engine (Organization)</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>moz</code>, <code>Moz</code></td>
- <td>Gecko (Mozilla)</td>
- </tr>
- <tr>
- <td><code>ms</code>, <code>MS</code></td>
- <td>Trident (Microsoft)</td>
- </tr>
- <tr>
- <td><code>o</code>, <code>O</code></td>
- <td>Presto (Opera Software)</td>
- </tr>
- <tr>
- <td><code>webkit</code></td>
- <td>WebKit (Apple, Google, others)</td>
- </tr>
- </tbody>
- </table>
- </section>
- </section>
- </section>
-
- <!-- Appendix E: Security Considerations ========================================================-->
- <section id="security-considerations-Security" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_security-considerations-Security"><span class="secno">6.8 </span>Security Considerations</h3>
-
- <p>This appendix discusses security considerations for DOM Level 3 Events implementations. The discussion is limited to security issues that arise directly
- from implementation of the event model, APIs and events defined in this specification. Implementations typically support other features like scripting languages,
- other APIs and additional events not defined in this document. These features constitute an unknown factor and are out of scope of this document. Implementers <em class="rfc2119" title="SHOULD">SHOULD</em>
- consult the specifications of such features for their respective security considerations.</p>
-
- <p>Many of the event types defined in this specification are dispatched in response to user actions. This allows malicious event listeners to gain access to information
- users would typically consider confidential, e.g., typos they might have made when filling out a form, if they reconsider their answer to a multiple choice question
- shortly before submitting a form, their typing rate or primary input mechanism. In the worst case, malicious event listeners are able to capture all user interactions
- and submit them to a third party through means, while not defined in DOM Level 3 Events, generally available in DOM implementations, such as the XMLHttpRequest
- interface.</p>
-
- <p>In DOM implementations that support facilities to load external data, events like the <a class="eventtype internalDFN" href="#dfn-error"><code>error</code></a> event can provide access to sensitive information about
- the environment of the computer system or network. An example would be a malicious HTML document that attempts to embed a resource on the local network or the localhost
- on different ports. An embedded <a class="def" href="#glossary-DOM-application">DOM application</a> could then listen for <a class="eventtype internalDFN" href="#dfn-error"><code>error</code></a>
- and <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a> events to determine which other computers in a network are accessible from the local system or which ports are open on the
- system to prepare further attacks.</p>
-
- <p>An implementation of DOM Level 3 Events alone is generally insufficient to perform attacks of this kind and the security considerations of the facilities that possibly
- support such attacks apply. For conformance with this specification, DOM implementations <em class="rfc2119" title="MAY">MAY</em> take reasonable steps to ensure that <a class="def" href="#glossary-DOM-application">
- DOM applications</a> do not get access to confidential or sensitive information, for example, they might choose to dispatch no <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a>
- events to nodes that attempt to embed resources on the local network.</p>
- </section>
-
- <!-- Appendix F: Changes ========================================================-->
- <section id="changes-Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_changes-Changes"><span class="secno">6.9 </span>Changes</h3>
-
- <section id="changes-DOMEvents2to3Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_changes-DOMEvents2to3Changes"><span class="secno">6.9.1 </span>Changes between DOM Level 2 Events and DOM Level 3 Events</h4>
-
- <p>Numerous clarifications to the interfaces and event types have been made. The <code>HTMLEvents</code> module is no longer defined in this document. The event types
- <a class="eventtype internalDFN" href="#dfn-focus-1"><code>focus</code></a> and <a class="eventtype internalDFN" href="#dfn-blur"><code>blur</code></a> have been added to the <a href="#interface-UIEvent"><code>UIEvent</code></a>
- module, the event type <a class="eventtype internalDFN" href="#dfn-dblclick"><code>dblclick</code></a> has been added to the <a href="#interface-MouseEvent"><code>MouseEvent</code></a> module. This new
- specification provides a better separation between the DOM event flow, the event types, and the DOM interfaces.</p>
-
- <section id="changes-DOMEvents2to3Changes-flow" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_changes-DOMEvents2to3Changes-flow">Changes to DOM Level 2 event flow</h5>
-
- <p>This new specification introduced the following new concepts in the event flow:</p>
-
- <ul>
- <li>ordering of event listeners: event listeners are now ordered while ordering was unspecified in DOM Level 2 Events.</li>
- <li>the event flow now includes the <a class="def" href="#glossary-defaultView">defaultView</a> (or <code>window</code>), to reflect existing implementations.</li>
- </ul>
- </section>
-
- <section id="changes-DOMEvents2to3Changes-event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_changes-DOMEvents2to3Changes-event-types">Changes to DOM Level 2 event types</h5>
-
- <p>Many clarifications have been made on the event types. The conformance is now explicitly defined against the event types, and not only in terms of interfaces used
- by the event types.</p>
-
- <p><code>"MutationEvents"</code> have been deprecated. Support for namespaced events, present in early drafts of this specification, has also been removed.</p>
-
- <p>For user agents which support the <a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a> and <a class="eventtype" href="#event-type-DOMNodeRemoved">
- <code>DOMNodeRemoved</code></a> event types, this specification no longer requires that the event type be fired for <code>Attr</code> nodes.</p>
-
- <p>The <a class="eventtype internalDFN" href="#dfn-resize"><code>resize</code></a> event type no longer bubbles, reflecting existing implementations.</p>
- </section>
-
- <section id="changes-DOMLevel2to3Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_changes-DOMLevel2to3Changes">Changes to DOM Level 2 Events interfaces</h5>
-
- <dl>
- <dt>Interface <a href="#interface-Event"><code>Event</code></a></dt>
- <dd>The <a href="#interface-Event"><code>Event</code></a> interface has one new attribute, <a href="#widl-Event-defaultPrevented"><code>Event.defaultPrevented</code></a>,
- and one new method, <a href="#widl-Event-stopImmediatePropagation"><code>Event.stopImmediatePropagation()</code></a>.<br>
- <a href="#widl-Event-timeStamp"><code>Event.timeStamp</code></a> is now a <code>Number</code> in the ECMAScript binding. A proposed correction to make the
- same change in [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>] is forthcoming.<br>
- DOM Level 3 Events considers the <a href="#widl-Event-type"><code>Event.type</code></a> attribute to be case-sensitive, while DOM Level 2 Events considers
- <a href="#widl-Event-type#widl-Event-type"><code>Event.type</code></a> to be case-insensitive.</dd>
-
- <dt>Interface <a href="#widl-EventTarget"><code>EventTarget</code></a></dt>
- <dd>The method <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> was modified.</dd>
-
- <dt>Interface <a href="#interface-MouseEvent"><code>MouseEvent</code></a></dt>
- <dd>The <a href="#interface-MouseEvent"><code>MouseEvent</code></a> interface has one new method <a href="#widl-MouseEvent-getModifierState"><code>MouseEvent.getModifierState()</code></a>.</dd>
-
- <dt>Exception <code>EventException</code></dt>
- <dd>The exception <code>EventException</code> <a href="#note-eventexcpetion-removed">is removed in this specification</a>. The prior <code>DISPATCH_REQUEST_ERR</code>
- code is re-mapped to a <code>DOMException</code> of type <code>InvalidStateError</code>.</dd>
- </dl>
- </section>
-
- <section id="changes-DOMLevel3Addons" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h5 aria-level="4" role="heading" id="h5_changes-DOMLevel3Addons">New Interfaces</h5>
-
- <p>The interfaces
- <a href="#interface-CustomEvent"><code>CustomEvent</code></a>,
- <a href="#interface-FocusEvent"><code>FocusEvent</code></a>,
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>,
- <a href="#interface-CompositionEvent"><code>CompositionEvent</code></a>,
- and <a href="#interface-WheelEvent"><code>WheelEvent</code></a>
- were added to the Events module.</p>
- </section>
- </section>
-
- <section id="changes-drafts" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_changes-drafts"><span class="secno">6.9.2 </span>Changes between different drafts of DOM Level 3 Events</h4>
-
- <p>The DOM Level 3 Events document was previously developed between 2000 and 2003, and and published as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, pending further feedback and interest from implementers.
- In 2006, it was picked up for revision and progress on the Recommendation Track, and is now being revised to reflect the current state of implementation and the
- needs of script authors.</p>
-
- <p>Despite its status only as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, rather than an official Recommendation, DOM 3 Events saw some implementation, and reference by other specifications, so care
- is being taken to cause minimal disruption, while still adapting the specification to the current environment.</p>
-
- <p>This specification has been reordered significantly from the earlier <abbr title="World Wide Web Consortium">W3C</abbr> Note form, and from the structure of DOM2 Events, in order to clarify the material. New
- diagrams have been put in place to represent hierarchies and events flows more clearly. Here are some of the more important changes between drafts:</p>
-
- <ul>
- <li>The <q>key identifier</q> feature has been renamed <q>key value</q> to disambiguate them from unique identifiers for keys.</li>
- <li>The
- <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
- was briefly (from 2003-2010) defined to have <code>keyIdentifier</code> and <code>keyLocation</code> attributes, but these
- were removed in favor of the current
- <a href="#widl-KeyboardEvent-key"><code>key</code></a>
- and <a href="#widl-KeyboardEvent-location"><code>location</code></a>
- attributes. These attributes were not widely implemented.</li>
- <li>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> also had a <code>char</code> attribute that was only used by the
- <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
- event. Since the keypress event has been deprecated, this attribute was no longer useful and was removed.</li>
- <li>The <code>change</code>, <code>submit</code>, and <code>reset</code> events were removed, since they were specific to HTML forms, and are specified in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>].</li>
- <li>The <code>textInput</code> event, originally proposed as a replacement for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>, was
- removed in favor of the current <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
- and <a class="eventtype" href="#event-type-input"><code>input</code></a> events.</li>
- <li>Namespaced events have been removed.</li>
- <li>Updated to use <a href="#references-WebIDL">Web IDL</a>.</li>
- <li>EventException has been removed.</li>
- </ul>
- </section>
- </section>
-
- <!-- Appendix G: Acknowledgements ========================================================-->
- <section id="acknowledgements-contributors" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_acknowledgements-contributors"><span class="secno">6.10 </span>Acknowledgements</h3>
-
- <p class="1st">Many people contributed to the DOM specifications (Level 1, 2 or 3), including participants of the DOM Working Group, the DOM Interest Group,the WebAPI
- Working Group, and the WebApps Working Group. We especially thank the following:</p>
-
- <p>Andrew Watson (Object Management Group), Andy Heninger (IBM), Angel Diaz (IBM), Arnaud Le Hors (<abbr title="World Wide Web Consortium">W3C</abbr> and IBM), Ashok Malhotra (IBM and Microsoft), Ben Chang (Oracle),
- Bill Smith (Sun), Bill Shea (Merrill Lynch), Bob Sutor (IBM), Chris Lovett (Microsoft), Chris Wilson (Microsoft), David Brownell (Sun), David Ezell (Hewlett-Packard
- Company), David Singer (IBM), Dimitris Dimitriadis (Improve AB and invited expert), Don Park (invited), Elena Litani (IBM), Eric Vasilik (Microsoft), Gavin Nicol
- (INSO), Ian Jacobs (<abbr title="World Wide Web Consortium">W3C</abbr>), James Clark (invited), James Davidson (Sun), Jared Sorensen (Novell), Jeroen van Rotterdam (X-Hive Corporation), Joe Kesselman (IBM),
- Joe Lapp (webMethods), Joe Marini (Macromedia), Johnny Stenback (Netscape/AOL), Jon Ferraiolo (Adobe), Jonathan Marsh (Microsoft), Jonathan Robie (Texcel Research
- and Software AG), Kim Adamson-Sharpe (SoftQuad Software Inc.), Lauren Wood (SoftQuad Software Inc., <em>former Chair</em>), Laurence Cable (Sun), Mark Davis (IBM),
- Mark Scardina (Oracle), Martin Dürst (<abbr title="World Wide Web Consortium">W3C</abbr>), Mary Brady (NIST), Mick Goulish (Software AG), Mike Champion (Arbortext and Software AG), Miles Sabin (Cromwell
- Media), Patti Lutsky (Arbortext), Paul Grosso (Arbortext), Peter Sharpe (SoftQuad Software Inc.), Phil Karlton (Netscape), Philippe Le Hégaret (<abbr title="World Wide Web Consortium">W3C</abbr>, <em><abbr title="World Wide Web Consortium">W3C</abbr> Team
- Contact and former Chair</em>), Ramesh Lekshmynarayanan (Merrill Lynch), Ray Whitmer (iMall, Excite@Home, and Netscape/AOL, <em>Chair</em>), Rezaur Rahman (Intel),
- Rich Rollman (Microsoft), Rick Gessner (Netscape), Rick Jelliffe (invited), Rob Relyea (Microsoft), Scott Isaacs (Microsoft), Sharon Adler (INSO), Steve Byrne (JavaSoft),
- Tim Bray (invited), Tim Yu (Oracle), Tom Pixley (Netscape/AOL), Vidur Apparao (Netscape), Vinod Anupam (Lucent), Anne van Kesteren (Opera Software), Arun Ranganathan
- (AOL), Björn Höhrmann, Charles McCathieNevile (Opera Software, <em>Co-Chair</em>), Christophe Jolif (ILOG), Dean Jackson (<abbr title="World Wide Web Consortium">W3C</abbr>, <em><abbr title="World Wide Web Consortium">W3C</abbr> Team Contact</em>),
- Doug Schepers (Vectoreal), Gorm Haug Eriksen (Opera Software), Ian Davis (Talis Information Limited), Ian Hickson (Google), John Robinson (AOL), Jonas Sicking (Mozilla
- Foundation), Luca Mascaro (HTML Writers Guild), Maciej Stachowiak (Apple Computer), Marc Hadley (Sun Microsystems), Michael Shenfield (Research In Motion), Robin
- Berjon, (Expway, <em>Co-Chair</em>) , Scott Hayman (Research In Motion), Stéphane Sire (IntuiLab), and T.V. Raman (Google).</p>
-
- <p><strong>Contributors:</strong> In the WebApps Working Group, the following people made substantial material contributions in the process of refining and revising
- this specification: Olli Pettay (Mozilla), Hallvord R. M. Steen (Opera), Travis Leithead (Microsoft), Hironori Bono (Google), Daniel Danilatos (Google), Glenn
- Adams (Samsung), Mark Vickers (Comcast), Bob Lund (Cable Laboratories) and Cameron McCormack (Invited Expert / Mozilla), .</p>
-
- <p><strong>Glossary contributors:</strong> Arnaud Le Hors (<abbr title="World Wide Web Consortium">W3C</abbr>) and Robert S. Sutor (IBM Research).</p>
-
- <p><strong>Test suite contributors:</strong> Fred Drake, Mary Brady (NIST), Carmelo Montanez (NIST), Rick Rivello (NIST), Robert Clary (Netscape), Neil Delima (IBM),
- with a special mention to Curt Arnold.</p>
-
- <p>Thanks to all those who have helped to improve this specification by sending suggestions and corrections (please, keep bugging us with your issues!), or writing
- informative books or Web sites: Brad Pettit, Dylan Schiemann, David Flanagan, Steven Pemberton, Curt Arnold, Al Gilman, Misha Wolf, Sigurd Lerstad, Michael B.
- Allen, Alexander J. Vincent, Martin Dürst, Ken Rehor, NAKANO Masayuki, Garrett Smith, Sergey Ilinsky, Martijn Wargers, Sean Hogan, Magnus Kristiansen, Alex
- Russell, Jorge Chamorro, Peter-Paul Koch, William Edney, Erik Arvidsson, Cameron McCormack, Kazuyuki Ashimura, Øistein E. Andersen, James Su, Tony Chang, Ojan Vafai,
- Richard Ishida, Paul Irish, Mike Taylor, Oliver Hunt, Alexey Proskuryakov, Giuseppe Pascale, and Jan Goyvaerts (regular-expressions.info).</p>
-
- <section id="acknowledgements-Productions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_acknowledgements-Productions"><span class="secno">6.10.1 </span>Production Systems</h4>
-
- <p>The current drafts of this specification are lovingly hand-crafted in HTML and SVG, using ReSpec to format the document according to <abbr title="World Wide Web Consortium">W3C</abbr> requirements.</p>
-
- <p>Earlier versions of this specification were written in XML — the HTML, OMG IDL, Java and ECMAScript bindings were all produced automatically. Thanks to Joe English,
- author of <a class="normative" href="http://www.flightlab.com/cost/">cost</a>, which was used as the basis for producing DOM Level 1. Thanks also to Gavin Nicol,
- who wrote the scripts which run on top of cost. Arnaud Le Hors and Philippe Le Hégaret maintained the scripts.</p>
-
- <p>After DOM Level 1, we used <a class="normative" href="http://xerces.apache.org/xerces-j/">Xerces</a> as the basis DOM implementation and wish to thank the authors.
- Philippe Le Hégaret and Arnaud Le Hors wrote the <a class="normative" href="http://dev.w3.org/cvsweb/java/classes/org/w3c/tools/specgenerator/">Java programs</a>
- which are the <a class="def" href="#glossary-DOM-application">DOM application</a>.</p>
-
- <p>Thanks also to Jan Kärrman, author of <a class="normative" href="http://user.it.uu.se/~jan/html2ps.html">html2ps</a>, which we use in creating the PostScript
- version of the specification.</p>
- </section>
- </section>
-
- <!-- Appendix H: References ========================================================-->
- <section id="references-role-references" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h3 aria-level="2" role="heading" id="h3_references-role-references"><span class="secno">6.11 </span>References</h3>
-
- <p>For the latest version of any <abbr title="World Wide Web Consortium">W3C</abbr> specification please consult the list of <a class="normative" href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> Technical Reports</a>
- available at http://www.w3.org/TR/. </p>
-
- <section id="references-References-Normative" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_references-References-Normative"><span class="secno">6.11.1 </span>Normative References</h4>
-
- <dl>
- <dt><strong>[BCP-47]</strong> Best Current Practice 47: Tags for Identifying Languages</dt>
- <dd>A. Phillips, M. Davis, Editors, September 2009. The specification for describing the structure, content, construction, and semantics of language tags to indicate
- the human language used. Available at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a></dd>
-
- <dt><strong>[CharMod]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2005/REC-charmod-20050215/">Character Model for the World Wide Web 1.0: Fundamentals</a></cite>, M. Dürst, F. Yergeau,
- R. Ishida, M. Wolf, T. Texin, Editors. World Wide Web Consortium, 15 February 2005. This version of the Character Model for the World Wide Web 1.0: Fundamentals
- specification is http://www.w3.org/TR/2005/REC-charmod-20050215/. The <a class="normative" href="http://www.w3.org/TR/charmod/">latest version of Character Model for
- the World Wide Web 1.0: Fundamentals</a> is available at http://www.w3.org/TR/charmod/. </dd>
-
- <dt><strong>[DOM3 Core]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/">Document Object Model Level 3 Core Specification</a></cite>, A. Le Hors, et al., Editors.
- World Wide Web Consortium, April 2004. This version of the Document Object Model Level 3 Core Specification is http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/.
- The <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/">latest version of DOM Level 3 Core</a> is available at http://www.w3.org/TR/DOM-Level-3-Core/. </dd>
-
- <dt><strong>[DOM2 Events]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/">Document Object Model Level 2 Events Specification</a></cite>, T. Pixley, Editor. World
- Wide Web Consortium, November 2000. This version of the Document Object Model Level 2 Events Specification is http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113.
- The <a class="normative" href="http://www.w3.org/TR/DOM-Level-2-Events/">latest version of Document Object Model Level 2 Events</a> is available
- at http://www.w3.org/TR/DOM-Level-2-Events/. </dd>
-
- <dt><strong>[ECMAScript]</strong></dt>
- <dd><cite><a href="http://ecma-international.org/ecma-262/5.1/">ECMAScript Language Specification</a></cite>, 5.1 Edition. European Computer Manufacturers Association,
- Standard ECMA-262, June 2011. This version of the ECMAScript Language is available from http://ecma-international.org/ecma-262/5.1/. </dd>
-
- <dt><strong>[HTML5]</strong></dt>
- <dd><cite class="w3cwd"><a href="http://www.w3.org/TR/2012/WD-html5-20120329/">HTML 5</a></cite>, I. Hickson, editor. World Wide Web Consortium, <span class="wip">work
- in progress</span>, 29 March 2012. This edition of HTML 5 is http://www.w3.org/TR/2012/WD-html5-20120329/. The <a href="http://www.w3.org/TR/html5/">latest edition of
- HTML 5</a> is available at http://www.w3.org/TR/html5/. </dd>
-
- <dt><strong>[Java]</strong></dt>
- <dd><cite><a href="http://www.oracle.com/technetwork/java/index.html">The Java Language Specification</a></cite>, J. Gosling, B. Joy, and G. Steele, Authors. Addison-Wesley, September
- 1996. Available at http://java.sun.com/docs/books/jls </dd>
-
- <dt id="ref-rfc2119"><strong>[RFC2119]</strong> Key words for use in RFCs to indicate Requirement Levels</dt>
- <dd>S Bradner, 1997. The specification for how to use English to specify normativity, as if it were a technical language. Available at <a href="http://www.ietf.org/rfc/rfc2119.txt">
- http://www.ietf.org/rfc/rfc2119.txt </a></dd>
-
- <dt><strong>[UAX #15]</strong></dt>
- <dd><cite><a href="http://www.unicode.org/reports/tr15/">Unicode Normalization Forms</a></cite>, The Unicode Standard Annex #15. The Unicode Consortium, 2006. The
- latest version of this annex is available at http://www.unicode.org/reports/tr15/.</dd>
-
- <dt><strong>[UIEvents]</strong></dt>
- <dd><cite><a href="https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm">UI Events</a></cite>,
- T. Leithead, G. Kacmarcik, eds. World Wide Web Consortium,
- <span class="wip">Editor's Draft</span>, 5 May 2013.
- </dd>
-
- <dt><strong>[Unicode]</strong></dt>
- <dd><cite>The Unicode Standard, Version 5.0</cite>, ISBN 0-321-48091-0, as updated periodically by the publication of new versions. See also <a class="normative" href="http://www.unicode.org/standard/versions/">Versions of the Unicode Standard</a>, available at http://www.unicode.org/standard/versions/ for
- latest version and additional information on versions of the standard and of the Unicode Character Database.</dd>
-
- <dt><strong>[WEB IDL]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/WebIDL/">Web IDL</a></cite>, C. McCormack. 19 April 2012. This version of the Web IDL Candidate Recommendation is:
- http://www.w3.org/TR/2012/CR-WebIDL-20120419/. The <a href="http://dev.w3.org/2006/webapi/WebIDL/">latest version of Web IDL</a> is available at
- http://dev.w3.org/2006/webapi/WebIDL/. </dd>
-
- <dt><strong>[XML Namespaces 1.0]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-names-20060816/">Namespaces in XML 1.0</a></cite>, T. Bray, D. Hollander, A. Layman, and R. Tobin, Editors. World
- Wide Web Consortium, 16 August 2006. This version of the Namespaces in XML 1.0 Specification is http://www.w3.org/TR/2006/REC-xml-names-20060816. The <a class="normative" href="http://www.w3.org/TR/xml-names/">latest version of Namespaces in XML 1.0</a> is available at http://www.w3.org/TR/xml-names/.</dd>
- </dl>
- </section>
-
- <section id="references-References-Informative" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
- <h4 aria-level="3" role="heading" id="h4_references-References-Informative"><span class="secno">6.11.2 </span>Informative References</h4>
- <dl>
- <dt><strong>[ARIA]</strong></dt>
- <dd><cite class="w3cwd"><a href="http://www.w3.org/TR/2009/WD-wai-aria-20091215/">Accessible Rich Internet Applications (WAI-ARIA) Version 1.0</a></cite>, J. Craig, M. Cooper,
- R. Schwerdtfeger, L. Seeman, L. Pappas, eds. World Wide Web Consortium, 18 January 2011. This version of the WAI-ARIA Candidate Recommendation is
- http://www.w3.org/TR/2011/CR-wai-aria-20110118/. The <a href="http://www.w3.org/TR/wai-aria/">latest edition of WAI-ARIA</a> is available at http://www.w3.org/TR/wai-aria/. </dd>
-
- <dt><strong>[XFORMS]</strong></dt>
- <dd><cite class="w3crec"><a href="http://www.w3.org/TR/2009/REC-xforms-20091020/">XForms 1.1</a></cite>, J. Boyer, ed. World Wide Web Consortium, <span class="wip">work
- in progress</span>, 20 October 2009. This edition of XForms 1.1 is http://www.w3.org/TR/2009/REC-xforms-20091020/. The <a href="http://www.w3.org/TR/xforms/">latest
- edition of XForms</a> is available at http://www.w3.org/TR/xforms/. </dd>
-
- <dt><strong>[CSS2.1]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a></cite>, B. Bos, T. Çelik,
- I. Hickson, H.W. Lie, Editors. World Wide Web Consortium, 07 June 2011, This version of the CSS 2.1 Recommendation is http://www.w3.org/TR/2011/REC-CSS2-20110607/.
- The <a class="normative" href="http://www.w3.org/TR/CSS2/">latest version of CSS 2.1</a> is available at http://www.w3.org/TR/CSS2/. </dd>
-
- <dt><strong>[DASE]</strong></dt>
- <dd><cite><a href="http://www.atsc.org/cms/standards/a100/a_100_2.pdf">ATSC A/100-2, DTV Application Software Environment Level 1 (DASE-1) Part 2: Declarative Applications
- and Environment</a></cite>. Advanced Television Systems Committee, 09 March 2003. Available at <a href="http://www.atsc.org/cms/standards/a100/a_100_2.pdf">
- http://www.atsc.org/cms/standards/a100/a_100_2.pdf </a>.</dd>
-
- <dt><strong>[DOM3 Load and Save]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/">Document Object Model Level 3 Load and Save Specification</a></cite>, J. Stenback, A. Heninger,
- Editors. World Wide Web Consortium, April 2004. This version of the DOM Level 3 Load and Save Specification is http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/.
- The <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-LS/">latest version of DOM Level 3 Load and Save</a> is available at http://www.w3.org/TR/DOM-Level-3-LS/. </dd>
-
- <dt><strong>[DOM2 Range]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/">Document Object Model (DOM) Level 2 Traversal and Range Specification</a></cite>, J. Kesselman,
- J. Robie, M. Champion, P. Sharpe, V. Apparao, L. Wood, Editors. World Wide Web Consortium, November 2000.</dd>
-
- <dt><strong>[DOM4]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/dom/">DOM4</a></cite>, A. van Kesteren, A. Gregor, Ms2ger, Editors. World Wide Web Consortium, <span class="wip">Working Draft</span>,
- 5 April 2012. </dd>
-
- <dt><strong>[DWW95]</strong></dt>
- <dd><cite>Developing International Software for Windows 95 and Windows NT: A Handbook for International Software Design</cite>, N. Kano, Author. Microsoft Press, 1995.
- ISBN 1-55615-840-8.</dd>
-
- <dt><strong>[HTML 4.01]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/1999/REC-html401-19991224/">HTML 4.01 Specification</a></cite>, D. Raggett, A. Le Hors, and I. Jacobs, Editors. World Wide
- Web Consortium, December 1999. This version of the HTML 4.01 Recommendation is http://www.w3.org/TR/1999/REC-html401-19991224. The <a class="normative" href="http://www.w3.org/TR/html4/">
- latest version of HTML 4</a> is available at http://www.w3.org/TR/html4/. </dd>
-
- <dt><strong>[HTML Editing]</strong></dt>
- <dd><cite><a href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html">HTML Editing APIs</a></cite>, A. Gregor, Editor. World Wide Web Consortium, <span class="wip">
- work in progress</span>, 12 March 2012. </dd>
-
- <dt><strong>[ISO9995-2/3]</strong></dt>
- <dd><cite><a href="http://www.iso.org/iso/search.htm?qt=9995&published=on">ISO/IEC 9995, Information technology -- Keyboard layouts for text and office systems -- Part 2:
- Alphanumeric Section and Part 3: Complementary layouts of the alphanumeric zone of the alphanumeric section.</a></cite></dd>
-
- <dt><strong>[ISO9995-8]</strong></dt>
- <dd><cite><a href="http://www.iso.org/iso/search.htm?qt=9995&published=on">ISO/IEC 9995-8:2006, Information technology -- Keyboard layouts for text and office systems --
- Part 8: Allocation of letters to the keys of a numeric keypad.</a></cite></dd>
-
- <dt><strong>[KeyEvent for Java]</strong></dt>
- <dd><cite><a href="http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html">Java™ Platform, Standard Edition 6 API Specification, Class java.awt.events.KeyEvent</a></cite>.
- Oracle. Available at http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html. </dd>
-
- <dt><strong>[Keys enumeration for .Net]</strong></dt>
- <dd><cite><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx">.NET Framework 4.5 Class Library, Keys Enumeration</a></cite>.
- Microsoft. Available at http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx.</dd>
-
- <dt><strong>[KeyProps]</strong></dt>
- <dd><cite class="w3cwd"><a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html">Legacy Keyboard Event Properties</a></cite>, D. Schepers, editor.
- World Wide Web Consortium, <span class="wip">work in progress</span>, 04 August 2010. This edition of Legacy Keyboard Event Properties is
- https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html.
- The <a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html">latest edition
- of Legacy Keyboard Event Properties</a> is available at https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html. </dd>
-
- <dt><strong>[OCAP]</strong></dt>
- <dd><cite><a href="http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf">Open Cable Application Platform 1.1.3</a></cite>. Cable Television Laboratories,
- Inc., 03 June 2010. Available at <a href="http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf">http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf</a>.</dd>
-
- <dt><strong>[PCRE]</strong></dt>
- <dd><cite><a href="http://www.pcre.org/">Perl Compatible Regular Expressions library</a></cite>. Available at http://www.pcre.org/. </dd>
-
- <dt><strong>[RFC20]</strong> <acronym title="American Standard Code for Information Interchange">ASCII</acronym> format for Network Interchange</dt>
- <dd>V. Cerf, 1969. Available at <a href="http://tools.ietf.org/rfc/rfc20.txt">http://tools.ietf.org/rfc/rfc20.txt</a></dd>
-
- <dt><strong>[US-<acronym title="American Standard Code for Information Interchange">ASCII</acronym>]</strong> Coded Character Set - 7-Bit American Standard Code for Information Interchange</dt>
- <dd>Standard ANSI X3.4-1986, ANSI, 1986.</dd>
-
- <dt><strong>[UAAG 2.0]</strong></dt>
- <dd><cite><a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/">User Agent Accessibility Guidelines (UAAG) 2.0</a></cite>, J. Allan, K. Ford, J. Richards, J. Spellman, editors.
- World Wide Web Consortium, <span class="wip">work in progress</span>, 8 March 2010. This version of the UAAG 2.0 specfication is http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/.
- The <a class="normative" href="http://www.w3.org/TR/UAAG20/">latest version of UAAG 2.0</a> is available at http://www.w3.org/TR/UAAG20/. </dd>
-
- <dt><strong>[WEB4CE]</strong></dt>
- <dd><cite><a href="http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI%29.aspx">ANSI/CEA-2014-B, Web-based Protocol and Framework for Remote User Interface on UPnPTM Networks
- and the Internet (Web4CE)</a></cite>. Consumer Electronics Association, January 2011. Available at <a href="http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI).aspx">
- http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI%29.aspx </a>.</dd>
-
- <dt><strong>[WIN1252]</strong></dt>
- <dd><a href="http://www.microsoft.com/globaldev/reference/sbcs/1252.htm">Windows 1252</a> a Coded Character Set - 8-Bit. Microsoft Corporation.</dd>
-
- <dt><strong>[XML 1.0]</strong></dt>
- <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816/">Extensible Markup Language (XML) 1.0</a></cite>, T. Bray, J. Paoli, C. M. Sperberg-McQueen, et. al,
- Editors. World Wide Web Consortium, August 2006. This version of the XML 1.0 Recommendation is http://www.w3.org/TR/2006/REC-xml-20060816/. The <a class="normative" href="http://www.w3.org/TR/xml/">latest version of XML 1.0</a> is available at http://www.w3.org/TR/xml/. </dd>
- </dl>
- </section>
- </section>
-
-
-
-</section><form action="http://www.w3.org/Bugs/Public/enter_bug.cgi" target="_blank" style="position: fixed; padding: 5px; top: 1em; right: 2em; font-family: sans-serif; font-size: 0.8em; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 0, 0);">Select text and <input type="submit" accesskey="f" value="file a bug" style="display: block;"><input type="hidden" name="comment" value=""><input type="hidden" name="product" value="WebAppsWG"><input type="hidden" name="component" value="DOM3 Events"></form></body></html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/html/WD-DOM3-Events-20131104.html Mon Nov 04 09:44:17 2013 -0800
@@ -0,0 +1,9572 @@
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US" data-bug-product="WebAppsWG" data-bug-component="DOM3 Events" typeof="bibo:Document w3p:WD" about="" property="dcterms:language" content="en" prefix="bibo: http://purl.org/ontology/bibo/ w3p: http://www.w3.org/2001/02pd/rec54#">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Document Object Model (DOM) Level 3 Events Specification</title>
+ <style type="text/css">/* --- ISSUES/NOTES --- */
+div.issue-title, div.note-title {
+ padding-right: 1em;
+ min-width: 7.5em;
+ color: #b9ab2d;
+}
+div.issue-title { color: #e05252; }
+div.note-title { color: #2b2; }
+div.issue-title span, div.note-title span {
+ text-transform: uppercase;
+}
+div.note, div.issue {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.note > p:first-child, .issue > p:first-child { margin-top: 0 }
+.issue, .note {
+ padding: .5em;
+ border-left-width: .5em;
+ border-left-style: solid;
+}
+div.issue, div.note {
+ padding: 1em 1.2em 0.5em;
+ margin: 1em 0;
+ position: relative;
+ clear: both;
+}
+span.note, span.issue { padding: .1em .5em .15em; }
+
+.issue {
+ border-color: #e05252;
+ background: #fbe9e9;
+}
+.note {
+ border-color: #52e052;
+ background: #e9fbe9;
+}
+
+
+</style><style type="text/css">/* --- WEB IDL --- */
+pre.idl {
+ border-top: 1px solid #90b8de;
+ border-bottom: 1px solid #90b8de;
+ padding: 1em;
+ line-height: 120%;
+}
+
+pre.idl::before {
+ content: "WebIDL";
+ display: block;
+ width: 150px;
+ background: #90b8de;
+ color: #fff;
+ font-family: initial;
+ padding: 3px;
+ font-weight: bold;
+ margin: -1em 0 1em -1em;
+}
+
+.idlType {
+ color: #ff4500;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+/*.idlModule*/
+/*.idlModuleID*/
+/*.idlInterface*/
+.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
+ font-weight: bold;
+ color: #005a9c;
+}
+a.idlEnumItem {
+ color: #000;
+ border-bottom: 1px dotted #ccc;
+ text-decoration: none;
+}
+
+.idlSuperclass {
+ font-style: italic;
+ color: #005a9c;
+}
+
+/*.idlAttribute*/
+.idlAttrType, .idlFieldType, .idlMemberType {
+ color: #005a9c;
+}
+.idlAttrName, .idlFieldName, .idlMemberName {
+ color: #ff4500;
+}
+.idlAttrName a, .idlFieldName a, .idlMemberName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlMethod*/
+.idlMethType, .idlCallbackType {
+ color: #005a9c;
+}
+.idlMethName {
+ color: #ff4500;
+}
+.idlMethName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlCtor*/
+.idlCtorName {
+ color: #ff4500;
+}
+.idlCtorName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlParam*/
+.idlParamType {
+ color: #005a9c;
+}
+.idlParamName, .idlDefaultValue {
+ font-style: italic;
+}
+
+.extAttr {
+ color: #666;
+}
+
+/*.idlSectionComment*/
+.idlSectionComment {
+ color: gray;
+}
+
+/*.idlConst*/
+.idlConstType {
+ color: #005a9c;
+}
+.idlConstName {
+ color: #ff4500;
+}
+.idlConstName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlException*/
+.idlExceptionID {
+ font-weight: bold;
+ color: #c00;
+}
+
+.idlTypedefID, .idlTypedefType {
+ color: #005a9c;
+}
+
+.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
+ color: #c00;
+ font-weight: normal;
+}
+
+.excName a {
+ font-family: monospace;
+}
+
+.idlRaises a.idlType, .excName a.idlType {
+ border-bottom: 1px dotted #c00;
+}
+
+.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
+ width: 45px;
+ text-align: center;
+}
+.excGetSetTrue, .prmNullTrue, .prmOptTrue { color: #0c0; }
+.excGetSetFalse, .prmNullFalse, .prmOptFalse { color: #c00; }
+
+.idlImplements a {
+ font-weight: bold;
+}
+
+dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
+ margin-left: 2em;
+}
+
+.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
+ font-weight: normal;
+}
+
+.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
+ font-weight: bold;
+ color: #000;
+ font-family: monospace;
+}
+
+.attributes dt code, .fields dt code, .dictionary-members dt code {
+ background: #ffffd2;
+}
+
+.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
+ color: #005a9c;
+ background: transparent;
+ font-family: inherit;
+ font-weight: normal;
+ font-style: italic;
+}
+
+.methods dt code {
+ background: #d9e6f8;
+}
+
+.constants dt code {
+ background: #ddffd2;
+}
+
+.constructors dt code {
+ background: #cfc;
+}
+
+.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
+ margin-bottom: 1em;
+}
+
+table.parameters, table.exceptions {
+ border-spacing: 0;
+ border-collapse: collapse;
+ margin: 0.5em 0;
+ width: 100%;
+}
+table.parameters { border-bottom: 1px solid #90b8de; }
+table.exceptions { border-bottom: 1px solid #deb890; }
+
+.parameters th, .exceptions th {
+ color: #fff;
+ padding: 3px 5px;
+ text-align: left;
+ font-family: initial;
+ font-weight: normal;
+ text-shadow: #666 1px 1px 0;
+}
+.parameters th { background: #90b8de; }
+.exceptions th { background: #deb890; }
+
+.parameters td, .exceptions td {
+ padding: 3px 10px;
+ border-top: 1px solid #ddd;
+ vertical-align: top;
+}
+
+.parameters tr:first-child td, .exceptions tr:first-child td {
+ border-top: none;
+}
+
+.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
+ width: 100px;
+}
+
+.parameters td.prmType {
+ width: 120px;
+}
+
+table.exceptions table {
+ border-spacing: 0;
+ border-collapse: collapse;
+ width: 100%;
+}
+</style><link rel="author" href="mailto:www-dom@w3.org" />
+ <link rel="help" href="http://www.w3.org/DOM/" />
+ <link rel="alternate stylesheet" type="text/css" media="screen" title="geek" href="geek.css" />
+ <link rel="stylesheet" type="text/css" href="spec-WD.css" />
+ <link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/w3c-tr.css" />
+ <link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/W3C-WD" />
+ <link rel="stylesheet" type="text/css" href="override.css" />
+
+ <script type="text/javascript" src="key-table-builder.js"></script>
+ <script type="text/javascript" src="fixup.js"></script>
+ <script src="bug-assist.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ var respecConfig = {
+ specStatus: "WD",
+ shortName: "DOM-Level-3-Events",
+ editors: [
+ {
+ name: "Gary Kacmarcik",
+ company: "Google, Inc.",
+ url: "mailto:garykac@google.com?subject=%5BDOM3-event%5D%20Spec%20Feedback",
+ companyURL: "http://www.google.com",
+ note: "Jun 2013 - present",
+ },
+ {
+ name: "Travis Leithead",
+ company: "Microsoft Corp.",
+ url: "mailto:travis.leithead@microsoft.com?subject=%5BDOM3-event%5D%20Spec%20Feedback",
+ companyURL: "http://www.microsoft.com",
+ note: "Feb 2012 - present",
+ },
+ {
+ name: "Jacob Rossi",
+ company: "Microsoft Corp.",
+ note: "Mar 2011 - Oct 2011",
+ },
+ {
+ name: "Doug Schepers",
+ company: "W3C",
+ note: "Mar 2008 - May 2011",
+ },
+ {
+ name: "Björn Höhrmann",
+ company: "Invited Expert",
+ note: "until Jan 2008",
+ },
+ {
+ name: "Philippe Le Hégaret",
+ company: "W3C",
+ note: "until Nov 2003",
+ },
+ {
+ name: "Tom Pixley",
+ company: "Netscape Communications Corporation",
+ note: "until Jul 2002",
+ }
+ ],
+ publishDate: "2013-11-04",
+ edDraftURI: "https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html",
+ previousPublishDate: "2012-09-06",
+ previousMaturity: "WD",
+ noIDLIn: true,
+ inlineCSS: true,
+ //noRecTrack: true,
+ wg: ["Web Applications Working Group"],
+ wgURI: ["http://www.w3.org/2008/webapps/"],
+ wgPublicList: "www-dom",
+ wgPatentURI: ["http://www.w3.org/2004/01/pp-impl/42538/status"],
+ maxTocLevel: 3
+ };
+ </script>
+<style type="text/css">/*****************************************************************
+ * ReSpec 3 CSS
+ * Robin Berjon - http://berjon.com/
+ *****************************************************************/
+
+/* --- INLINES --- */
+em.rfc2119 {
+ text-transform: lowercase;
+ font-variant: small-caps;
+ font-style: normal;
+ color: #900;
+}
+
+h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
+h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
+ border: none;
+}
+
+dfn {
+ font-weight: bold;
+}
+
+a.internalDFN {
+ color: inherit;
+ border-bottom: 1px solid #99c;
+ text-decoration: none;
+}
+
+a.externalDFN {
+ color: inherit;
+ border-bottom: 1px dotted #ccc;
+ text-decoration: none;
+}
+
+a.bibref {
+ text-decoration: none;
+}
+
+cite .bibref {
+ font-style: normal;
+}
+
+code {
+ color: #ff4500;
+}
+
+/* --- TOC --- */
+.toc a, .tof a {
+ text-decoration: none;
+}
+
+a .secno, a .figno {
+ color: #000;
+}
+
+ul.tof, ol.tof {
+ list-style: none outside none;
+}
+
+.caption {
+ margin-top: 0.5em;
+ font-style: italic;
+}
+
+/* --- TABLE --- */
+table.simple {
+ border-spacing: 0;
+ border-collapse: collapse;
+ border-bottom: 3px solid #005a9c;
+}
+
+.simple th {
+ background: #005a9c;
+ color: #fff;
+ padding: 3px 5px;
+ text-align: left;
+}
+
+.simple th[scope="row"] {
+ background: inherit;
+ color: inherit;
+ border-top: 1px solid #ddd;
+}
+
+.simple td {
+ padding: 3px 10px;
+ border-top: 1px solid #ddd;
+}
+
+.simple tr:nth-child(even) {
+ background: #f0f6ff;
+}
+
+/* --- DL --- */
+.section dd > p:first-child {
+ margin-top: 0;
+}
+
+.section dd > p:last-child {
+ margin-bottom: 0;
+}
+
+.section dd {
+ margin-bottom: 1em;
+}
+
+.section dl.attrs dd, .section dl.eldef dd {
+ margin-bottom: 0;
+}
+</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-WD" />
+<!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]-->
+</head>
+<body class="h-entry" style="" id="respecDocument"><div class="head" id="respecHeader">
+ <p>
+
+ <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C" /></a>
+
+ </p>
+ <h1 class="title p-name" id="title" property="dcterms:title">Document Object Model (DOM) Level 3 Events Specification</h1>
+
+ <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-11-04T08:00:00.000Z" id="w3c-working-draft-04-november-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Working Draft <span class="dt-published time">04 November 2013</span></h2>
+ <dl>
+
+ <dt>This version:</dt>
+ <dd><a class="u-url" href="http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131104/">http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131104/</a></dd>
+ <dt>Latest published version:</dt>
+ <dd><a href="http://www.w3.org/TR/DOM-Level-3-Events/">http://www.w3.org/TR/DOM-Level-3-Events/</a></dd>
+
+
+ <dt>Latest editor's draft:</dt>
+ <dd><a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html">https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html</a></dd>
+
+
+
+
+
+ <dt>Previous version:</dt>
+ <dd><a rel="dcterms:replaces" href="http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120906/">http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120906/</a></dd>
+
+
+ <dt>Editors:</dt>
+ <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Gary Kacmarcik" href="mailto:garykac@google.com?subject=%5BDOM3-event%5D%20Spec%20Feedback">Gary Kacmarcik</a>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com">Google, Inc.</a> (Jun 2013 - present)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Travis Leithead" href="mailto:travis.leithead@microsoft.com?subject=%5BDOM3-event%5D%20Spec%20Feedback">Travis Leithead</a>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.microsoft.com">Microsoft Corp.</a> (Feb 2012 - present)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Jacob Rossi</span>, Microsoft Corp. (Mar 2011 - Oct 2011)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Doug Schepers</span>, <abbr title="World Wide Web Consortium">W3C</abbr> (Mar 2008 - May 2011)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Björn Höhrmann</span>, Invited Expert (until Jan 2008)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Philippe Le Hégaret</span>, <abbr title="World Wide Web Consortium">W3C</abbr> (until Nov 2003)</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Tom Pixley</span>, Netscape Communications Corporation (until Jul 2002)</span>
+</dd>
+
+
+
+ </dl>
+
+
+
+
+
+ <p class="copyright">
+ <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
+ 2013
+
+ <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
+ (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
+ <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
+ <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>),
+
+ All Rights Reserved.
+
+ <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+ <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
+
+ <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
+
+ rules apply.
+ </p>
+
+
+ <hr />
+</div>
+
+<!-- Section: Abstract ========================================================-->
+
+ <div id="abstract" class="introductory section" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 id="h2_abstract">Abstract</h2>
+ <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 [<a href="#references-DOM2Events">DOM2 Events</a>].</p>
+ </div><div id="sotd" class="introductory section" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 id="h2_sotd">Status of This Document</h2>
+
+
+
+ <p>
+ <em>This section describes the status of this document at the time of its publication. Other
+ documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
+ of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
+ index</a> at http://www.w3.org/TR/.</em>
+ </p>
+
+ <p>This document is a Last Call Working Draft of the Document Object Model Level 3 Events (DOM3 Events) specification. This document was previously
+ published as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, pending further feedback from implementers, and is now being revised to reflect the current state of implementation. It is expected that
+ this specification will progress to <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation status after review and refinement.</p>
+
+ <p>The <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> (WebApps WG) believes this specification to be feature complete, subject to further
+ feedback during the Last Call period. The Last Call period extends through 27 September 2012. The public is encouraged to send comments to the WebApps Working Group's
+ public mailing list for DOM specifications <a href="mailto:www-dom@w3.org">www-dom@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-dom/">archive</a>)
+ with subject tag prefix <em>DOM3Events</em> (e.g., [DOM3Events] comment...).
+ See <a href="http://www.w3.org/Mail/"><abbr title="World Wide Web Consortium">W3C</abbr> mailing list and archive usage guidelines</a>.</p>
+
+ <p id="this-document-is-produced-by-the-web-app">This document is produced by the <a href="http://www.w3.org/2008/webapps/">Web Applications WG</a>, part of the <a href="http://www.w3.org/2006/rwc/Activity">Rich Web Clients Activity</a> in the <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Interaction/">Interaction Domain</a>. It is expected
+ that this document will progress along the <abbr title="World Wide Web Consortium">W3C</abbr>'s Recommendation track. Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership. This is
+ a draft document and <em class="rfc2119" title="MAY">MAY</em> 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 id="latest-editors-draft"><strong>You can find the latest
+ <a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html">Editor's Draft</a>
+ of this document in the
+ <a href="https://dvcs.w3.org/hg/"><abbr title="World Wide Web Consortium">W3C</abbr>'s Mercurial repository</a>,
+ which is updated on a regular basis.</strong></p>
+
+ <p id="unstable"><strong class="redNote">Implementers should be aware that this document is not stable.</strong> Implementers who are not
+ taking part in the discussions are likely to find the specification changing out from under them in incompatible ways. Vendors interested in implementing this document
+ before it eventually reaches the Candidate Recommendation stage should join the aforementioned mailing lists and take part in the discussions.</p>
+
+ <p>
+ This document was published by the <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> as a Working Draft.
+
+ This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
+
+
+ If you wish to make comments regarding this document, please send them to
+ <a href="mailto:www-dom@w3.org">www-dom@w3.org</a>
+ (<a href="mailto:www-dom-request@w3.org?subject=subscribe">subscribe</a>,
+ <a href="http://lists.w3.org/Archives/Public/www-dom/">archives</a>).
+
+
+
+
+ All comments are welcome.</p>
+
+
+ <p>
+ Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> 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
+
+ <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
+
+
+
+
+
+ <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent disclosures</a>
+
+ 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
+ <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
+ information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
+ 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
+
+
+ </p>
+
+
+
+
+</div><div id="toc" class="section"><h2 class="introductory" id="h2_toc">Table of Contents</h2><ul class="toc" id="respecContents"><li class="tocline"><a href="#dom-events" class="tocxref"><span class="secno">1. </span>Document Object Model Events</a><ul class="toc"><li class="tocline"><a href="#dom-events-overview" class="tocxref"><span class="secno">1.1 </span>Introduction</a></li><li class="tocline"><a href="#dom-events-conformance" class="tocxref"><span class="secno">1.2 </span>Conformance</a></li><li class="tocline"><a href="#style-conventions" class="tocxref"><span class="secno">1.3 </span>Stylistic Conventions</a></li></ul></li><li class="tocline"><a href="#glossary" class="tocxref"><span class="secno">2. </span>Glossary</a></li><li class="tocline"><a href="#dom-event-architecture" class="tocxref"><span class="secno">3. </span>DOM Event Architecture</a><ul class="toc"><li class="tocline"><a href="#event-flow" class="tocxref"><span class="secno">3.1 </span>Event dispatch and DOM event flow</a></li><li class="tocline"><a href="#event-flow-default-cancel" class="tocxref"><span class="secno">3.2 </span>Default actions and cancelable events</a></li><li class="tocline"><a href="#sync-async" class="tocxref"><span class="secno">3.3 </span>Synchronous and asynchronous events</a><ul class="toc"><li class="tocline"><a href="#event-order-and-loops" class="tocxref"><span class="secno">3.3.1 </span>Event order and event loops</a></li></ul></li><li class="tocline"><a href="#trusted-events" class="tocxref"><span class="secno">3.4 </span>Trusted events</a></li><li class="tocline"><a href="#event-flow-activation" class="tocxref"><span class="secno">3.5 </span>Activation triggers and behavior</a><ul class="toc"><li class="tocline"><a href="#click-synthesis" class="tocxref"><span class="secno">3.5.1 </span>Activation event synthesis</a></li><li class="tocline"><a href="#events-activation-event-order" class="tocxref"><span class="secno">3.5.2 </span>Activation event order</a></li></ul></li><li class="tocline"><a href="#event-exceptions" class="tocxref"><span class="secno">3.6 </span>Event exceptions</a></li></ul></li><li class="tocline"><a href="#event-interfaces" class="tocxref"><span class="secno">4. </span>Basic Event Interfaces</a><ul class="toc"><li class="tocline"><a href="#interface-Event" class="tocxref"><span class="secno">4.1 </span>Interface Event</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">4.1.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1.2 </span>Methods</a></li><li class="tocline"><a href="#constants" class="tocxref"><span class="secno">4.1.3 </span>Constants</a></li></ul></li><li class="tocline"><a href="#interface-CustomEvent" class="tocxref"><span class="secno">4.2 </span>Interface CustomEvent</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">4.2.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#interface-EventTarget" class="tocxref"><span class="secno">4.3 </span>Interface EventTarget</a><ul class="toc"><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">4.3.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#interface-EventListener" class="tocxref"><span class="secno">4.4 </span>Interface EventListener</a><ul class="toc"><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">4.4.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#interface-DocumentEvent" class="tocxref"><span class="secno">4.5 </span>Interface DocumentEvent</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">4.5.1 </span>Methods</a></li></ul></li></ul></li><li class="tocline"><a href="#events-module" class="tocxref"><span class="secno">5. </span>Events Module</a><ul class="toc"><li class="tocline"><a href="#event-types" class="tocxref"><span class="secno">5.1 </span>Event Types</a><ul class="toc"><li class="tocline"><a href="#event-types-list" class="tocxref"><span class="secno">5.1.1 </span>List of DOM3 Event Types</a></li></ul></li><li class="tocline"><a href="#event-definitions" class="tocxref"><span class="secno">5.2 </span>Event Module Definitions</a><ul class="toc"><li class="tocline"><a href="#events-uievents" class="tocxref"><span class="secno">5.2.1 </span>User Interface Event Types</a></li><li class="tocline"><a href="#events-focusevent" class="tocxref"><span class="secno">5.2.2 </span>Focus Event Types</a></li><li class="tocline"><a href="#events-mouseevents" class="tocxref"><span class="secno">5.2.3 </span>Mouse Event Types</a></li><li class="tocline"><a href="#events-wheelevents" class="tocxref"><span class="secno">5.2.4 </span>Wheel Event Types</a></li><li class="tocline"><a href="#events-inputevents" class="tocxref"><span class="secno">5.2.5 </span>Input Event Types</a></li><li class="tocline"><a href="#events-keyboardevents" class="tocxref"><span class="secno">5.2.6 </span>Keyboard Event Types</a></li><li class="tocline"><a href="#events-compositionevents" class="tocxref"><span class="secno">5.2.7 </span>Composition Event Types</a></li></ul></li></ul></li><li class="tocline"><a href="#keys" class="tocxref"><span class="secno">6. </span>Keyboard events and key values</a><ul class="toc"><li class="tocline"><a href="#keyboard-input" class="tocxref"><span class="secno">6.1 </span>Keyboard Input</a><ul class="toc"><li class="tocline"><a href="#key-legends" class="tocxref"><span class="secno">6.1.1 </span>Key Legends</a></li><li class="tocline"><a href="#keyboard-layout" class="tocxref"><span class="secno">6.1.2 </span>Keyboard Layout</a></li></ul></li><li class="tocline"><a href="#keys-keyvalues" class="tocxref"><span class="secno">6.2 </span>Key Values</a><ul class="toc"><li class="tocline"><a href="#keys-unicode" class="tocxref"><span class="secno">6.2.1 </span>Key Values and Unicode</a></li><li class="tocline"><a href="#keys-Modifiers" class="tocxref"><span class="secno">6.2.2 </span>Modifier keys</a></li><li class="tocline"><a href="#keys-DeadKeys" class="tocxref"><span class="secno">6.2.3 </span>Dead keys</a></li><li class="tocline"><a href="#keys-IME" class="tocxref"><span class="secno">6.2.4 </span>Input Method Editors</a></li><li class="tocline"><a href="#keys-cancelable_keys" class="tocxref"><span class="secno">6.2.5 </span>Default actions and cancelable keyboard events</a></li><li class="tocline"><a href="#keys-Guide" class="tocxref"><span class="secno">6.2.6 </span>Guidelines for selecting and defining key values</a></li></ul></li><li class="tocline"><a href="#key-value-tables" class="tocxref"><span class="secno">6.3 </span>Key Value Tables</a><ul class="toc"><li class="tocline"><a href="#keys-special" class="tocxref"><span class="secno">6.3.1 </span>Special Key Values</a></li><li class="tocline"><a href="#keys-modifier" class="tocxref"><span class="secno">6.3.2 </span>Modifier Keys</a></li><li class="tocline"><a href="#keys-whitespace" class="tocxref"><span class="secno">6.3.3 </span>Whitespace Keys</a></li><li class="tocline"><a href="#keys-navication" class="tocxref"><span class="secno">6.3.4 </span>Navigation Keys</a></li><li class="tocline"><a href="#keys-editing" class="tocxref"><span class="secno">6.3.5 </span>Editing Keys</a></li><li class="tocline"><a href="#keys-ui" class="tocxref"><span class="secno">6.3.6 </span>UI Keys</a></li><li class="tocline"><a href="#keys-device" class="tocxref"><span class="secno">6.3.7 </span>Device Keys</a></li><li class="tocline"><a href="#keys-composition" class="tocxref"><span class="secno">6.3.8 </span>IME and Composition Keys</a></li></ul></li><li class="tocline"><a href="#new-event-interface-initializers" class="tocxref"><span class="secno">6.4 </span>Initializing New Event Interfaces</a><ul class="toc"><li class="tocline"><a href="#event-initializers" class="tocxref"><span class="secno">6.4.1 </span>Supplemental Initializer Interfaces</a></li></ul></li><li class="tocline"><a href="#legacy-key-attributes" class="tocxref"><span class="secno">6.5 </span>Legacy Key Attributes</a><ul class="toc"><li class="tocline"><a href="#KeyboardEvent-supplemental-interface" class="tocxref"><span class="secno">6.5.1 </span>Legacy <span class="formerLink"><code>KeyboardEvent</code></span> supplemental interface</a></li><li class="tocline"><a href="#legacy-key-models" class="tocxref"><span class="secno">6.5.2 </span>Legacy key models</a></li></ul></li><li class="tocline"><a href="#legacy-event-types" class="tocxref"><span class="secno">6.6 </span>Legacy Event Types</a><ul class="toc"><li class="tocline"><a href="#legacy-uievent-events" class="tocxref"><span class="secno">6.6.1 </span>Legacy <span class="formerLink"><code>UIEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-focusevent-events" class="tocxref"><span class="secno">6.6.2 </span>Legacy <span class="formerLink"><code>FocusEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-keyboardevent-events" class="tocxref"><span class="secno">6.6.3 </span>Legacy <span class="formerLink"><code>KeyboardEvent</code></span> events</a></li><li class="tocline"><a href="#legacy-mutationevent-events" class="tocxref"><span class="secno">6.6.4 </span>Legacy <span class="formerLink"><code>MutationEvent</code></span> events</a></li></ul></li><li class="tocline"><a href="#extending_events" class="tocxref"><span class="secno">6.7 </span>Extending Events</a><ul class="toc"><li class="tocline"><a href="#extending_events-intro" class="tocxref"><span class="secno">6.7.1 </span>Introduction</a></li><li class="tocline"><a href="#extending_events-Custom_Events" class="tocxref"><span class="secno">6.7.2 </span>Custom Events</a></li><li class="tocline"><a href="#extending_events-Impl_Extensions" class="tocxref"><span class="secno">6.7.3 </span>Implementation-Specific Extensions</a></li></ul></li><li class="tocline"><a href="#security-considerations-Security" class="tocxref"><span class="secno">6.8 </span>Security Considerations</a></li><li class="tocline"><a href="#changes-Changes" class="tocxref"><span class="secno">6.9 </span>Changes</a><ul class="toc"><li class="tocline"><a href="#changes-DOMEvents2to3Changes" class="tocxref"><span class="secno">6.9.1 </span>Changes between DOM Level 2 Events and DOM Level 3 Events</a></li><li class="tocline"><a href="#changes-drafts" class="tocxref"><span class="secno">6.9.2 </span>Changes between different drafts of DOM Level 3 Events</a></li></ul></li><li class="tocline"><a href="#acknowledgements-contributors" class="tocxref"><span class="secno">6.10 </span>Acknowledgements</a><ul class="toc"><li class="tocline"><a href="#acknowledgements-Productions" class="tocxref"><span class="secno">6.10.1 </span>Production Systems</a></li></ul></li><li class="tocline"><a href="#references-role-references" class="tocxref"><span class="secno">6.11 </span>References</a><ul class="toc"><li class="tocline"><a href="#references-References-Normative" class="tocxref"><span class="secno">6.11.1 </span>Normative References</a></li><li class="tocline"><a href="#references-References-Informative" class="tocxref"><span class="secno">6.11.2 </span>Informative References</a></li></ul></li></ul></li></ul></div>
+
+
+<!-- Section: SOTD ========================================================-->
+
+
+
+
+<!-- Section 1: DOM3 Events Overview ========================================================-->
+
+ <div id="dom-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_dom-events"><span class="secno">1. </span>Document Object Model Events</h2>
+
+ <div id="dom-events-overview" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_dom-events-overview"><span class="secno">1.1 </span>Introduction</h3>
+ <p>DOM Events is designed with two main goals. The first goal is the design of an <a class="def" href="#glossary-event">event</a> 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 DOM Events is to provide a common subset of the current event systems used in existing 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>
+ </div>
+<!-- dom-events-overview -->
+
+
+ <div id="dom-events-conformance" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_dom-events-conformance"><span class="secno">1.2 </span>Conformance</h3>
+ <p><strong>This section is normative.</strong></p>
+
+ <p>Within this specification, the key words <q><em class="rfc2119" title="MUST">MUST</em></q>, <q><em class="rfc2119" title="MUST NOT">MUST NOT</em></q>, <q><em class="rfc2119" title="REQUIRED">REQUIRED</em></q>,
+ <q><em class="rfc2119" title="SHALL">SHALL</em></q>, <q><em class="rfc2119" title="SHALL NOT">SHALL NOT</em></q>, <q><em class="rfc2119" title="SHOULD">SHOULD</em></q>, <q><em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em></q>,
+ <q><em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em></q>, <q><em class="rfc2119" title="MAY">MAY</em></q>, and <q><em class="rfc2119" title="OPTIONAL">OPTIONAL</em></q> are to be interpreted as described in
+ <a href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a> [<a href="#ref-rfc2119">RFC2119</a>].</p>
+
+ <p>This specification is to be understood in the context of the DOM Level 3 Core specification [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>]
+ and the general considerations for DOM implementations apply. For example, handling of <a class="def" href="#glossary-namespaceURI">namespace URIs</a> is discussed in
+ <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations"><em>XML Namespaces</em></a>. For additional information about
+ <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance"><em>conformance</em></a>, please see the DOM Level 3 Core specification
+ [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>]. A <a class="def" href="#glossary-user-agent">user agent</a> is not required to conform
+ to the entirety of another specification in order to conform to this specification, but it <em class="rfc2119" title="MUST">MUST</em> conform to the specific parts of any other specification which are called
+ out in this specification (e.g., a conforming DOM3 Events <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> support the <code>DOMString</code> data type as defined
+ in <a href="#references-WebIDL">Web IDL</a>, but need not support every method or data type defined in <a href="#references-WebIDL">Web IDL</a> in order to conform
+ to DOM3 Events).</p>
+
+ <p>This specification defines several classes of conformance for different <a class="def" href="#glossary-user-agent">user agents</a>, specifications, and content authors:</p>
+ <dl>
+ <dt id="conf-interactive-ua">Web browsers and other dynamic or interactive <a class="def" href="#glossary-user-agent">user agents</a></dt>
+ <dd>
+ <p>A dynamic or interactive <a class="def" href="#glossary-user-agent">user agent</a>, referred to here as a <q>browser</q> (be it a Web browser, AT (Accessibility
+ Technology) application, or other similar program), conforms to DOM Level 3 Events if it supports the Core module defined in [<cite><a class="normative" href="#references-DOMCore">DOM3
+ Core</a></cite>], the <a href="#event-flow">Event dispatch and DOM event flow</a> mechanism, all the interfaces and events with their associated methods, attributes,
+ and semantics defined in this specification with the exception of those marked as <a class="def" href="#glossary-deprecated">deprecated</a> (a conforming user agent
+ <em class="rfc2119" title="MAY">MAY</em> implement the deprecated interfaces, events, or APIs for backwards compatibility, but is not required to do so in order to be conforming), and the complete
+ set of <a class="def" href="#glossary-character-value">character values</a> and <a class="def" href="#glossary-key-value">key values</a> in the <a href="#key-value-tables">
+ Key Value Tables</a> (subject to platform availability), as well as all other normative requirements defined in this specification. A conforming browser <em class="rfc2119" title="MUST">MUST</em>
+ <a class="def" href="#glossary-dispatch">dispatch</a> events appropriate to the given <a href="#widl-EventTarget">EventTarget</a> when the conditions defined
+ for that <a class="def" href="#glossary-event-type">event type</a> have been met.</p>
+
+ <p><span id="conform-arch">A browser conforms specifically to the DOM Level 3 Events Architecture if it implements the <a href="#dom-event-architecture">DOM Event
+ Architecture</a> and <a href="#event-interfaces">Basic Event Interfaces</a>, regardless of its support for any other event interfaces or <a class="def" href="#glossary-event-type">
+ event types</a> defined in this specification.</span> <span id="conform-module">A browser conforms specifically to the DOM Level 3 Events Module if it implements
+ the interfaces and its related <a class="def" href="#glossary-event-type">event types</a> specified in the <a href="#events-module">Events Module</a>, and to each
+ event interface if it implements that interface and its related <a class="def" href="#glossary-event-type">event types</a>.</span></p>
+
+ <p><span id="conform-script">A conforming browser <em class="rfc2119" title="MUST">MUST</em> support scripting, declarative interactivity, or some other means of detecting and dispatching events in the manner
+ described by this specification, and <em class="rfc2119" title="MUST">MUST</em> support the APIs specified for that <a class="def" href="#glossary-event-type">event type</a>.</span></p>
+
+ <p>In addition to meeting all other conformance criteria, a conforming browser <em class="rfc2119" title="MAY">MAY</em> implement features of this specification marked as <a class="def" href="#glossary-deprecated">
+ deprecated</a>, for backwards compatibility with existing content, but such implementation is discouraged.</p>
+
+ <p>A conforming browser <em class="rfc2119" title="MAY">MAY</em> also support features not found in this specification, but which use the <a href="#event-flow">Event dispatch and DOM event flow</a> mechanism,
+ interfaces, events, or other features defined in DOM Level 3 Events, and <em class="rfc2119" title="MAY">MAY</em> implement additional interfaces and <a class="def" href="#glossary-event-type">event types</a>
+ appropriate to that implementation. Such features can be later standardized in future specifications.</p>
+
+ <p>A browser which does not conform to all required portions of this specification <em class="rfc2119" title="MUST NOT">MUST NOT</em> claim conformance to DOM Level 3 Events. Such an implementation which
+ does conform to portions of this specification <em class="rfc2119" title="MAY">MAY</em> claim conformance to those specific portions.</p>
+
+ <p>A conforming browser <em class="rfc2119" title="MUST">MUST</em> also be a <i>conforming implementation</i> of the IDL fragments in this specification, as described in the Web IDL specification. <a href="#references-WebIDL">[WEBIDL]</a></p>
+ </dd>
+
+ <dt id="conf-author-tools">Authoring tools</dt>
+ <dd>
+ <p>A content authoring tool conforms to DOM Level 3 Events if it produces content which uses the <a class="def" href="#glossary-event-type">event types</a> and <a href="#event-flow">Event dispatch and DOM event flow</a> model, consistent in a manner as defined in this specification. A content authoring tool <em class="rfc2119" title="MUST NOT">MUST NOT</em> claim
+ conformance to DOM Level 3 Events for content it produces which uses features of this specification marked as <a class="def" href="#glossary-deprecated">deprecated</a>
+ in this specification. A conforming content authoring tool <em class="rfc2119" title="SHOULD">SHOULD</em> provide to the content author a means to use all <a class="def" href="#glossary-event-type">event
+ types</a> and interfaces appropriate to all <a class="def" href="#glossary-host-language">host languages</a> in the content document being produced.</p>
+ </dd>
+
+ <dt id="conf-authors">Content authors and content</dt>
+ <dd>
+ <p>A content author creates conforming DOM Level 3 Events content if that content uses the <a class="def" href="#glossary-event-type">event types</a> and <a href="#event-flow">
+ Event dispatch and DOM event flow</a> model, consistent in a manner as defined in this specification. A content author <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use features of this specification
+ marked as <a class="def" href="#glossary-deprecated">deprecated</a>, but <em class="rfc2119" title="SHOULD">SHOULD</em> rely instead upon replacement mechanisms defined in this specification and elsewhere.
+ Conforming content <em class="rfc2119" title="MUST">MUST</em> use the semantics of the interfaces and <a class="def" href="#glossary-event-type">event types</a> as described in this specification.</p>
+
+ <div class="note"><div class="note-title" id="h_note_1"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Content authors are advised to follow best practices as described in <a href="http://www.w3.org/TR/WAI-WEBCONTENT/">
+ accessibility</a> and <a href="http://www.w3.org/standards/techs/i18n">internationalization</a> guideline specifications.</p></div>
+ </dd>
+
+ <dt id="conf-specs">Specifications and host languages</dt>
+ <dd>
+ <p>A specification or <a class="def" href="#glossary-host-language">host language</a> conforms to DOM Level 3 Events if it references and uses the <a href="#event-flow">
+ Event dispatch and DOM event flow</a> mechanism, interfaces, events, or other features defined in this specification, and does not extend these
+ features in incompatible ways. A specification or <a class="def" href="#glossary-host-language">host language</a> conforms specifically to the DOM Level 3 Events
+ Architecture if it references and uses the <a href="#dom-event-architecture">DOM Event Architecture</a> and <a href="#event-interfaces">Basic Event Interfaces</a>,
+ regardless of its use of any other event interfaces or <a class="def" href="#glossary-event-type">event types</a> defined in this specification.</p>
+
+ <p>A specification or <a class="def" href="#glossary-host-language">host language</a> conforms specifically to the DOM Level 3 Events Module if it references and uses the interfaces and
+ its related <a class="def" href="#glossary-event-type">event types</a> specified in the <a href="#events-module">Events Module</a>, and to each event interface
+ if it references and uses that interface and its related <a class="def" href="#glossary-event-type">event types</a>. A conforming specification <em class="rfc2119" title="MAY">MAY</em>
+ define additional interfaces and <a class="def" href="#glossary-event-type">event types</a> appropriate to that specification, or <em class="rfc2119" title="MAY">MAY</em> extend the DOM Level 3 Events
+ interfaces and <a class="def" href="#glossary-event-type">event types</a> in a manner that does not contradict or conflict with the definitions of those interfaces
+ and <a class="def" href="#glossary-event-type">event types</a> in this specification.</p>
+
+ <p>Specifications or <a class="def" href="#glossary-host-language">host languages</a> which reference DOM Level 3 Events <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use or recommend features of this
+ specification marked as <a class="def" href="#glossary-deprecated">deprecated</a>, but <em class="rfc2119" title="SHOULD">SHOULD</em> use or recommend the indicated replacement for that the feature (if available).</p>
+ </dd>
+ </dl>
+ </div>
+<!-- dom-events-conformance -->
+
+
+ <div id="style-conventions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_style-conventions"><span class="secno">1.3 </span>Stylistic Conventions</h3>
+ <p>The following stylistic conventions are followed in this specification, per the <a href="http://www.w3.org/People/Schepers/spec-conventions.html">Proposed <abbr title="World Wide Web Consortium">W3C</abbr> Specification
+ Conventions</a>:</p>
+
+ <dl>
+ <dt>Keywords or values</dt>
+ <dd><code>This is a keyword or value</code></dd>
+
+ <dt>Event types</dt>
+ <dd><code>This is an event type</code></dd>
+
+ <dt>Key and character values</dt>
+ <dd>
+ This is a key name: <code class="key">'='</code> (e.g., the value of <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>).
+ This is the equivalent character value: <code class="char">'\u003d'</code>.
+ This is a glyph that represents that same character value: <code class="glyph">'='</code>.
+ </dd>
+
+ <dt>Glossary definitions</dt>
+ <dd>This is a link to a definition in the glossary</dd>
+
+ <dt>Notes</dt>
+ <dd><div class="note"><div class="note-title" id="h_note_2"><span>Note</span></div><p class=""><strong>Note:</strong> This is a note.</p></div></dd>
+
+ <dt>Warnings</dt>
+ <dd><p class="warning"><strong>Warning!</strong> This is a warning. It is used on security notes and to mark <a class="def" href="#glossary-deprecated">deprecated</a> features.</p></dd>
+
+ <dt>Examples</dt>
+ <dd>
+ <div class="example">
+ <div class="example-title"></div>
+ <p>This is an example.</p>
+ </div>
+ </dd>
+
+
+<!-- [Not current used in this document] <dt>Features at risk</dt>
+ <dd><p class="atrisk">This is a feature at risk, which is likely to be removed from the specification.</p></dd>-->
+
+
+ <dt>Spec Issues</dt>
+ <dd><div class="issue"><div class="issue-title" id="h_issue_1"><span>Issue 1</span></div><p class="">This is an open issue.</p></div></dd>
+ </dl>
+
+ <p>In addition, certain terms are used in this specification with particular meanings. The term <q>implementation</q> applies to a browser, content authoring tool,
+ or other <a class="def" href="#glossary-user-agent">user agent</a> that implements this specification, while a content author is a person who writes script or code
+ that takes advantage of the interfaces, methods, attributes, events, and other features described in this specification in order to make Web applications, and a
+ user is the person who uses those Web applications in an implementation.</p>
+ </div>
+<!-- style-conventions -->
+
+ </div>
+<!-- dom-events -->
+
+
+
+<!-- Section 2: Glossary ========================================================-->
+
+ <div id="glossary" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_glossary"><span class="secno">2. </span>Glossary</h2>
+
+ <p class="1st">Some of the following term definitions have been borrowed or modified from similar definitions in other <abbr title="World Wide Web Consortium">W3C</abbr> or standards documents. See the links within
+ the definitions for more information.</p>
+
+ <dl id="glossary-list">
+ <dt id="glossary-activation-behavior"><dfn id="dfn-activation-behavior">activation behavior</dfn></dt>
+ <dd>The action taken when an <a class="def" href="#glossary-event">event</a>, typically initiated by users through an input device, causes an element to fulfill a
+ defined task. The task <em class="rfc2119" title="MAY">MAY</em> be defined for that element by the <a class="def" href="#glossary-host-language">host language</a>, or by
+ author-defined variables, or both. The default task for any given element <em class="rfc2119" title="MAY">MAY</em> be a generic action, or <em class="rfc2119" title="MAY">MAY</em> be
+ unique to that element. For example, the activation behavior of an HTML or SVG <code><a></code> element is to cause the
+ <a class="def" href="#glossary-user-agent">user agent</a> to traverse the link specified in the <code>href</code> attribute, with the further optional parameter
+ of specifying the browsing context for the traversal (such as the current window or tab, a named window, or a new window). The activation behavior of an HTML
+ <code><input></code> element with the <code>type</code> attribute value <code>submit</code> is be to send the values of the form elements to an
+ author-defined IRI by the author-defined HTTP method. See <a href="#event-flow-activation">Activation triggers and behavior</a> for more details.</dd>
+
+ <dt id="glossary-activation-trigger"><dfn id="dfn-activation-trigger">activation trigger</dfn></dt>
+ <dd>An event which is defined to initiate an <a class="def" href="#glossary-activation-behavior">activation behavior</a>. Refer to <a href="#event-flow-activation">
+ Activation triggers and behavior</a> for more details.</dd>
+
+ <dt id="glossary-author"><dfn id="dfn-author">author</dfn></dt>
+ <dd>In the context of this specification, an <em>author</em>, <em>content author</em>, or <em>script author</em> is a person who writes script or other executable
+ content that uses the interfaces, events, and event flow defined in this specification. See <a href="#conf-authors">Content authors and content</a> conformance
+ category for more details.</dd>
+
+ <dt id="glossary-bubbling-phase"><dfn id="dfn-bubbling-phase">bubbling phase</dfn></dt>
+ <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by one of the target's ancestors <em>after</em> being handled by the
+ <a class="def" href="#glossary-event-target">event target</a>. See the description of the <a href="#bubble-phase">bubble phase</a> in the context
+ of event flow for more details.</dd>
+
+ <dt id="glossary-capture-phase"><dfn id="dfn-capture-phase">capture phase</dfn></dt>
+ <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by one of the target's ancestors <em>before</em> being handled by the
+ <a class="def" href="#glossary-event-target">event target</a>. See the description of the <a href="#capture-phase">capture phase</a> in the context
+ of event flow for more details.</dd>
+
+ <dt id="glossary-character-value"><dfn id="dfn-character-value">character value</dfn></dt>
+ <dd>In the context of key values, a character value is a string representing one or more Unicode characters, such as a letter or symbol, or a set of letters. In this
+ specification, character values are denoted as a unicode string (e.g., <code class="char">'\u0020'</code>) or a glyph representation of the same code point (e.g.,
+ <code class="glyph">' '</code>), and are color coded to help distinguish these two representations.
+ <div class="note"><div class="note-title" id="h_note_3"><span>Note</span></div><p class=""><strong>Note:</strong> In source code, some key values, such as non-graphic characters, can be represented using
+ the character escape syntax of the programming language in use.</p></div>
+ </dd>
+
+ <dt id="glossary-candidate-event-handlers"><dfn id="dfn-candidate-event-handlers">candidate event handlers</dfn></dt>
+ <dt><dfn id="dfn-candidate-event-listeners">candidate event listeners</dfn></dt>
+ <dd>The list of all <a class="def" href="#glossary-event-handler">event listeners</a> that have been registered on the target object in their order of registration. This
+ list is captured or <q>frozen</q> before event listeners on the target object are dispatched, and released or <q>un-frozen</q> after this set of candidate event
+ handlers have been dispatched (allowing these event listeners to add or remove additional listeners on other objects in an event's propagation chain, but not affect
+ the order of listeners that will be invoked on the target object).
+
+ <div class="note"><div class="note-title" id="h_note_4"><span>Note</span></div><p class=""><strong>Note:</strong> Initially capturing the candidate event handlers prevents infinite loops of event listener dispatch on a given target object.</p></div>
+ </dd>
+
+ <dt id="glossary-current-event-target"><dfn id="dfn-current-event-target">current event target</dfn></dt>
+ <dd>In an event flow, the current event target is the object associated with the <a class="def" href="#glossary-event-handler">event handler</a> that is currently being
+ dispatched. This object <em class="rfc2119" title="MAY">MAY</em> be the <a href="#glossary-event-target">event target</a> itself or one of its ancestors. The current event target changes as the
+ <a class="def" href="#glossary-event">event</a> propagates from object to object through the various <a class="def" href="#glossary-phase">phases</a> of the event flow.
+ The current event target is the value of the <a href="#widl-Event-currentTarget"><code>Event.currentTarget</code></a> attribute.</dd>
+
+ <dt id="glossary-dead-key"><dfn id="dfn-dead-key">dead key</dfn></dt>
+ <dd>A dead key is a key or combination of keys which produces no character by itself, but which in combination or sequence with another key produces a modified character,
+ such as a character with diacritical marks (e.g., <code>ö</code>, <code>é</code>, <code>â</code>).</dd>
+
+ <dt id="glossary-default-action"><dfn id="dfn-default-action">default action</dfn></dt>
+ <dd>A <a class="def" href="#glossary-default-action">default action</a> is an <em class="rfc2119" title="OPTIONAL">OPTIONAL</em> supplementary behavior that an implementation
+ <em class="rfc2119" title="MUST">MUST</em> perform in combination with the dispatch of the event object. Each event type definition, and each specification, defines the
+ <a class="def" href="#glossary-default-action">default action</a> for that event type, if it has one. An instance of an event <em class="rfc2119" title="MAY">MAY</em> have more than
+ one <a class="def" href="#glossary-default-action">default action</a> under some circumstances, such as when associated with an
+ <a class="def" href="#glossary-activation-trigger">activation trigger</a>. A <a class="def" href="#glossary-default-action"> default action</a> <em class="rfc2119" title="MAY">MAY</em>
+ be cancelled through the invocation of the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method. For more details, see
+ <a href="#event-flow-default-cancel">Default actions and cancelable events</a>.</dd>
+
+ <dt id="glossary-defaultView"><dfn id="dfn-defaultview">defaultView</dfn></dt>
+ <dd>The <code>defaultView</code> is the document's browsing context's Window Proxy object as defined in <a href="http://dev.w3.org/html5/spec/single-page.html#dom-document-defaultview" title="HTML5 defaultView IDL attribute">HTML5</a> [<cite><a class="normative" href="#references-HTML5">HTML5</a></cite>].</dd>
+
+ <dt id="glossary-delta"><dfn id="dfn-delta">delta</dfn></dt>
+ <dd>The estimated scroll amount (in pixels, lines, or pages) that the user agent will scroll or zoom the page in response to the physical movement of an input device that
+ supports the <code>WheelEvent</code> interface (such as a mouse wheel or touch pad). The value of a <a class="def" href="#glossary-delta">delta</a> (e.g., the <a href="#widl-WheelEvent-deltaX">deltaX</a>, <a href="#widl-WheelEvent-deltaY">deltaY</a>, or <a href="#widl-WheelEvent-deltaZ">deltaZ</a> attributes) is to be
+ interpreted in the context of the current <a href="#widl-WheelEvent-deltaMode"><code>deltaMode</code></a> property. The relationship between the physical movement of
+ a wheel (or other device) and whether the <a class="def" href="#glossary-delta">delta</a> is positive or negative is environment and device dependent. However, if a user
+ agent scrolls as the <a class="def" href="#glossary-default-action">default action</a> then the sign of the <a class="def" href="#glossary-delta">delta</a> is given by a
+ right-hand coordinate system where positive X,Y, and Z axes are directed towards the right-most edge, bottom-most edge, and farthest depth (away from the user) of the
+ document, respectively.</dd>
+
+ <dt id="glossary-deprecated"><dfn id="dfn-deprecated">deprecated</dfn></dt>
+ <dd>Features marked as deprecated are included in the specification as reference to older implementations or specifications, but are <em class="rfc2119" title="OPTIONAL">OPTIONAL</em>
+ and discouraged. Only features which have existing or in-progress replacements <em class="rfc2119" title="MUST">MUST</em> be deprecated in this specification. Implementations
+ which do not already include support for the feature <em class="rfc2119" title="MAY">MAY</em> implement deprecated features for reasons of backwards compatibility with existing
+ content, but content authors creating content <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use deprecated features, unless there is no other way to solve a use case.
+ Other specifications which reference this specification <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use deprecated features, but <em class="rfc2119" title="SHOULD">SHOULD</em>
+ point instead to the replacements of which the feature is deprecated in favor. Features marked as deprecated in this specification are expected to be dropped from
+ future specifications.</dd>
+
+ <dt id="glossary-dispatch"><dfn id="dfn-dispatch">dispatch</dfn></dt>
+ <dd>To create an event with attributes and methods appropriate to its type and context, and propagate it through the DOM tree in the specified manner. Interchangeable
+ with the term <q><a href="#glossary-fire">fire</a></q>, e.g., <q>fire a <a class="eventtype" href="#event-type-click"><code>click</code></a> event</q> or <q>dispatch
+ a <a class="eventtype" href="#event-type-load"><code>load</code></a> event</q>.</dd>
+
+ <dt id="glossary-document"><dfn id="dfn-document">document</dfn></dt>
+ <dd>An object instantiating the <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#i-Document" title="Document Object Model Core"><code>Document</code> interface</a>
+ [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>], representing the entire HTML or XML text document. Conceptually, it is the root of
+ the document tree, and provides the primary access to the document's data.</dd>
+
+ <dt id="glossary-DOM-application"><dfn id="dfn-dom-application">DOM application</dfn></dt>
+ <dd>A DOM application is script or code, written by a content author or automatically generated, which takes advantage of the interfaces, methods, attributes, events,
+ and other features described in this specification in order to make dynamic or interactive content, such as Web applications, exposed to users in a <a class="def" href="#glossary-user-agent">user agent</a>.</dd>
+
+ <dt id="glossary-DOM-Level-0"><dfn id="dfn-dom-level-0">DOM Level 0</dfn></dt>
+ <dd>The term <q>DOM Level 0</q> refers to a mix of HTML document functionalities, often not formally specified but traditionally supported as de facto standards, implemented
+ originally by Netscape Navigator version 3.0 or Microsoft Internet Explorer version 3.0. In many cases, attributes or methods have been included for reasons of
+ backward compatibility with <q>DOM Level 0</q>.</dd>
+
+ <dt id="glossary-empty-string"><dfn id="dfn-empty-string">empty string</dfn></dt>
+ <dd>The empty string is a value of type <code>DOMString</code> of length <code>0</code>, i.e., a string which contains no characters (neither printing nor control
+ characters).</dd>
+
+ <dt id="glossary-event"><dfn id="dfn-event">event</dfn></dt>
+ <dd>An event is the representation of some occurrence (such as a mouse click on the presentation of an element, the removal of child node from an element, or any number
+ of other possibilities) which is associated with its <a class="def" href="#glossary-event-target">event target</a>. Each event is an instantiation
+ of one specific <a class="def" href="#glossary-event-type">event type</a>.</dd>
+
+ <dt id="glossary-event-handler"><dfn id="dfn-event-handler">event handler</dfn></dt>
+ <dt><dfn id="dfn-event-listener">event listener</dfn></dt>
+ <dd>An object that implements the <a href="#interface-EventListener"><code>EventListener</code></a> interface and provides an <a href="#widl-EventListener-handleEvent">
+ <code>EventListener.handleEvent()</code></a> callback method. Event handlers are language-specific. Event handlers are invoked in the context of a particular object
+ (the <a class="def" href="#glossary-current-event-target">current event target</a>) and are provided with the event object itself.
+
+ <div class="note"><div class="note-title" id="h_note_5"><span>Note</span></div><p class=""><strong>Note: </strong>In JavaScript, user-defined functions are considered to implement the <code>EventListener</code> interface. Thus the
+ <code>Event</code> object will be provided as the first parameter to the user-defined function when it is invoked. Additionally, JavaScript objects can also implement
+ the <code>EventListener</code> interface when they define a <q><code>handleEvent</code></q> method.</p></div>
+ </dd>
+
+ <dt id="glossary-event-order"><dfn id="dfn-event-order">event order</dfn></dt>
+ <dd>The sequence in which events from the same event source or process occur, using the same or related event interfaces. For example, in an environment with a mouse,
+ a track pad, and a keyboard, each of those input devices would constitute a separate event source, and each would follow its own event order. A <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> event from the trackpad followed by a <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>
+ event from the mouse would not result in a <a class="eventtype" href="#event-type-click"><code>click</code></a> event.
+
+ <div class="note"><div class="note-title" id="h_note_6"><span>Note</span></div><p class=""><strong>Note:</strong> There can be interactions between different event orders. For example, a <a class="eventtype" href="#event-type-click"><code>click</code></a> event might
+ be modified by a concurrent <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event (<code class="key">'Shift'</code><code>+click</code>). However, the event orders
+ of these different event sources would be distinct.</p></div>
+
+ The event order of some interfaces are device-independent. For example, a user might change focus using the <a href="#key-Tab"><code class="key">'Tab'</code></a>
+ key, or by clicking the new focused element with the mouse. The event order in such cases depends on the state of the process, not on the state of the device that
+ initiates the state change.</dd>
+
+ <dt id="glossary-event-phase"><dfn id="dfn-event-phase">event phase</dfn></dt>
+ <dd>See <a class="def" href="#glossary-phase">phase</a>.</dd>
+
+ <dt id="glossary-event-target"><dfn id="dfn-event-target">event target</dfn></dt>
+ <dd>The object to which an <a class="def" href="#glossary-event">event</a> is targeted using the <a href="#event-flow">DOM event flow</a>. The event target is the
+ value of the <a href="#widl-Event-target"><code>Event.target</code></a> attribute.</dd>
+
+ <dt id="glossary-event-type"><dfn id="dfn-event-type">event type</dfn></dt>
+ <dd>An <em>event type</em> is an <a class="def" href="#glossary-event">event</a> object with a particular name and which defines particular trigger conditions, properties,
+ and other characteristics which distinguish it from other event types. For example, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event
+ type has different characteristics than the <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a> or <a class="eventtype" href="#event-type-load">
+ <code>load</code></a> event types. The event type is exposed as the <a href="#widl-Event-type"><code class="interface-attribute">Event.type</code></a>
+ attribute on the event object. See <a href="#event-types">event types</a> for more details. Also loosely referred to as <em>'event'</em>, such as the <em><a class="eventtype" href="#event-type-click"><code>click</code></a> event</em>.</dd>
+
+ <dt id="glossary-event-focus"><dfn id="dfn-focus">focus</dfn></dt>
+ <dd>Focus is a special state of receptivity and concentration on an particular element or other <a class="def" href="#glossary-event-target">event target</a> within
+ a document. Each element has different behavior when focused, depending on its functionality, such as priming the element for activation (as for a button or hyperlink)
+ or toggling state (as for a checkbox), receiving text input (as for a text form field), or copying selected text. For more details, see <a href="#events-focusevent-doc-focus">
+ Document Focus and Focus Context</a>.</dd>
+
+ <dt id="glossary-event-focus-ring"><dfn id="dfn-focus-ring">focus ring</dfn></dt>
+ <dd>A focus ring is an ordered set of <a class="def" href="#glossary-event-focus">focus</a> targets within a document. A <a class="def" href="#glossary-host-language">
+ host language</a> <em class="rfc2119" title="MAY">MAY</em> define one or more ways to determine the order of targets, such as document order, a numerical index defined per focus target, explicit pointers
+ between focus targets, or a hybrid of different models. Each document <em class="rfc2119" title="MAY">MAY</em> contain multiple focus rings, or conditional focus rings. Typically, for document-order
+ or indexed focus rings, focus <q>wraps around</q> from the last focus target to the first.</dd>
+
+ <dt id="glossary-fire"><dfn id="dfn-fire">fire</dfn></dt>
+ <dd>A synonym for <a href="#glossary-dispatch">dispatch</a>.</dd>
+
+ <dt id="glossary-host-language"><dfn id="dfn-host-language">host language</dfn></dt>
+ <dd>Any language which integrates the features of another language or API specification, while normatively referencing the origin specification rather than redefining
+ those features, and extending those features only in ways defined by the origin specification. An origin specification typically is only intended to be implemented
+ in the context of one or more host languages, not as a standalone language. For example, XHTML, HTML, and SVG are host languages for DOM 3 Events, and they integrate
+ and extend the objects and models defined in this specification.</dd>
+
+ <dt id="glossary-hysteresis"><dfn id="dfn-hysteresis">hysteresis</dfn></dt>
+ <dd>A feature of human interface design to accept input values within a certain range of location or time, in order to improve the user experience. For example, allowing
+ for small deviation in the time it takes for a user to double-click a mouse button is temporal hysteresis, and not immediately closing a nested menu if the user
+ mouses out from the parent window when transitioning to the child menu is locative hysteresis.</dd>
+
+ <dt id="glossary-ime"><dfn id="dfn-ime">IME</dfn></dt>
+ <dt id="glossary-input-method-editor"><dfn id="dfn-input-method-editor">input method editor</dfn></dt>
+ <dd>An <em>input method editor</em> (IME), also known as a <em>front end processor</em>, is an application that performs the conversion between keystrokes and ideographs
+ or other characters, usually by user-guided dictionary lookup, often used in East Asian languages (e.g., Chinese, Japanese, Korean). An <a class="def" href="#glossary-ime">
+ IME</a> <em class="rfc2119" title="MAY">MAY</em> also be used for dictionary-based word completion, such as on mobile devices. See <a href="#keys-IME">Input Method Editors</a> for treatment of
+ IMEs in this specification. See also <a class="def" href="#glossary-text-composition-system">text composition system</a>.</dd>
+
+ <dt id="glossary-key-value"><dfn id="dfn-key-value">key value</dfn></dt>
+ <dd>A key value is a <a class="def" href="#glossary-character-value">character value</a> or multi-character string (such as <a href="#key-Enter"><code class="key">'Enter'
+ </code></a>, <a href="#key-Tab"><code class="key">'Tab'</code></a>, or <a href="#key-MediaNextTrack"><code class="key">'MediaNextTrack'</code></a>) associated
+ with a key in a particular state. Every key has a key value, whether or not it has a <a class="def" href="#glossary-character-value">character value</a>. This includes
+ control keys, function keys, <a class="def" href="#glossary-modifier-key">modifier keys</a>, <a class="def" href="#glossary-dead-key">dead keys</a>, and any other key.
+ The key value of any given key at any given time depends upon the <a class="def" href="#glossary-key-mapping">key mapping</a>.</dd>
+
+ <dt id="glossary-key-mapping"><dfn id="dfn-key-mapping">key mapping</dfn></dt>
+ <dd>Key mapping is the process of assigning a key value to a particular key, and is the result of a combination of several factors, including the operating system
+ and the keyboard layout (e.g., <a class="def" href="#glossary-qwerty">QWERTY</a>, Dvorak, Spanish, InScript, Chinese, etc.), and after taking into account all <a class="def" href="#glossary-modifier-key">modifier key</a> (<a href="#key-Shift"><code class="key">'Shift'</code></a>, <a href="#key-Alt"><code class="key">
+ 'Alt'</code></a>, etc.) and <a class="def" href="#glossary-dead-key">dead key</a> states.</dd>
+
+ <dt id="glossary-localname"><dfn id="dfn-local-name">local name</dfn></dt>
+ <dd>See local name in [<cite><a class="informative" href="#references-Namespaces10">XML Namespaces 1.0</a></cite>].</dd>
+
+ <dt id="glossary-modifier-key"><dfn id="dfn-modifier-key">modifier key</dfn></dt>
+ <dd>A modifier key changes the normal behavior of a key, such as to produce a character of a different case (as with the <a href="#key-Shift"><code class="key">
+ 'Shift'</code></a> key), or to alter what functionality the key triggers (as with the <a href="#key-Fn"><code class="key">'Fn'</code></a> or <a href="#key-Alt">
+ <code class="key">'Alt'</code></a> keys). Refer to the <a href="#widl-KeyboardEvent-getModifierState"><code>KeyboardEvent.getModifierState()</code></a>
+ method for a list of modifier keys defined in this specification. See also <a href="#keys-Modifiers">Modifier keys</a>.</dd>
+
+ <dt id="glossary-namespaceURI"><dfn id="dfn-namespace-uri">namespace URI</dfn></dt>
+ <dd>A <em>namespace URI</em> is a URI that identifies an XML namespace. This is called the namespace name in [<cite><a class="informative" href="#references-Namespaces10">XML
+ Namespaces 1.0</a></cite>]. See also sections 1.3.2 <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#baseURIs-Considerations"><em>DOM URIs</em></a>
+ and 1.3.3 <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations"><em>XML Namespaces</em></a> regarding URIs and namespace
+ URIs handling and comparison in the DOM APIs.</dd>
+
+ <dt id="glossary-phase"><dfn id="dfn-phase">phase</dfn></dt>
+ <dd>In the context of <a class="def" href="#glossary-event">events</a>, a phase is set of logical traversals from node to node along the DOM tree, from the <a class="def" href="#glossary-defaultView">defaultView</a> (window), to the <code>Document</code> object, <a class="def" href="#glossary-root-element">root element</a>, and down
+ to the <a class="def" href="#glossary-event-target">event target</a> (<a class="def" href="#glossary-capture-phase">capture phase</a>), at the <a class="def" href="#glossary-event-target">
+ event target</a> itself (<a class="def" href="#glossary-target-phase">target phase</a>), and back up the same chain (<a class="def" href="#glossary-bubbling-phase">bubbling
+ phase</a>).</dd>
+
+ <dt id="glossary-propagation-path"><dfn id="dfn-propagation-path">propagation path</dfn></dt>
+ <dd>The ordered set of <a class="def" href="#glossary-current-event-target">current event targets</a> though which an <a class="def" href="#glossary-event">event</a> object will pass
+ sequentially on the way to and back from the <a class="def" href="#glossary-event-target">event target</a>. As the event propagates, each <a class="def" href="#glossary-current-event-target">current event target</a> in the propagation path is in turn set as the <a href="#widl-Event-currentTarget"><code>Event.currentTarget</code></a>.
+ The propagation path is initially composed of one or more <a class="def" href="#glossary-event-phase">event phases</a> as defined by the <a class="def" href="#glossary-event-type">
+ event type</a>, but <em class="rfc2119" title="MAY">MAY</em> be interrupted. Also known as an <em>event target chain</em>.</dd>
+
+ <dt id="glossary-qwerty"><dfn id="dfn-qwerty">QWERTY</dfn></dt>
+ <dd>QWERTY (pronounced <q>ˈkwɜrti</q>) is a common keyboard layout, so named because the first five character keys on the top row of letter keys are Q,
+ W, E, R, T, and Y. There are many other popular keyboard layouts (including the Dvorak and Colemak layouts), most designed for localization or ergonomics.</dd>
+
+ <dt id="glossary-root-element"><dfn id="dfn-root-element">root element</dfn></dt>
+ <dd>The first element node of a document, of which all other elements are children. The document element.</dd>
+
+ <dt id="glossary-rotation"><dfn id="dfn-rotation">rotation</dfn></dt>
+ <dd>An indication of incremental change on an input device using the <a href="#interface-WheelEvent">WheelEvent</a> interface. On some devices this <em class="rfc2119" title="MAY">MAY</em> be a literal
+ rotation of a wheel, while on others, it <em class="rfc2119" title="MAY">MAY</em> be movement along a flat surface, or pressure on a particular button.</dd>
+
+ <dt id="glossary-text-composition-system"><dfn id="dfn-text-composition-system">text composition system</dfn></dt>
+ <dd>A software component that interprets some form of alternate input (such as a <a class="def" href="#glossary-ime">input method editor</a>, a speech processor, or
+ a handwriting recognition system) and converts it to text.</dd>
+
+ <dt id="glossary-target-phase"><dfn id="dfn-target-phase">target phase</dfn></dt>
+ <dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by the <a class="def" href="#glossary-event-target">event target</a>.
+ See the description of the <a href="#target-phase">target phase</a> in the context of event flow for more details.</dd>
+
+ <dt id="glossary-topmost-event-target"><dfn id="dfn-topmost-event-target">topmost event target</dfn></dt>
+ <dd>The <a class="def" href="#glossary-topmost-event-target">topmost event target</a> <em class="rfc2119" title="MUST">MUST</em> be the element highest in the rendering order which is capable of being
+ an <a class="def" href="#glossary-event-target">event target</a>. In graphical user interfaces this is the element under the user's pointing device. A user
+ interface's <q>hit testing</q> facility is used to determine the target. For specific details regarding hit testing and stacking order, refer to the
+ <a class="def" href="#glossary-host-language">host language</a>.</dd>
+
+ <dt id="glossary-tree"><dfn id="dfn-tree">tree</dfn></dt>
+ <dd>A data structure that represents a document as a hierarchical set of nodes with child-parent-sibling relationships, i.e., each node having one or more possible
+ ancestors (nodes higher in the hierarchy in a direct lineage), one or more possible descendants (nodes lower in the hierarchy in a direct lineage), and one or more
+ possible peers (nodes of the same level in the hierarchy, with the same immediate ancestor).</dd>
+
+ <dt id="glossary-Unicode-character-categories"><dfn id="dfn-unicode-character-categories">Unicode character categories</dfn></dt>
+ <dd>A subset of the General Category values that are defined for each Unicode code point. This subset contains all the
+ Letter (<abbr title="Letter, Lowercase">Ll</abbr>,
+ <abbr title="Letter, Modifier">Lm</abbr>,
+ <abbr title="Letter, Other">Lo</abbr>,
+ <abbr title="Letter, Titlecase">Lt</abbr>,
+ <abbr title="Letter, Uppercase">Lu</abbr>),
+ Number (<abbr title="Number, Decimal Digit">Nd</abbr>,
+ <abbr title="Number, Letter">Nl</abbr>,
+ <abbr title="Number, Other">No</abbr>),
+ Punctuation (<abbr title="Punctuation, Connector">Pc</abbr>,
+ <abbr title="Punctuation, Dash">Pd</abbr>,
+ <abbr title="Punctuation, Close">Pe</abbr>,
+ <abbr title="Punctuation, Final quote">Pf</abbr>,
+ <abbr title="Punctuation, Initial quote">Pi</abbr>,
+ <abbr title="Punctuation, Other">Po</abbr>,
+ <abbr title="Punctuation, Open">Ps</abbr>)
+ and Symbol (<abbr title="Symbol, Currency">Sc</abbr>,
+ <abbr title="Symbol, Modifier">Sk</abbr>,
+ <abbr title="Symbol, Math">Sm</abbr>,
+ <abbr title="Symbol, Other">So</abbr>)
+ category values.</dd>
+
+ <dt id="glossary-unicode-code-point"><dfn id="dfn-unicode-code-point">Unicode code point</dfn></dt>
+ <dd>A Unicode code point is a unique hexadecimal number signifying a character by its index in the Unicode codespace (or library of characters). In the context of
+ key values, a Unicode code point is expressed as a string in the format <code>\u</code> followed by a hexadecimal character index in the range <code>0000</code>
+ to <code>10FFFF</code>, using at least four digits. See also <a class="def" href="#glossary-character-value">character value</a>.</dd>
+
+ <dt id="glossary-un-initialized-value"><dfn id="dfn-un-initialized-value">un-initialized value</dfn></dt>
+ <dd>The value of any event attribute (such as <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a> or <a href="#widl-Event-currentTarget"><code>
+ Event.currentTarget</code></a>) before the event has been initialized with <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>. The un-initialized
+ values of an <code>Event</code> apply immediately after a new event has been created using the method <a href="#widl-DocumentEvent-createEvent"><code>
+ DocumentEvent.createEvent()</code></a>.</dd>
+
+ <dt id="glossary-user-agent"><dfn id="dfn-user-agent">user agent</dfn></dt>
+ <dd>A program, such as a browser or content authoring tool, normally running on a client machine, which acts on a user's behalf in retrieving, interpreting, executing,
+ presenting, or creating content. Users <em class="rfc2119" title="MAY">MAY</em> act on the content using different user agents at different times, for different purposes. See the <a href="#conf-interactive-ua">
+ Web browsers and other dynamic or interactive user agents</a> and <a href="#conf-author-tools">Authoring tools</a> for details on the requirements for a <em>conforming</em>
+ user agent.</dd>
+ </dl>
+ </div>
+
+
+<!-- Section 3: Architecture ========================================================-->
+
+ <div id="dom-event-architecture" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_dom-event-architecture"><span class="secno">3. </span>DOM Event Architecture</h2>
+
+ <div id="event-flow" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-flow"><span class="secno">3.1 </span>Event dispatch and DOM event flow</h3>
+
+ <p>This section defines the event <a class="def" href="#glossary-dispatch">dispatch</a> mechanism of the event model defined in this specification.
+ Applications <em class="rfc2119" title="MAY">MAY</em> dispatch event objects using the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method, and
+ implementations <em class="rfc2119" title="MUST">MUST</em> dispatch event objects as if through this method. The behavior of this method depends on the <em>event flow</em>
+ associated with the underlying object. An event flow describes how event objects <em>propagate</em> through a data structure. As an example, when an event object
+ is dispatched to an element in an XML document, the object propagates through parts of the document, as determined by the DOM event flow which is defined at the
+ end of this section.</p>
+
+ <div class="figure" style="text-align: center" id="fig-graphical-representation-of-an-event-dispatched-in-a-dom-tree-using-the-dom-event-flow">
+ <object type="image/svg+xml" data="images/eventflow.svg" width="520" height="560">
+ <img src="images/eventflow.png" alt="Graphical representation of an event dispatched in a DOM tree using the DOM event flow" title="Graphical representation of an event dispatched in a DOM tree using the DOM event flow" />
+ </object>
+ <div class="figcaption">Fig. <span class="figno">1</span> <span class="fig-title">Graphical representation of an event dispatched in a DOM tree using the DOM event flow</span></div></div>
+
+ <p>Event objects are dispatched to an <a class="def" href="#glossary-event-target">event target</a>. At the beginning
+ of the dispatch, implementations <em class="rfc2119" title="MUST">MUST</em> first determine the event object's <a class="def" href="#glossary-propagation-path">propagation path</a>.</p>
+
+ <p>The propagation path <em class="rfc2119" title="MUST">MUST</em> be an ordered list of <a class="def" href="#glossary-current-event-target">current event targets</a> through which
+ the event object <em class="rfc2119" title="MUST">MUST</em> pass. For DOM implementations, the propagation path <em class="rfc2119" title="MUST">MUST</em> reflect the hierarchical tree
+ structure of the document. The last item in the list <em class="rfc2119" title="MUST">MUST</em> be the <a class="def" href="#glossary-event-target">event target</a>. The
+ preceding items in the list are referred to as the <em>target's ancestors</em>, and the immediately preceding item as the <em>target's parent</em>. Once determined, the
+ propagation path <em class="rfc2119" title="MUST NOT">MUST NOT</em> be changed. For DOM implementations, this applies even if an element in the propagation path is moved within the
+ DOM or removed from the DOM.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>In the DOM event flow, event listeners might change the position of the <a class="def" href="#glossary-event-target">
+ event target</a> in the document while the event object is being dispatched. Such changes do not affect the propagation path.</p>
+ </div>
+
+ <p>Exceptions thrown inside event listeners <em class="rfc2119" title="MUST NOT">MUST NOT</em> stop the propagation of the event or affect the
+ <a class="def" href="#glossary-propagation-path">propagation path</a>. The exception itself <em class="rfc2119" title="MUST NOT">MUST NOT</em> propagate outside the scope of the event
+ handler.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>In the following code, the exception thrown from the call to <code>throw "Error"</code> does not propagate into the parent scope
+ (which would prevent the <code>console.log</code> statement from executing):</p>
+ <pre>var e = document.createEvent("Event");
+e.initEvent("myevent", false, false);
+var target = document.createElement("div");
+target.addEventListener("myevent", function () {
+ throw "Error";
+});
+target.dispatchEvent(e); <span class="comment">// Causes the event listener to throw an exception...</span>
+<span class="comment">// The previously thrown exception doesn't affect the code that follows:</span>
+console.log("Exceptions? No problem");</pre>
+ </div>
+
+ <p id="event-phase">As the next step, the event object <em class="rfc2119" title="MUST">MUST</em> complete one or more <a class="def" href="#glossary-phase">event phases</a>. This specification defines
+ three event phases: <a href="#capture-phase">capture phase</a>, <a href="#target-phase">target phase</a> and <a href="#bubble-phase">bubble phase</a>. Event objects
+ complete these phases in the specified order using the partial propagation paths as defined below. A phase <em class="rfc2119" title="MUST">MUST</em> be skipped if it is not
+ supported, or if the event object's propagation has been stopped. For example, if the <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a>
+ attribute is set to false, the bubble phase will be skipped, and if <a href="#widl-Event-stopPropagation"><code>Event.stopPropagation()</code></a> has been
+ called prior to the dispatch, all phases <em class="rfc2119" title="MUST">MUST</em> be skipped.</p>
+
+ <ol>
+ <li>The <strong id="capture-phase">capture phase</strong>: The event object <em class="rfc2119" title="MUST">MUST</em> propagate through the target's ancestors from the <a class="def" href="#glossary-defaultView">defaultView</a> to the target's parent. This phase is also known as the <em>capturing phase</em>. Event
+ listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em> handle the event before it reaches its target.</li>
+
+ <li>The <strong id="target-phase">target phase</strong>: The event object <em class="rfc2119" title="MUST">MUST</em> arrive at the event object's <a class="def" href="#glossary-event-target">
+ event target</a>. This phase is also known as the <em>at-target phase</em>. Event listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em>
+ handle the event once it has reached its target. If the <a class="def" href="#glossary-event-type">event type</a> indicates that
+ the event <em class="rfc2119" title="MUST NOT">MUST NOT</em> bubble, the event object <em class="rfc2119" title="MUST">MUST</em> halt after completion of this phase.</li>
+
+ <li>The <strong id="bubble-phase">bubble phase</strong>: The event object propagates through the target's ancestors in reverse order, starting
+ with the target's parent and ending with the <a class="def" href="#glossary-defaultView">defaultView</a>. This phase is also known as the <em>bubbling phase</em>.
+ Event listeners registered for this phase <em class="rfc2119" title="MUST">MUST</em> handle the event after it has reached its target.</li>
+ </ol>
+
+ <p>Implementations <em class="rfc2119" title="MUST">MUST</em> let event objects accomplish an event phase by applying the following steps while there are pending event targets in
+ the partial propagation path for this phase and the event object's propagation has not been stopped through <a href="#widl-Event-stopPropagation"><code>
+ Event.stopPropagation()</code></a>.</p>
+
+ <p>First, the implementation <em class="rfc2119" title="MUST">MUST</em> determine the <em>current target</em>. This <em class="rfc2119" title="MUST">MUST</em> be the next pending event target in the partial propagation
+ path, starting with the first. From the perspective of an event listener this <em class="rfc2119" title="MUST">MUST</em> be the event target the listener has been registered on.</p>
+
+ <p>Next, the implementation <em class="rfc2119" title="MUST">MUST</em> determine the current target's <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>.
+ This <em class="rfc2119" title="MUST">MUST</em> be the list of all event listeners that have been registered on the current target in their order of registration. [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines the ordering of listeners registered through event handler attributes. Once determined, the candidate event listeners
+ <em class="rfc2119" title="MUST NOT">MUST NOT</em> be changed. Adding or removing listeners does not affect the current target's candidate event listeners.</p>
+
+ <p>Finally, the implementation <em class="rfc2119" title="MUST">MUST</em> process all candidate <a class="def" href="#glossary-event-handler">event handlers</a> in order and trigger
+ each handler if all the following conditions are met:</p>
+
+ <ul>
+ <li>The event object's immediate propagation has not been stopped.</li>
+
+ <li>The listener has been registered for this event phase.</li>
+
+ <li>The listener has been registered for this <a class="def" href="#glossary-event-type">event type</a>.</li>
+ </ul>
+
+ <p>In the production of the <a class="def" href="#glossary-propagation-path">propagation path</a>, if the <a class="def" href="#glossary-defaultView">defaultView</a>
+ implements the <a href="#widl-EventTarget"><code>EventTarget</code></a> interface, the event propagates from <a class="def" href="#glossary-defaultView">defaultView</a>
+ to the <code>document</code> object during the <a class="def" href="#glossary-capture-phase">capture phase</a>, and from the <code>document</code> object to the
+ <a class="def" href="#glossary-defaultView">defaultView</a> during the <a class="def" href="#glossary-bubbling-phase">bubble phase</a>.</p>
+
+ <p>After an event completes all the phases of its <a class="def" href="#glossary-propagation-path">propagation path</a>, its <a href="#widl-Event-currentTarget">
+ <code>Event.currentTarget</code></a> <em class="rfc2119" title="MUST">MUST</em> be set to <code>null</code> and the <a href="#widl-Event-eventPhase"><code>Event.eventPhase</code></a> <em class="rfc2119" title="MUST">MUST</em> be
+ set to <code>0</code> (<a href="#widl-Event-NONE"><code>NONE</code></a>). All other attributes of the <code>Event</code> (or interface derived from <code>Event</code>)
+ are unchanged (including the <a href="#widl-Event-target"><code>Event.target</code></a> attribute, which <em class="rfc2119" title="MUST">MUST</em> continue to reference the <a class="def" href="#glossary-event-target">
+ event target</a>).</p>
+
+ <p>The model defined above <em class="rfc2119" title="MUST">MUST</em> be applied regardless of the specific event flow associated with an event target. Each event flow <em class="rfc2119" title="MUST">MUST</em> define how the propagation path
+ <em class="rfc2119" title="MUST">MUST</em> be determined and which event phases are supported. The <em>DOM event flow</em> is an application of this model: the propagation path for a <code>Node</code>
+ object <em class="rfc2119" title="MUST">MUST</em> be determined by its <code>Node.parentNode</code> chain, and if applicable, the document's containing <a class="def" href="#glossary-defaultView">defaultView</a>.
+ All events accomplish the capture and target phases. Whether an event accomplishes the bubble phase <em class="rfc2119" title="MUST">MUST</em> be defined individually for each <a class="def" href="#glossary-event-type">
+ event type</a>. An alternate application of this model can be found in [<cite><a class="informative" href="#references-DOMLS">DOM3 Load and Save</a></cite>].</p>
+
+ <p>Implementations of the DOM event model <em class="rfc2119" title="MUST">MUST</em> be reentrant. Event listeners <em class="rfc2119" title="MAY">MAY</em> perform actions that cause additional events to be dispatched. Such events are handled
+ in a synchronous manner, the event propagation that causes the event listener to be triggered <em class="rfc2119" title="MUST">MUST</em> resume only after the event dispatch of the new event is completed.</p>
+ </div>
+
+ <div id="event-flow-default-cancel" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-flow-default-cancel"><span class="secno">3.2 </span>Default actions and cancelable events</h3>
+
+ <p>Events are typically dispatched by the implementation as a result of a user action, in response to the completion of a task, or to signal progress during asynchronous
+ activity (such as a network request). Some events can be used to control the behavior that the implementation <em class="rfc2119" title="MAY">MAY</em> take next (or undo an action that the implementation
+ already took). Events in this category are said to be <em>cancelable</em> and the behavior they cancel is called their <a class="def" href="#glossary-default-action">
+ <em>default action</em></a>. Cancelable event objects can be associated with one or more <a class="def" href="#glossary-default-action">default actions</a>.
+ To cancel an event, call the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> event is dispatched immediately after the user presses down a button on a
+ pointing device (typically a mouse). One possible <a class="def" href="#glossary-default-action">default action</a> taken by the implementation is to set up a state
+ machine that allows the user to drag images or select text. The <a class="def" href="#glossary-default-action">default action</a> depends on what happens next — for
+ example, if the user's pointing device is over text, a text selection might begin. If the user's pointing device is over an image, then an image-drag action could
+ begin. Preventing the <a class="def" href="#glossary-default-action">default action</a> of a <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>
+ event prevents these actions from occuring.</p>
+ </div>
+
+ <p><a class="def" href="#glossary-default-action">Default actions</a> <em class="rfc2119" title="SHOULD">SHOULD</em> be performed after the event dispatch has been completed, but in exceptional
+ cases <em class="rfc2119" title="MAY">MAY</em> also be performed immediately before the event is dispatched.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The default action associated with the <a class="eventtype" href="#event-type-click"><code>click</code></a> event on <code><input
+ type="checkbox"></code> elements toggles the <code>checked</code> IDL attribute value of that element. If the <a class="eventtype" href="#event-type-click"><code>click</code>
+ </a> event's default action is cancelled, then the value is restored to its former state.</p>
+ </div>
+
+ <p id="events-dt-cancelable-event">When an event is canceled, then the conditional <a class="def" href="#glossary-default-action">default actions</a> associated with the event <em class="rfc2119" title="MUST">MUST</em> be skipped (or
+ as mentioned above, if the <a class="def" href="#glossary-default-action">default actions</a> are carried out before the dispatch, their effect <em class="rfc2119" title="MUST">MUST</em> be undone).
+ Whether an event object is cancelable <em class="rfc2119" title="MUST">MUST</em> be indicated by the <a href="#widl-Event-cancelable"><code>Event.cancelable</code></a> attribute. <a href="#widl-Event-preventDefault">
+ <code>Event.preventDefault()</code></a> stops all related <a class="def" href="#glossary-default-action">default actions</a> of an event object. The <a href="#widl-Event-defaultPrevented">
+ <code>Event.defaultPrevented</code></a> attribute indicates whether an event has already been canceled (e.g., by a prior event listener). If the <a class="def" href="#glossary-DOM-application">
+ DOM application</a> itself initiated the dispatch, then the return value of the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a>
+ method indicates whether the event object was cancelled.</p>
+
+ <div class="note"><div class="note-title" id="h_note_7"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Many implementations additionally interpret an event listener's return value, such as the value <code>false</code>, to mean
+ that the <a class="def" href="#glossary-default-action">default action</a> of cancelable events will be cancelled (though <code>window.onerror</code> handlers are cancelled
+ by returning <code>true</code>).</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_8"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Some cancelable events might not have any observable <a class="def" href="#glossary-default-action">default actions</a>. For
+ example, the <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a> event.</p></div>
+
+ <p>This specification does not offer features to programatically query if an event object has any <a class="def" href="#glossary-default-action">default action</a> associated with
+ it, or to associate new <a class="def" href="#glossary-default-action">default actions</a> with an event object. Other specifications <em class="rfc2119" title="SHOULD">SHOULD</em> define what default actions, if any,
+ are associated with certain event objects. Further, implementations <em class="rfc2119" title="MAY">MAY</em> associate <a class="def" href="#glossary-default-action">default actions</a> with events as necessary and
+ appropriate for that implementation.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>As an example, one implementation might scroll a document view by a certain amount as the <a class="def" href="#glossary-default-action">
+ default action</a> of a <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event, while another implementation might instead zoom the document as its <a class="def" href="#glossary-default-action">default action</a>.</p>
+ </div>
+ </div>
+
+ <div id="sync-async" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_sync-async"><span class="secno">3.3 </span>Synchronous and asynchronous events</h3>
+
+ <p>Events <em class="rfc2119" title="MAY">MAY</em> be dispatched either synchronously or asynchronously.</p>
+
+ <p>Events which are synchronous (<em><q>sync events</q></em>) <em class="rfc2119" title="MUST">MUST</em> be treated as if they are in a virtual queue in a first-in-first-out model, ordered by sequence
+ of temporal occurrence with respect to other events, to changes in the DOM, and to user interaction. Each event in this virtual queue <em class="rfc2119" title="MUST">MUST</em> be delayed until the
+ previous event has completed its propagation behavior, or been canceled. Some sync events are driven by a specific device or process, such as mouse button events.
+ These events are governed by the <a class="def" href="#glossary-event-order">event order</a> algorithms defined for that set of events, and a user agent <em class="rfc2119" title="MUST">MUST</em> dispatch
+ these events in the defined order.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A user double-clicks a passage of text to select a word, then presses the <code class="key">'Del'</code>
+ key to erase the word, triggering the following synchronous sequence of events:
+ <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
+ <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
+ <a class="eventtype" href="#event-type-click"><code>click</code></a>,
+ <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
+ <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
+ <a class="eventtype" href="#event-type-click"><code>click</code></a>,
+ <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>,
+ <a class="eventtype" href="#event-type-select"><code>select</code></a>,
+ <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
+ <a class="eventtype" href="#event-type-input"><code>input</code></a>,
+ <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>.
+ Each of these events are fired in the sequence initiated by the user's actions.</p>
+ </div>
+
+ <p>Events which are asynchronous (<em><q>async events</q></em>) <em class="rfc2119" title="MAY">MAY</em> be dispatched as the results of the action are completed, with no relation to other events, to
+ other changes in the DOM, nor to user interaction.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>During loading of a document, an inline script element is parsed and executed. The <a class="eventtype" href="#event-type-load">
+ <code>load</code></a> event is queued to be fired asynchronously at the script element. However, because it is an async event, its order with relation to other synchronous
+ events fired during document load (such as the <code>DOMContentLoaded</code> event from <cite><a class="informative" href="#references-HTML5">HTML5</a></cite>) is not guaranteed.</p>
+ </div>
+
+ <div id="event-order-and-loops" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_event-order-and-loops"><span class="secno">3.3.1 </span>Event order and event loops</h4>
+
+ <p>Most events take place in a sequential context. [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines its event operations in terms
+ of an event loop mechanism, in which events of all types are fed into different <em>task queues</em>. This specification does not define events in terms of this
+ event loop mechanism, but it is compatible with this mechanism. Instead, this specification defines several operation-specific <a class="def" href="#glossary-event-order">
+ event orders</a>.</p>
+
+ <p>Using the terminology of HTML5, each independent device, such as a mouse or keyboard, <em class="rfc2119" title="SHOULD">SHOULD</em> be treated as a <em>task source</em> which feeds into the appropriate
+ <em>task queue</em>, in the order defined by the <a class="def" href="#glossary-event-order">event order</a> associated with that device. Each operation, such as
+ a focus change or composition input, also acts as a <em>task source</em> for the appropriate <em>task queue</em>. The resolution of these event loops is handled
+ in a manner conforming to the <a class="def" href="#glossary-host-language">host language</a>, such as HTML [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>].</p>
+
+ <div class="note"><div class="note-title" id="h_note_9"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Certain events, such as <q>hotkeys</q> or control keys pressed in a certain sequence, can be
+ <q>swallowed</q> by the operating system or the application, interrupting the expected <a class="def" href="#glossary-event-order">event order</a>.</p></div>
+ </div>
+ </div>
+
+ <div id="trusted-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_trusted-events"><span class="secno">3.4 </span>Trusted events</h3>
+
+ <p>Events that are generated by the user agent, either as a result of user interaction, or as a direct result of changes to the DOM, are trusted by the user agent
+ with privileges that are not afforded to events generated by script through the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a>
+ method, modified using the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method, or dispatched via the <a href="#widl-EventTarget-dispatchEvent">
+ <code>EventTarget.dispatchEvent()</code></a> method. The <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute of trusted events has a
+ value of <code>true</code>, while untrusted events have a <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>.</p>
+
+ <p>Most untrusted events <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> trigger <a class="def" href="#glossary-default-action">default actions</a>, with the exception of <a class="eventtype" href="#event-type-click">
+ <code>click</code></a> or <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events. These events trigger the <a class="def" href="#glossary-default-action">
+ default action</a> of an <a class="def" href="#glossary-activation-trigger">activation trigger</a> (see <a href="#event-flow-activation">Activation triggers and behaviors</a> for more details). These
+ untrusted events have an <a href="#widl-Event-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>, but still initiate any
+ <a class="def" href="#glossary-default-action">default actions</a> for backwards compatibility. All other untrusted events <em class="rfc2119" title="MUST">MUST</em> behave
+ as if the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> method had been called on that event.</p>
+ </div>
+
+ <div id="event-flow-activation" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-flow-activation"><span class="secno">3.5 </span>Activation triggers and behavior</h3>
+
+ <p>Certain <a class="def" href="#glossary-event-target">event targets</a> (such as a link or button element) <em class="rfc2119" title="MAY">MAY</em> have associated <a class="def" href="#glossary-activation-behavior">
+ activation behavior</a> (such a following a link) that implementations perform in response to an <em><a class="def" href="#glossary-activation-trigger">activation
+ trigger</a></em> (such as clicking a link).</p>
+
+ <p>A <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> indicate which, if any, elements have activation behavior, describe appropriate <a class="def" href="#glossary-activation-trigger">activation triggers</a>, and define the result of that activation behavior. An implementation which supports a <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> initiate these <a class="def" href="#glossary-activation-behavior">activation behavior</a> when the associated
+ <a class="def" href="#glossary-activation-trigger">activation trigger</a> occurs.</p>
+
+ <div class="example" id="example-activation">
+ <div class="example-title"></div>
+ <p>Both HTML and SVG have an <code><a></code> element which indicates a link. Relevant <a class="def" href="#glossary-activation-trigger">activation triggers</a> for an <code><a></code> element are a <a class="eventtype" href="#event-type-click"><code>
+ click</code></a> event on the text or image content of the <code><a></code> element, or a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>
+ event with a <a href="#widl-KeyboardEvent-key">key</a> attribute value of <a href="#key-Enter"><code class="key">'Enter'</code></a> key when the <code><a></code>
+ element has focus. The activation behavior for an <code><a></code> element is normally to change the content of the window to the content of the new document,
+ in the case of external links, or to reposition the current document relative to the new anchor, in the case of internal links.</p>
+ </div>
+
+ <p>An <a class="def" href="#glossary-activation-trigger">activation trigger</a> is a user action or an event which indicates to the implementation that an activation
+ behavior <em class="rfc2119" title="SHOULD">SHOULD</em> be initiated. User-initiated <a class="def" href="#glossary-activation-trigger">activation triggers</a> include clicking a mouse button on an activatable
+ element, pressing the <a href="#key-Enter"><code class="key">'Enter'</code></a> key when an activatable element has focus, or pressing a key that is somehow
+ linked to an activatable element (a <q>hotkey</q> or <q>access key</q>) even when that element does not have focus. Event-based <a class="def" href="#glossary-activation-trigger">
+ activation triggers</a> <em class="rfc2119" title="MAY">MAY</em> include timer-based events that activate an element at a certain clock time or after a certain time period has elapsed, progress
+ events after a certain action has been completed, or many other condition-based or state-based events.</p>
+
+ <p>In some cases, a <a class="def" href="#glossary-host-language">host language</a> <em class="rfc2119" title="MAY">MAY</em> define attributes or even attribute values which add to or change the native
+ <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a> of an element.
+ For example, ARIA [<cite><a class="informative" href="#ref-ARIA">ARIA</a></cite>] defines values for the <code class="attr">role</code> attribute that add semantics
+ to the element to which it is applied, for purposes of enhanced accessibility. In such cases, if the <a class="def" href="#glossary-host-language">host language</a>
+ does not explicitly define the <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation
+ behavior</a>, the content author <em class="rfc2119" title="MUST">MUST</em> provide the mechanics of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> (via an event listener)
+ or <a class="def" href="#glossary-activation-behavior">activation behavior</a> (such as calling an ECMAScript function) for that element when applying that attribute
+ or attribute value.</p>
+
+ <div id="click-synthesis" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_click-synthesis"><span class="secno">3.5.1 </span>Activation event synthesis</h4>
+
+ <p>If the instance of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> is not an event of <a class="def" href="#glossary-event-type">event
+ type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> (that is, when it does not result from a user's activation of a button or link
+ using a mouse or equivalent pointing device), the implementation <em class="rfc2119" title="MUST">MUST</em> synthesize and dispatch an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> as one of the <a class="def" href="#glossary-default-action">default actions</a> of that <a class="def" href="#glossary-activation-trigger">activation trigger</a>. The value of the <code class="attribute-name"><a href="#widl-Event-target">Event.target</a></code>
+ <em class="rfc2119" title="MUST">MUST</em> be set to the <a class="def" href="#glossary-event-target">event target</a> (normally, the currently focused element), and the event <em class="rfc2119" title="MUST">MUST</em> simulate a <em>left
+ click</em> (i.e., the <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>, and the <a href="#widl-MouseEvent-buttons">
+ <code>MouseEvent.buttons</code></a> attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>1</code>). Other context information of such a simulated <a class="eventtype" href="#event-type-click">
+ <code>click</code></a> event is implementation dependent, but for historical purposes, the interface for the <a class="eventtype" href="#event-type-click"><code>click</code></a>
+ event <em class="rfc2119" title="MUST">MUST</em> be the <a href="#interface-MouseEvent"><code>MouseEvent interface</code></a>, regardless of the actual device used to activate the element. Preventing
+ the <a class="def" href="#glossary-default-action">default action</a> of the <a class="def" href="#glossary-activation-trigger">activation trigger</a>, such as
+ with the <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>, <em class="rfc2119" title="MUST">MUST</em> stop the initiation of the <a class="def" href="#glossary-activation-behavior">
+ activation behavior</a>.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>When a user activates a hyperlink using a keyboard, such as by focusing the hyperlink element
+ and pressing the <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key, a <a class="eventtype" href="#event-type-click"><code>click</code></a> event would be dispatched as the <a class="def" href="#glossary-default-action">default action</a> of the respective
+ <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event.</p>
+ </div>
+
+ <p>Implementations <em class="rfc2119" title="MUST">MUST</em> dispatch the synthesized <a class="eventtype" href="#event-type-click"><code>click</code></a> event as described above even if they do not
+ normally dispatch such an event (e.g., when activation is requested by a voice command, since this specification does not address <a class="def" href="#glossary-event-type">
+ event types</a> for voice input).</p>
+
+ <div class="note"><div class="note-title" id="h_note_10"><span>Note</span></div><p class=""><strong>Note:</strong> 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></div>
+ </div>
+
+ <div id="events-activation-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-activation-event-order"><span class="secno">3.5.2 </span>Activation event order</h4>
+
+ <p>Activation triggers and behavior can be defined in part by the events which are dispatched in a set order relative to one another. The following is the typical
+ sequence of events for an element activated by a pointing device (with only pertinent events listed):</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td colspan="2">
+ <em>All <a class="def" href="#glossary-default-action">default actions</a>,
+ including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>The following is the typical sequence of events when a focused element is activated by a key event (with only pertinent events listed):</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td><em class="rfc2119" title="MUST">MUST</em> be a key which can activate the element, such as the
+ <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key,
+ or the element is not activated</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td><a class="def" href="#glossary-default-action">default action</a>; synthesized; <code>trusted="false"</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td colspan="2">
+ <em>All <a class="def" href="#glossary-default-action">default actions</a>,
+ including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
+ </td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+
+ <div id="event-exceptions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-exceptions"><span class="secno">3.6 </span>Event exceptions</h3>
+
+ <p><em>This section is informative.</em></p>
+
+ <p>Event operations can throw a <code>DOMException</code> as specified in their method descriptions.</p>
+
+ <div class="note"><div class="note-title" id="h_note_11"><span>Note</span></div><p class="" id="note-eventexcpetion-removed"><strong>Note:</strong> The exception <em>EventException</em> introduced in <strong class="version">DOM Level 2</strong> is
+ removed in this specification as part of this specification's normative support of <a href="#references-WebIDL">Web IDL</a>. <em>EventException</em> formerly defined
+ an exception code <code>UNSPECIFIED_EVENT_TYPE_ERR</code> which is replaced in this specification by the use of a <code>DOMException</code> of type
+ <code>InvalidStateError</code>.</p></div>
+
+ <p>The following <code>DOMException</code> types are used in this specification.</p>
+
+ <table class="exceptiontable" summary="Layout table: the first cell contains the name of the DOMException type, the second contains a short description">
+ <tbody><tr>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code><dfn id="dfn-invalidstateerror">InvalidStateError</dfn></code></td>
+ <td>Thrown when the <a href="#widl-Event-type"><code>Event.type</code></a> was not specified by initializing the event before <code>dispatchEvent</code> was
+ called. Also thrown when the <a href="#interface-Event"><code>Event</code></a> object provided to <code>dispatchEvent</code> is already being dispatched.</td>
+ </tr>
+ <tr>
+ <td><code><dfn id="dfn-notsupportederror">NotSupportedError</dfn></code></td>
+ <td>Thrown when <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent()</code></a> is passed an <a href="#interface-Event"><code>Event</code></a>
+ interface that the implementation does not support.</td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+<!-- dom-event-architecture -->
+
+
+
+<!-- Section 4: Basic Event Interfaces ========================================================-->
+
+ <div id="event-interfaces" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_event-interfaces"><span class="secno">4. </span>Basic Event Interfaces</h2>
+
+ <p>The interfaces described in this section are fundamental to DOM Level 3 Events and <em class="rfc2119" title="MUST">MUST</em> always be supported by the implementation.</p>
+
+ <p>The event types defined in this specification derive from these basic interfaces, and <em class="rfc2119" title="MUST">MUST</em> inherit all of the attributes, methods, and constants of the interfaces
+ they derive from. Event types defined in other specifications <em class="rfc2119" title="MAY">MAY</em> similarly inherit from these basic interfaces or other interfaces defined in this specification,
+ or <em class="rfc2119" title="MAY">MAY</em> define their own interfaces. The following chart describes the inheritance structure of interfaces defined in this specification.</p>
+
+ <div class="figure" style="text-align: center" id="fig-graphical-representation-of-the-dom3-events-interface-inheritance">
+ <object type="image/svg+xml" data="images/event-inheritance.svg" width="960" height="230">
+ <img src="images/event-inheritance.png" alt="Graphical representation of the DOM3 Events interface inheritance" />
+ </object>
+ <div class="figcaption">Fig. <span class="figno">2</span> <span class="fig-title">Graphical representation of the DOM3 Events interface inheritance</span></div></div>
+
+ <div id="interface-Event" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_interface-Event"><span class="secno">4.1 </span>Interface Event</h3>
+
+ <p class="intro-dom">Introduced in DOM Level 2</p>
+
+ <p>The <code>Event</code> interface provides basic contextual information about an event to all registered <a class="def" href="#glossary-event-handler">event handlers</a>.
+ Specific events can also implement other derived interfaces, for example the <a href="#interface-UIEvent"><code>UIEvent</code></a> and <a href="#interface-MouseEvent">
+ <code>MouseEvent</code></a> interfaces.</p>
+
+ <p>To create an instance of the <code>Event</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a>
+ method call.</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-Event">interface <span class="idlInterfaceID">Event</span> {
+<span class="idlSectionComment"> // PhaseType</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#NONE">NONE</a></span> = <span class="idlConstValue">0</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#CAPTURING_PHASE">CAPTURING_PHASE</a></span> = <span class="idlConstValue">1</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#AT_TARGET">AT_TARGET</a></span> = <span class="idlConstValue">2</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#BUBBLING_PHASE">BUBBLING_PHASE</a></span> = <span class="idlConstValue">3</span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-Event-type">type</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-Event-target">target</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-Event-currentTarget">currentTarget</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-Event-eventPhase">eventPhase</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-bubbles">bubbles</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-cancelable">cancelable</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMTimeStamp</span> <span class="idlAttrName"><a href="#widl-Event-timeStamp">timeStamp</a></span>;</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-stopPropagation-void">stopPropagation</a></span> ();</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-preventDefault-void">preventDefault</a></span> ();</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-initEvent-void-DOMString-eventTypeArg-boolean-bubblesArg-boolean-cancelableArg">initEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">eventTypeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>);</span>
+<span class="idlSectionComment"> // Introduced in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Event-stopImmediatePropagation-void">stopImmediatePropagation</a></span> ();</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-defaultPrevented">defaultPrevented</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-Event-isTrusted">isTrusted</a></span>;</span>
+};</span></pre><div id="attributes" class="section"><h4 id="h4_attributes"><span class="secno">4.1.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-Event-bubbles"><code>bubbles</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Used to indicate whether or not an event is a bubbling event. If the event can bubble the value <em class="rfc2119" title="MUST">MUST</em> be <code>true</code>, otherwise the value <em class="rfc2119" title="MUST">MUST</em> be
+ <code>false</code>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-Event-cancelable"><code>cancelable</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Used to indicate whether or not an event can have its <a class="def" href="#glossary-default-action">default action</a> prevented (see also <a href="#event-flow-default-cancel">
+ Default actions and cancelable events</a>). If the <a class="def" href="#glossary-default-action">default action</a> can be prevented the value <em class="rfc2119" title="MUST">MUST</em> be <code>true</code>,
+ otherwise the value <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_12"><span>Note</span></div><p class=""><strong>Note:</strong> Use <code>Event.defaultPrevented</code> to see whether a cancelable event has beened cancelled or not.</p></div>
+ </dd><dt id="widl-Event-currentTarget"><code>currentTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
+ <p>Used to retrieve the <a class="def" href="#glossary-current-event-target">current event target</a> whose <a href="#interface-EventListener"><code>EventListeners</code></a>
+ are currently being processed. This is particularly useful during the capture and bubbling phases.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd><dt id="widl-Event-defaultPrevented"><code>defaultPrevented</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>Used to indicate whether this event has been cancelled or not. <code>Event.defaultPrevented</code> <em class="rfc2119" title="MUST">MUST</em> return true if both <a href="#widl-Event-cancelable">
+ <code>Event.cancelable</code></a> is <code>true</code> and <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> has been called for
+ this event. Otherwise this attribute <em class="rfc2119" title="MUST">MUST</em> return <code>false</code>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_13"><span>Note</span></div><p class=""><strong>Note:</strong> Calling <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> after an event has been dispatched will reset
+ the internal default-prevented state of the event.</p></div>
+ </dd><dt id="widl-Event-eventPhase"><code>eventPhase</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
+ <p>Used to indicate the <a href="#event-phase">phase</a> of the event's current propagation path (capture, target, or bubble).
+ The event flow phases are defined in <a href="#event-flow">Event dispatch and DOM event flow</a>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code> (<code>NONE</code>).</p>
+ </dd><dt id="widl-Event-isTrusted"><code>isTrusted</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>Used to indicate whether this event was generated by the <a class="def" href="#glossary-user-agent">user agent</a> (trusted) or by script (untrusted). See <a href="#trusted-events">trusted events</a> for more details.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-Event-target"><code>target</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
+ <p>Used to retrieve the <a class="def" href="#glossary-event-target">event target</a> associated with the <a href="#event-flow">Event dispatch and DOM
+ event flow</a>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd><dt id="widl-Event-timeStamp"><code>timeStamp</code> of type <span class="idlAttrType">DOMTimeStamp</span>, readonly </dt><dd>
+ <p>Used to specify the time at which the event was created in milliseconds relative to 1970-01-01T00:00:00Z. This value is the <a class="def" href="#glossary-un-initialized-value">
+ un-initialized value</a> of this attribute.</p>
+ </dd><dt id="widl-Event-type"><code>type</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p>The name of the event type. <a href="#conf-specs">Specifications that define events</a>, <a href="#conf-authors">content authors</a>, and <a href="#conf-author-tools">
+ authoring tools</a> <em class="rfc2119" title="MUST">MUST</em> use case-sensitive event type names.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd></dl></div><div id="methods" class="section"><h4 id="h4_methods"><span class="secno">4.1.2 </span>Methods</h4><dl class="methods"><dt id="widl-Event-initEvent"><code>initEvent</code></dt><dd>
+ <p>Initializes attributes of an <code>Event</code>. The <code>Event</code> could have been created through the <a href="#widl-DocumentEvent-createEvent">
+ <code>DocumentEvent.createEvent</code></a> method or by the implementation in response to a user action. For any <code>Event</code> created with the
+ <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent</code></a> method, this method <em class="rfc2119" title="MUST">MUST</em> be called before the <code>Event</code>
+ is dispatched via the <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. If the method is called several
+ times before invoking <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, only the final invocation takes precedence.
+ If this method is called during an invocation of <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, this method
+ <em class="rfc2119" title="MUST">MUST</em> do nothing and return immediately. 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 <em class="rfc2119" title="MUST">MUST</em> also reset the event object's internal-propagation and default-action-prevention states. This allows an event object to be "reset"
+ before being dispatched multiple times.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>If an <code>EventListener</code> called <code>stopPropagation()</code> or <code>stopImmediatePropagation()</code> during
+ the event's previous dispatch, then after calling this method, the event can be re-dispatched (via <code>dispatchEvent</code>) and will propagate through all candidate
+ event listeners along its propagation path (as it did during the prior dispatch). Similarily, if an <code>EventListener</code> called <code>preventDefault()</code>
+ during the event's previous dispatch, then after calling this method, the event's <code>defaultPrevented</code> property will be <code>false</code>.</p>
+ </div>
+
+ <p class="warning" id="warning-initEvent-untrusted"><strong>Warning!</strong> For security reasons, events modified using <a href="#widl-Event-initEvent"><code>
+ Event.initEvent()</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute value of <code>false</code>.
+ See <a href="#trusted-events">trusted events</a> for more details.</p>
+
+ <div class="note"><div class="note-title" id="h_note_14"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> <a class="def" href="#trusted-events">Trusted events</a> can have their <a class="def" href="#glossary-event-type">
+ event type</a> and other attributes changed using this method. However, this method always converts the <code>Event</code> from a trusted event to an untrusted
+ event (e.g., the <a href="#widl-Event-isTrusted"><code>Event.isTrusted</code></a> attribute will return <code>false</code>).</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_15"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> <a class="def" href="#trusted-events">Trusted events</a> are pre-initialized by the implementation before being dispatched.
+ As a result, it is not necessary to call <code>Event.initEvent()</code> prior to re-dispatching the trusted event--however calling <a href="#widl-EventTarget-dispatchEvent">
+ <code>EventTarget.dispatchEvent()</code></a> will convert the <code>Event</code> from a trusted event to an untrusted event (e.g., the <a href="#widl-Event-isTrusted">
+ <code>Event.isTrusted</code></a> attribute will return <code>false</code>).</p></div>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">eventTypeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-Event-type"><code>Event.type</code></a>, the name of the event type.</p>
+ </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-Event-bubbles"><code>Event.bubbles</code></a>. This parameter overrides the intrinsic bubbling behavior of the event.</p>
+ </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-Event-cancelable"><code>Event.cancelable</code></a>. This parameter overrides the intrinsic cancelable behavior of the event.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-preventDefault"><code>preventDefault</code></dt><dd>
+ <p>When this method is invoked, the event <em class="rfc2119" title="MUST">MUST</em> be canceled, meaning any <a class="def" href="#glossary-default-action">default actions</a> normally taken by the implementation
+ as a result of the event <em class="rfc2119" title="MUST NOT">MUST NOT</em> occur (see also <a href="#event-flow-default-cancel">Default actions and cancelable events</a>). Default actions which occur prior
+ to the event's dispatch (see <a href="#event-flow-default-cancel">Default actions and cancelable events</a>) are reverted. Calling this method for a non-cancelable
+ event <em class="rfc2119" title="MUST">MUST</em> have no effect. If an event has more than one <a class="def" href="#glossary-default-action">default action</a>, each cancelable <a class="def" href="#glossary-default-action">
+ default action</a> <em class="rfc2119" title="MUST">MUST</em> be canceled.</p>
+
+ <div class="note"><div class="note-title" id="h_note_16"><span>Note</span></div><p class=""><strong>Note:</strong> This method does not stop the event propagation — use <a href="#widl-Event-stopPropagation">
+ <code>Event.stopPropagation()</code></a> or <a href="#widl-Event-stopImmediatePropagation"><code>Event.stopImmediatePropagation()</code></a> for that effect.</p></div>
+ <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-stopImmediatePropagation"><code>stopImmediatePropagation</code></dt><dd>
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>Prevents all other <a class="def" href="#glossary-event-handler">event listeners</a> from being triggered for this event dispatch, <strong>including</strong> any remaining
+ <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>. Once it has been called, further calls to this method have no additional
+ effect.</p>
+
+ <div class="note"><div class="note-title" id="h_note_17"><span>Note</span></div><p class=""><strong>Note:</strong> This method does not prevent the <a class="def" href="#glossary-default-action">default action</a> from being invoked —
+ use <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> for that effect.</p></div>
+ <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd><dt id="widl-Event-stopPropagation"><code>stopPropagation</code></dt><dd>
+ <p>Prevents all other <a class="def" href="#glossary-event-handler">event listeners</a> from being triggered for this event dispatch, <strong>excluding</strong> any remaining <a class="def" href="#glossary-candidate-event-handlers">candidate event listeners</a>. Once it has been called, further calls to this method have no additional effect.</p>
+
+ <div class="note"><div class="note-title" id="h_note_18"><span>Note</span></div><p class="" id="note-stopPropagation-default"><strong>Note:</strong> This method does not prevent the <a class="def" href="#glossary-default-action">default action</a>
+ from being invoked — use <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a> for that effect.</p></div>
+ <div><em>No parameters.</em></div><div><em>Return type: </em><code></code></div></dd></dl></div><div id="constants" class="section"><h4 id="h4_constants"><span class="secno">4.1.3 </span>Constants</h4><dl class="constants"><dt id="widl-Event-AT_TARGET"><code>AT_TARGET</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The current event is in the <a class="def" href="#glossary-target-phase">target phase</a>, i.e., it is being evaluated at the <a class="def" href="#glossary-event-target">event target</a>.</p>
+ </dd><dt id="widl-Event-BUBBLING_PHASE"><code>BUBBLING_PHASE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The current event phase is the <a class="def" href="#glossary-bubbling-phase">bubbling phase</a>.</p>
+ </dd><dt id="widl-Event-CAPTURING_PHASE"><code>CAPTURING_PHASE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The current event phase is the <a class="def" href="#glossary-capture-phase">capture phase</a>.</p>
+ </dd><dt id="widl-Event-NONE"><code>NONE</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The current event is not being dispatched, i.e., the <a href="#widl-Event-eventPhase">Event.eventPhase</a> is being observered prior to
+ calling <a href="#widl-EventTarget-dispatchEvent">EventTarget.dispatchEvent()</a> or following the completion of the
+ <a class="def" href="#glossary-phase">event phases</a> of a given <code>Event</code>.</p>
+ </dd></dl></div>
+ </div>
+<!-- Event -->
+
+
+ <div id="interface-CustomEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_interface-CustomEvent"><span class="secno">4.2 </span>Interface CustomEvent</h3>
+
+ <p class="intro-dom">Introduced in DOM Level 2</p>
+
+ <p>The <a href="#interface-CustomEvent"><code>CustomEvent</code></a> interface is the <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> interface for application-specific event types. Unlike the <a href="#interface-Event">
+ <code>Event</code></a> interface, it allows applications to provide contextual information about the event type.</p>
+
+ <div class="note"><div class="note-title" id="h_note_19"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Use a prefix string on the event type name for application-specific event types to avoid clashes with future general-purpose
+ event types.</p></div>
+
+ <p>To create an instance of the <code>CustomEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("CustomEvent")</code></a>
+ method call.</p>
+
+ <div class="note"><div class="note-title" id="h_note_20"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
+ CustomEvent objects.</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-CustomEvent">interface <span class="idlInterfaceID">CustomEvent</span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">any</span> <span class="idlAttrName"><a href="#widl-CustomEvent-detail">detail</a></span>;</span>
+};</span></pre><div id="attributes-1" class="section"><h4 id="h4_attributes-1"><span class="secno">4.2.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-CustomEvent-detail"><code>detail</code> of type <span class="idlAttrType">any</span>, readonly </dt><dd>
+ <p>Specifies some detail information about the <a href="#interface-Event"><code>Event</code></a>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd></dl></div>
+ </div>
+<!-- CustomEvent -->
+
+
+ <div id="interface-EventTarget" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_interface-EventTarget"><span class="secno">4.3 </span>Interface EventTarget</h3>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The <code>EventTarget</code> interface allows registration and removal of event listeners, and dispatch of events to an event target.</p>
+
+ <div class="note"><div class="note-title" id="h_note_21"><span>Note</span></div><p class=""><strong>Note:</strong> Though an event listener can be registered for any <a class="def" href="#glossary-event-target">event
+ target</a> node, the user agent only dispatches UA-generated (trusted) events on node types that are defined as event target types for that specific event type
+ (see the <a href="#event-types-list">List of DOM3 Event Types</a>). For example, a <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>
+ event type registered on a text node will never be fired by the user agent, though a content author could dispatch an event of that type on the text node via script.</p></div>
+
+ <p>When used with the DOM event flow, this interface <em class="rfc2119" title="MUST">MUST</em> be implemented by all <a class="def" href="#glossary-event-target">event targets</a> 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>removeEventListener</code>) repeatedly on the same <code>EventTarget</code> with the same values for the parameters
+ <code>type</code>, <code>listener</code>, and <code>useCapture</code> has no effect. Doing so does not cause the event listener to be registered more than once and
+ does not cause a change in the triggering order.</p>
+
+ <div class="note"><div class="note-title" id="h_note_22"><span>Note</span></div><p class=""><strong>Note:</strong> In addition to the <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a> method, some
+ <a class="def" href="#glossary-host-language">host languages</a> allow a content author to register event listeners by the use of attributes, e.g.,
+ <code>onclick="handleClick()"</code> (see [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] for further examples). Due to the
+ language-specific details, this type of event listener registration is not defined in this specification. In general, many event types can be used as an attribute
+ in this way by adding the prefix <em><code>on-</code></em> to the event type name. Dispatching events to these listeners is expected to behave consistently with the
+ event registration and propagation defined in this specification, with the same interfaces, properties, and methods.</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-EventTarget">interface <span class="idlInterfaceID">EventTarget</span> {
+<span class="idlSectionComment"> // Modified in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventTarget-addEventListener-void-DOMString-type-EventListener-listener-boolean-useCapture">addEventListener</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">type</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventListener" class="idlType"><code>EventListener</code></a>?</span> <span class="idlParamName">listener</span></span>, <span class="idlParam">optional <span class="idlParamType">boolean</span> <span class="idlParamName">useCapture</span> = <span class="idlDefaultValue">false</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventTarget-removeEventListener-void-DOMString-type-EventListener-listener-boolean-useCapture">removeEventListener</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">type</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventListener" class="idlType"><code>EventListener</code></a>?</span> <span class="idlParamName">listener</span></span>, <span class="idlParam">optional <span class="idlParamType">boolean</span> <span class="idlParamName">useCapture</span> = <span class="idlDefaultValue">false</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-EventTarget-dispatchEvent-boolean-Event-event">dispatchEvent</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlParamName">event</span></span>);</span>
+};</span></pre><div id="methods-1" class="section"><h4 id="h4_methods-1"><span class="secno">4.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-EventTarget-addEventListener"><code>addEventListener</code></dt><dd>
+ <p><em>Modified in DOM Level 3</em></p>
+
+ <p>Registers an event listener on the <a href="#interface-EventTarget"><code>EventTarget</code></a>. The listener is registered for the capture phase if the
+ <code>useCapture</code> parameter is <code>true</code>, and for the bubble phase otherwise. When the event reaches the target element, listeners for both
+ the capture and bubble phases are triggered as part of the target phase.
+ </p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">type</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies the <a href="#widl-Event-type"><code>Event.type</code></a> associated with the event for which the user is registering.</p>
+ </td></tr><tr><td class="prmName">listener</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>If non-null, the <code>listener</code> parameter <em class="rfc2119" title="MUST">MUST</em> be an object that implements the
+ <a href="#interface-EventListener"><code>EventListener</code></a> interface or a function.
+ If <code>listener</code> is a function then it <em class="rfc2119" title="MUST">MUST</em> be used as the callback for the event.
+ Otherwise, if <code>listener</code> implements
+ <a href="#interface-EventListener"><code>EventListener</code></a>, then its
+ <a href="#widl-EventListener-handleEvent">handleEvent</a> method <em class="rfc2119" title="MUST">MUST</em> be used as the callback.
+ </p>
+ </td></tr><tr><td class="prmName">useCapture</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptTrue"><span aria-label="True">✔</span></td><td class="prmDesc">
+ <p>If true, <code>useCapture</code> indicates that the user wishes to add the event listener for the <a class="def" href="#glossary-capture-phase">capture</a>
+ and <a class="def" href="#glossary-target-phase">target</a> phases only, i.e., this event listener will not be triggered during the <a class="def" href="#glossary-bubbling-phase"> bubbling</a> phase. If <code>false</code>, the event listener <em class="rfc2119" title="MUST">MUST</em> only be triggered during the <a class="def" href="#glossary-target-phase">target</a> and <a class="def" href="#glossary-bubbling-phase">bubbling</a> phases.</p>
+
+ <p>This parameter <em class="rfc2119" title="MUST">MUST</em> be optional. If not provided, the <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a> method <em class="rfc2119" title="MUST">MUST</em> behave as if
+ <code class="parameter-name">useCapture</code> was specified to be <code>false</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_23"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> The <code class="parameter-name">useCapture</code> parameter was mandatory in
+ DOM2 Events [<a href="#references-DOM2Events">DOM2 Events</a>], and omitting this parameter could cause an error in older implementations.</p></div>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-EventTarget-dispatchEvent"><code>dispatchEvent</code></dt><dd>
+ <p><em>Modified in DOM Level 3</em></p>
+
+ <p>Dispatches an event into the implementation's event model. The <a class="def" href="#glossary-event-target">event target</a> of the event <em class="rfc2119" title="MUST">MUST</em> be the <code>EventTarget</code>
+ object on which <code>dispatchEvent</code> is called.</p>
+
+ <p>If after the event object finishes propagating through the DOM event flow its <a href="#widl-Event-defaultPrevented"><code>Event.defaultPrevented</code></a>
+ attribute is <code>false</code>, then this method returns <code>true</code>. Otherwise this method returns <code>false</code>.</p>
+
+ <p class="warning"><strong>Warning!</strong> For security reasons, events dispatched using <a href="#widl-EventTarget-dispatchEvent">
+ <code>EventTarget.dispatchEvent()</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute value
+ of <code>false</code>. See <a href="#trusted-events">trusted events</a> for more details.</p>
+
+ <div class="note"><div class="note-title" id="h_note_24"><span>Note</span></div><p class=""><strong>Note:</strong> While a dispatch (triggered by <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a>) is in progress, calls to
+ <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> are ignored (the method returns immediately without side-effects) and calls to
+ <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> result in an exception.</p></div>
+
+
+
+ <p><strong>Exceptions:</strong>
+ If the <a href="#widl-Event-type"><code>Event.type</code></a> was not specified by initializing the event before <code>dispatchEvent</code> was called OR
+ the <a href="#interface-Event"><code>Event</code></a> object is already being dispatched, a <code>DOMException</code> of type <em><code>InvalidStateError</code></em>
+ is thrown.</p>
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">event</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>The event to be dispatched.</p>
+ <div class="note"><div class="note-title" id="h_note_25"><span>Note</span></div><p class=""><strong>Note: </strong>This parameter receives an <code>Event</code> object, or any object that inherits from <code>Event</code>, e.g.,
+ <a href="#interface-MouseEvent"><code>MouseEvent</code></a>,
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>,
+ <code>MutationEvent</code>, etc.</p></div>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd><dt id="widl-EventTarget-removeEventListener"><code>removeEventListener</code></dt><dd>
+ <p><em>Modified in DOM Level 3</em></p>
+
+ <p>Removes an event listener. Calling <code>removeEventListener</code> with arguments that do not identify any currently registered <a href="#interface-EventListener"><code>
+ EventListener</code></a> on the <code>EventTarget</code> has no effect. </p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">type</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies the <a href="#widl-Event-type"><code>Event.type</code></a> for which the user registered the event listener.</p>
+ </td></tr><tr><td class="prmName">listener</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>The <a href="#interface-EventListener"><code>EventListener</code></a> to be removed.</p>
+ </td></tr><tr><td class="prmName">useCapture</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptTrue"><span aria-label="True">✔</span></td><td class="prmDesc">
+ <p>Specifies whether the <a href="#interface-EventListener"><code>EventListener</code></a> being removed was registered for the capture phase or not. Implementations
+ <em class="rfc2119" title="MUST">MUST</em> treat the same listener that was registered twice with both <code>useCapture</code> true and <code>useCapture</code> false as independent registrations, and
+ remove them independently.</p>
+
+ <div class="note"><div class="note-title" id="h_note_26"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> If a listener was registered twice, once for the capture and target phases and once for the target and bubbling phases,
+ this represents two unique registrations. Removal of an event listener registered for the capture and target phases does not affect the same event listener registered
+ for the target and bubbling phases, and vice versa.</p></div>
+
+ <p>This parameter <em class="rfc2119" title="MUST">MUST</em> be optional. If not provided, the <a href="#widl-EventTarget-removeEventListener">EventTarget.removeEventListener</a> method <em class="rfc2119" title="MUST">MUST</em> behave as if
+ <code class="parameter-name">useCapture</code> were specified to be <code>false</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_27"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> The <code class="parameter-name">useCapture</code> parameter was mandatory in
+ DOM2 Events [<a href="#references-DOM2Events">DOM2 Events</a>], and omitting this parameter could cause an error in older implementations.</p></div>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+<!-- EventTarget -->
+
+
+ <div id="interface-EventListener" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_interface-EventListener"><span class="secno">4.4 </span>Interface EventListener</h3>
+
+ <p class="intro-dom">Introduced in DOM Level 2</p>
+
+ <p>The <code>EventListener</code> interface is the primary way to handle events. <code>EventListener</code> represents the callback object that the user agent will
+ invoke when dispatching an <code>Event</code> to an <a href="#widl-EventTarget"><code>EventTarget</code></a>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_28"><span>Note</span></div><p class=""><strong>Note:</strong> Authors define an object which implements the <code>EventListener</code> interface and register their event listener using <a href="#widl-EventTarget-addEventListener">EventTarget.addEventListener</a>. In JavaScript, an <code>EventListener</code> can be either a function or an object
+ with a <code>handleEvent</code> member function.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_29"><span>Note</span></div><p class=""><strong>Note:</strong> It is a best practice for authors to remove their <code>EventListener</code> from its <a href="#widl-EventTarget"><code>EventTarget</code></a>
+ after they have completed using the listener.</p></div>
+
+ <p>Copying a <code>Node</code>, with methods such as <code>Node.cloneNode</code> or <code>Range.cloneContents</code> [<cite><a class="informative" href="#references-DOMRange">DOM Range</a></cite>], <em class="rfc2119" title="MUST NOT">MUST NOT</em> copy the event listeners attached to it.
+ Event listeners can be attached to the newly created <code>Node</code> afterwards, if so desired.</p>
+
+ <p>Moving a <code>Node</code>, with methods such as <code>Document.adoptNode</code>, <code>Node.appendChild</code>, or <code>Range.extractContents</code>
+ [<cite><a class="informative" href="#references-DOMRange">DOM Range</a></cite>], <em class="rfc2119" title="MUST NOT">MUST NOT</em> cause the event listeners attached to it to be removed or un-registered.</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-EventListener">interface <span class="idlInterfaceID">EventListener</span> {
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-EventListener-handleEvent-void-Event-event">handleEvent</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlParamName">event</span></span>);</span>
+};</span></pre><div id="methods-2" class="section"><h4 id="h4_methods-2"><span class="secno">4.4.1 </span>Methods</h4><dl class="methods"><dt id="widl-EventListener-handleEvent"><code>handleEvent</code></dt><dd>
+ <p>This method <em class="rfc2119" title="MUST">MUST</em> be called whenever an event occurs of the event type for which the <code>EventListener</code> interface was registered.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">event</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>The <a href="#interface-Event"><code>Event</code></a> contains contextual information about the <a class="def" href="#glossary-event">event</a>.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+<!-- EventListener -->
+
+
+ <div id="interface-DocumentEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_interface-DocumentEvent"><span class="secno">4.5 </span>Interface DocumentEvent</h3>
+
+ <p class="intro-dom">Introduced in DOM Level 2</p>
+
+ <p>The <code>DocumentEvent</code> interface provides a mechanism by which the user can create an <a href="#interface-Event"><code>Event</code></a> object of a type supported
+ by the implementation. The <code>DocumentEvent</code> interface <em class="rfc2119" title="MUST">MUST</em> be implemented on the same object that implements the <code>Document</code> interface.</p>
+
+ <pre class="idl"><span class="idlImplements"><a href="#dfn-document" class="internalDFN">Document</a> implements <a href="#idl-def-DocumentEvent" class="idlType"><code>DocumentEvent</code></a>;</span></pre><div class="idlImplementsDesc">
+ </div>
+
+
+<!-- NOTE: This is preserved as a [NoInterfaceObject] definition (rather than a partial interface Document { ..} because SVG also needs to implement this interface on their SVGSVGElement interface -->
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-DocumentEvent">[<span class="extAttr">NoInterfaceObject</span>]
+interface <span class="idlInterfaceID">DocumentEvent</span> {
+<span class="idlMethod"> <span class="idlMethType"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> <span class="idlMethName"><a href="#widl-DocumentEvent-createEvent-Event-DOMString-eventInterface">createEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">eventInterface</span></span>);</span>
+};</span></pre><div id="methods-3" class="section"><h4 id="h4_methods-3"><span class="secno">4.5.1 </span>Methods</h4><dl class="methods"><dt id="widl-DocumentEvent-createEvent"><code>createEvent</code></dt><dd>
+ <p class="intro-dom">Modified in DOM Level 3</p>
+
+ <p>Creates an event object of the type specified. Returns the newly created object.</p>
+
+ <div class="note"><div class="note-title" id="h_note_30"><span>Note</span></div><p class=""><strong>Note: </strong>After calling <code>createEvent</code>, and prior to dispatching the event with the
+ <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method, the
+ <a href="#interface-Event"><code>Event</code></a> will need to be initialized with the appropriate event initialization
+ method (e.g., <code>initEvent</code>, <code>initMouseEvent</code>, etc.) in order to associate it with an event type and related values.</p></div>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A content author wishing to synthesize some kind of <a href="#interface-UIEvent"><code>UIEvent</code></a>
+ would invoke <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("UIEvent")</code></a>. The <a href="#widl-UIEvent-initUIEvent"><code>
+ UIEvent.initUIEvent()</code></a> method could then be called on the newly created <a class="noxref" href="#interface-UIEvent"><code>UIEvent</code></a> object to
+ set the specific type of user interface event to be dispatched, <a class="eventtype" href="#event-type-scroll"><code>scroll</code></a> for example, and set its
+ context information, e.g., <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>.</p>
+ </div>
+
+ <p class="warning"><strong>Warning!</strong> For security reasons, events generated using <a href="#widl-DocumentEvent-createEvent">
+ <code>DocumentEvent.createEvent("Event")</code></a> <em class="rfc2119" title="MUST">MUST</em> have a <code class="attribute-name"><a href="#widl-Event-isTrusted">isTrusted</a></code> attribute
+ value of <code>false</code>. See <a href="#trusted-events">trusted events</a> for more details.</p>
+
+ <p><strong>Exceptions:</strong>
+ If the implementation does not support the <a href="#interface-Event"><code>Event</code></a> interface requested, a <code>DOMException</code> of type <em><code>NotSupportedError</code></em>
+ is thrown.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">eventInterface</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>The <code>eventInterface</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.</p>
+
+ <p>For backward compatibility, the following case-insensitive feature names are valid values for the parameter <code>eventInterface</code>:</p>
+
+ <table class="data-table" summary="The first column contains the feature name, the second contains the resulting event interface returned by createEvent">
+ <tbody><tr>
+ <th>Legacy feature name</th>
+ <th>Resulting event interface</th>
+ </tr>
+ <tr>
+ <td><code>"Events"</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ </tr>
+ <tr>
+ <td><code>"HTMLEvents"</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ </tr>
+ <tr>
+ <td><code>"UIEvents"</code></td>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ </tr>
+ <tr>
+ <td><code>"MouseEvents"</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <td><code>"MutationEvents"</code></td>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ </tbody></table>
+
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+<!-- DocumentEvent -->
+
+
+ </div>
+<!-- event-interfaces -->
+
+
+
+<!-- Section 5: The Events ========================================================-->
+
+ <div id="events-module" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_events-module"><span class="secno">5. </span>Events Module</h2>
+
+ <div id="event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-types"><span class="secno">5.1 </span>Event Types</h3>
+ <p>Each event <em class="rfc2119" title="MUST">MUST</em> be associated with a type, called <em>event type</em> and available as the <a href="#widl-Event-type"><code class="interface-attribute">type</code></a>
+ attribute on the event object. The event type <em class="rfc2119" title="MUST">MUST</em> be of type <code>DOMString</code>.</p>
+
+ <div id="event-types-list" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_event-types-list"><span class="secno">5.1.1 </span>List of DOM3 Event Types</h4>
+ <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, or voice), these event
+ types can be generated by the implementation. When used with an [<cite><a class="informative" href="#references-XML">XML 1.0</a></cite>] or
+ [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] application, the specifications of those languages <em class="rfc2119" title="MAY">MAY</em> restrict the
+ semantics and scope (in particular the possible <a class="def" href="#glossary-event-target">event targets</a>) 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 an informative summary of the event types defined in this specification.</p>
+
+ <table class="data-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.">
+ <tbody><tr>
+ <th>Event Type</th>
+ <th>Sync / Async</th>
+ <th>Bubbling phase</th>
+ <th>Trusted event target types</th>
+ <th>DOM interface</th>
+ <th>Cancelable</th>
+ <th>Default Action</th>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-abort"><code>abort</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code>, <code>Element</code></td>
+ <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ <td>Yes</td>
+ <td>Show a <a class="def" href="#glossary-text-composition-system">text composition system</a> candidate window</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-error"><code>error</code></a></td>
+ <td>Async</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code>, <code>Element</code></td>
+ <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ <td>Yes</td>
+ <td>Varies:
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and <a class="eventtype" href="#event-type-input"><code>input</code></a> events;
+ launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
+ <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
+ <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event;
+ <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
+ other event</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-load"><code>load</code></a></td>
+ <td>Async</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td>Varies: start a drag/drop operation; start a text selection; start a scroll/pan interaction (in combination with the middle mouse button, if supported)</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ <td>Yes</td>
+ <td>Invoke a context menu (in combination with the right mouse button, if supported)</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-resize"><code>resize</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code></td>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-scroll"><code>scroll</code></a></td>
+ <td>Async</td>
+ <td><abbr title="Number, Other">No</abbr> / <a href="#scroll-document">Yes</a></td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-select"><code>select</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-unload"><code>unload</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-Event"><code>Event</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-wheel"><code>wheel</code></a></td>
+ <td>Async</td>
+ <td>Yes</td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-WheelEvent"><code>WheelEvent</code></a></td>
+ <td>Yes</td>
+ <td>Scroll (or zoom) the document</td>
+ </tr>
+ </tbody></table>
+
+ <p>For a list of events which are deprecated in this specification, see the <a href="#legacy-event-types">Legacy Event Types</a> appendix
+ at the end of this document.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The following is one way to interpret the above tables: the <a class="eventtype" href="#event-type-load"><code>load</code></a> event will
+ trigger event listeners attached on <code>Element</code> nodes for that event and on the capture and target phases. This event is not cancelable. If an event listener for the
+ <a class="eventtype" href="#event-type-load"><code>load</code></a> event is attached to a node other than <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>,
+ <code>Document</code>, or <code>Element</code> nodes, or if it is attached to the bubbling phase only, this event listener would not be triggered.</p>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_31"><span>Note</span></div><p class=""><strong>Note: </strong>Don't interpret the above tables as definitive for the listed event types. For example, the <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a> event is used in other
+ specifications, for example, in XMLHttpRequest. Similarly, <a href="#widl-EventTarget-dispatchEvent"><code>dispatchEvent</code></a> can be used to dispatch untrusted events to
+ listeners on <strong>any</strong> object that also implements <a href="#interface-EventTarget"><code>EventTarget</code></a>.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_32"><span>Note</span></div><p class=""><strong>Note: </strong>The event objects associated with the event types described above contain additional context information--refer to the description of the DOM
+ interfaces for further information.</p></div>
+ </div>
+ </div>
+
+ <div id="event-definitions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_event-definitions"><span class="secno">5.2 </span>Event Module Definitions</h3>
+ <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 in the future.
+ This document does 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>
+
+ <div id="events-uievents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-uievents"><span class="secno">5.2.1 </span>User Interface Event Types</h4>
+ <p>The User Interface event module contains basic event types associated with user interfaces and document manipulation.</p>
+
+ <div id="interface-UIEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-UIEvent">Interface UIEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 2</p>
+
+ <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 <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("UIEvent")</code></a>
+ method call.</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-UIEvent">interface <span class="idlInterfaceID">UIEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">AbstractView?</span> <span class="idlAttrName"><a href="#widl-UIEvent-view">view</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-UIEvent-detail">detail</a></span>;</span>
+};</span></pre><div class="section"><h6 id="attributes-2">Attributes</h6><dl class="attributes"><dt id="widl-UIEvent-detail"><code>detail</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
+ <p>Specifies some detail information about the <a href="#interface-Event"><code>Event</code></a>, depending on the type of event.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-UIEvent-view"><code>view</code> of type <span class="idlAttrType">AbstractView</span>, readonly , nullable</dt><dd>
+ <p>The <code>view</code> attribute identifies the <code>AbstractView</code> from which the event was generated.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd></dl></div>
+ </div>
+
+ <p>The User Interface event types are listed below. Some of these events use the <a href="#interface-UIEvent"><code>UIEvent</code></a> interface if generated from a
+ user interface, but the <a href="#interface-Event"><code>Event</code></a> interface otherwise, as detailed in each event.</p>
+
+
+<!-- load -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-load"><dfn id="dfn-load"><a class="eventtype" href="#event-type-load"><code>load</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>load</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Async</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ common object whose contained resources have loaded</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM implementation finishes loading the resource (such as the document)
+ and any dependent resources (such as images, style sheets, or scripts). Dependent resources that fail to load <em class="rfc2119" title="MUST NOT">MUST NOT</em> prevent this event from firing if the resource
+ that loaded them is still accessible via the DOM. If this event type is dispatched, implementations are <em class="rfc2119" title="REQUIRED">REQUIRED</em> to dispatch this event at least on the <code>Document</code>
+ node.</p>
+
+ <div class="note"><div class="note-title" id="h_note_33"><span>Note</span></div><p class=""><strong>Note:</strong> For legacy reasons, <a class="eventtype" href="#event-type-load"><code>load</code></a> events for resources inside
+ the document (e.g., images) do not include the <a class="def" href="#glossary-defaultView">defaultView</a> in the propagation path in HTML implementations. See
+ [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] for more information.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- unload -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-unload"><dfn id="dfn-unload"><a class="eventtype" href="#event-type-unload"><code>unload</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>unload</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ common object whose contained resources have been removed</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM Implementation removes from the environment the resource (such
+ as the document) or any dependent resources (such as images, style sheets, scripts). The document <em class="rfc2119" title="MUST">MUST</em> be unloaded after the dispatch of this event type. If this
+ event type is dispatched, implementations are <em class="rfc2119" title="REQUIRED">REQUIRED</em> to dispatch this event at least on the <code>Document</code> node.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- abort -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-abort"><dfn id="dfn-abort"><a class="eventtype" href="#event-type-abort"><code>abort</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>abort</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element whose resources have been stopped from loading without error</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the loading of a resource has been aborted, such as by a user canceling
+ the load while it is still in progress.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- error -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-error"><dfn id="dfn-error"><a class="eventtype" href="#event-type-error"><code>error</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>error</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Async</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element whose resources have been stopped from loading due to an error</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a resource failed to load, or has been loaded but cannot be interpreted
+ according to its semantics, such as an invalid image, a script execution error, or non-well-formed XML.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- select -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-select"><dfn id="dfn-select"><a class="eventtype" href="#event-type-select"><code>select</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>select</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a> if generated from a user interface, <a href="#interface-Event"><code>Event</code></a> otherwise.</td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element whose text content has been selected</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a user selects some text. This event is dispatched after the selection
+ has occurred.</p>
+
+ <p>This specification does not provide contextual information to access the selected text. Where applicable, a <a class="def" href="#glossary-host-language">host
+ language</a> <em class="rfc2119" title="SHOULD">SHOULD</em> define rules for how a user <em class="rfc2119" title="MAY">MAY</em> select content (with consideration for international language conventions), at what point the <a class="eventtype" href="#event-type-select"><code>select</code></a> event is dispatched, and how a content author <em class="rfc2119" title="MAY">MAY</em> access the user-selected content.</p>
+
+ <div class="note"><div class="note-title" id="h_note_34"><span>Note</span></div><p class=""><strong>Note:</strong> In order to access to user-selected content, content authors will use native capabilities of the <a class="def" href="#glossary-host-language">host languages</a>, such as the <code>Document.getSelection()</code> method of the <a href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections">
+ HTML Editing APIs</a> [<cite><a class="informative" href="#references-HTMLEd">HTML Editing</a></cite>].</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_35"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-select"><code>select</code></a> event might not be available
+ for all elements in all languages. For example, in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>], <a class="eventtype" href="#event-type-select">
+ <code>select</code></a> events can be dispatched only on form <code>input</code> and <code>textarea</code> elements. Implementations can dispatch <a class="eventtype" href="#event-type-select"><code>select</code></a> events in any context deemed appropriate, including text selections outside of form controls, or image or
+ markup selections such as in SVG.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- resize -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-resize"><dfn id="dfn-resize"><a class="eventtype" href="#event-type-resize"><code>resize</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>resize</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ object which has been resized</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a document view has been resized. This event type is dispatched after
+ all effects for that occurrence of resizing of that particular <a class="def" href="#glossary-event-target">event target</a> have been executed by the <a class="def" href="#glossary-user-agent">user agent</a>.</p>
+
+ <p><a class="def" href="#glossary-user-agent">User agents</a> which support continuous reflow of the document's layout during user-initiated resizing <em class="rfc2119" title="MUST">MUST</em> dispatch
+ this event synchronously after each reflow of the document.</p>
+
+ <p>The <a class="def" href="#glossary-defaultView"><code>defaultView</code></a> object <em class="rfc2119" title="SHOULD">SHOULD</em> always be resizable. A <a class="def" href="#glossary-host-language">
+ host language</a> <em class="rfc2119" title="MAY">MAY</em> define certain elements to be resizable, and under what conditions (e.g., specific elements like <code><iframe></code>, or elements
+ with particular characteristics like width and height). However, this specification does not define the behavior for elements.</p>
+
+ <div class="note"><div class="note-title" id="h_note_36"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-resize"><code>resize</code></a> event is distinct from the
+ SVG <code class="eventtype">zoom</code> event types, though both can occur at the same time, or as the consequence of the same user action. In particular, browser
+ <q>font zooming</q> or <q>page zooming</q> will not necessarily trigger a <a class="eventtype" href="#event-type-resize"><code>resize</code></a> event.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_37"><span>Note</span></div><p class=""><strong>Note:</strong> In previous DOM Events specifications, the <a class="eventtype" href="#event-type-resize"><code>resize</code></a>
+ event type was defined to have a <a class="def" href="#glossary-bubbling-phase">bubbling phase</a>, but for performance reasons, this was not implemented in most
+ user agents, and this specification removes the <a class="def" href="#glossary-bubbling-phase">bubbling phase</a> for this event.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- scroll -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-scroll"><dfn id="dfn-scroll"><a class="eventtype" href="#event-type-scroll"><code>scroll</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>scroll</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Async</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr> / <a href="#scroll-document">Yes</a></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ object which has been scrolled</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a document view or an element has been scrolled. This event type is dispatched
+ after the scroll has occurred.</p>
+
+ <p id="scroll-document">When dispatched on the <code>Document</code> element, this event type <em class="rfc2119" title="MUST">MUST</em> bubble to the <a class="def" href="#glossary-defaultView"><code>
+ defaultView</code></a> object.</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <div id="events-focusevent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-focusevent"><span class="secno">5.2.2 </span>Focus Event Types</h4>
+
+ <div class="note"><div class="note-title" id="h_note_38"><span>Note</span></div><p class=""><strong>Note:</strong> This interface and its associated event types and <a href="#events-focusevent-event-order">focus event
+ order</a> were designed in accordance to the concepts and guidelines defined in <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/">User Agent Accessibility
+ Guidelines 2.0</a> [<a href="#references-UAAG2">UAAG 2.0</a>], with particular attention on the <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/#gl-focus-mechanism">
+ focus mechanism</a> and the terms defined in the <a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/#def-focus">glossary entry for focus</a>.</p></div>
+
+ <div id="interface-FocusEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-FocusEvent">Interface FocusEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The <code>FocusEvent</code> interface provides specific contextual information associated with Focus events.</p>
+
+ <p>
+ To create an instance of the <code>FocusEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("FocusEvent")</code></a>
+ method call.
+ </p>
+
+ <div class="note"><div class="note-title" id="h_note_39"><span>Note</span></div><p class="">
+ <strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
+ FocusEvent objects.
+ </p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-FocusEvent">interface <span class="idlInterfaceID">FocusEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-FocusEvent-relatedTarget">relatedTarget</a></span>;</span>
+};</span></pre><div class="section"><h6 id="attributes-3">Attributes</h6><dl class="attributes"><dt id="widl-FocusEvent-relatedTarget"><code>relatedTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
+ <p>Used to identify a secondary <a href="#widl-EventTarget"><code>EventTarget</code></a> related to a Focus event, depending on the type of event.</p>
+
+ <p>For security reasons with nested browsing contexts, when tabbing into or out of a nested context, the relevant EventTarget <em class="rfc2119" title="SHOULD">SHOULD</em> be <code>null</code>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd></dl></div>
+ </div>
+
+ <div id="events-focusevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-focusevent-event-order">Focus Event Order</h5>
+ <p>
+ The focus events defined in this specification occur in a set order relative to one another. The following is the typical sequence of events when a focus is shifted
+ between elements (this order assumes that no element is initially focused):</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User shifts focus</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
+ <td>Sent before first target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
+ <td>Sent after first target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User shifts focus</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
+ <td>Sent before first target element loses focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
+ <td>Sent before second target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
+ <td>Sent after first target element loses focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
+ <td>Sent after second target element receives focus</td>
+ </tr>
+ </tbody></table>
+
+ <div class="note"><div class="note-title" id="h_note_40"><span>Note</span></div><p class=""><strong>Note:</strong> This specification does not define the behavior of focus events when interacting with methods such as <code>focus()</code> or
+ <code>blur()</code>. See the relevant specifications where those methods are defined for such behavior.</p></div>
+ </div>
+
+ <div id="events-focusevent-doc-focus" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-focusevent-doc-focus">Document Focus and Focus Context</h5>
+
+ <p>This event module includes event types for notification of changes in document
+ <a class="def" href="#glossary-event-focus">focus</a>.
+ There are three distinct focus contexts that are relevant to this discussion:
+ </p>
+
+ <ul>
+ <li>The <em>operating system focus context</em> which <em class="rfc2119" title="MAY">MAY</em> be on one of many different applications currently
+ running on the computer. One of these applications with focus can be a browser.
+ </li>
+ <li>When the browser has focus, the user can switch (such as with the tab key) the
+ <em>application focus context</em> among the different browser user interface fields (e.g., the
+ Web site location bar, a search field, etc.). One of these user interface fields can be the
+ document being shown in a tab.
+ </li>
+ <li>When the document itself has focus, the <em>document focus context</em> can be set to any of the
+ focusable elements in the document.
+ </li>
+ </ul>
+
+ <p>The event types defined in this specification deal exclusively with document focus, and the
+ <a class="def" href="#glossary-event-target">event target</a> identified in the event details
+ <em class="rfc2119" title="MUST">MUST</em> only be part of the document or documents in the window, never a part of the browser or
+ operating system, even when switching from one focus context to another.
+ </p>
+
+ <p>Normally, a document always has a focused element (even if it is the document element itself) and a persistent <a class="def" href="#glossary-event-focus-ring">focus
+ ring</a>. When switching between focus contexts, the document's currently focused element and focus ring normally remain in their current state. For example,
+ if a document has three focusable elements, with the second element focused, when a user changes operating system focus to another application and then back to
+ the browser, the second element will still be focused within the document, and tabbing will change the focus to the third element. A <a class="def" href="#glossary-host-language">
+ host language</a> <em class="rfc2119" title="MAY">MAY</em> define specific elements which might receive focus, the conditions under which an element <em class="rfc2119" title="MAY">MAY</em> receive focus, the means by which
+ focus <em class="rfc2119" title="MAY">MAY</em> be changed, and the order in which the focus changes. For example, in some cases an element might be given focus by moving a pointer over it, while other
+ circumstances might require a mouse click. Some elements might not be focusable at all, and some might be focusable only by special means (clicking on the element),
+ but not by tabbing to it. Documents <em class="rfc2119" title="MAY">MAY</em> contain multiple focus rings. Other specifications <em class="rfc2119" title="MAY">MAY</em> define a more complex focus model than is described in this specification,
+ including allowing multiple elements to have the current focus.
+ </p>
+ </div>
+
+ <p>The Focus event types are listed below.</p>
+
+
+<!-- blur -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-blur"><dfn id="dfn-blur"><a class="eventtype" href="#event-type-blur"><code>blur</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>blur</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> receiving focus.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> loses
+ focus. The focus <em class="rfc2119" title="MUST">MUST</em> be taken from the element before the dispatch of this event type. This event type is similar to <a class="eventtype" href="#event-type-focusout">
+ <code>focusout</code></a>, but is dispatched after focus is shifted, and does not bubble.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- focus -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-focus"><dfn id="dfn-focus-1"><a class="eventtype" href="#event-type-focus"><code>focus</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>focus</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> losing focus (if any).</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> receives
+ focus. The focus <em class="rfc2119" title="MUST">MUST</em> be given to the element before the dispatch of this event type. This event type is similar to <a class="eventtype" href="#event-type-focusIn">
+ <code>focusin</code></a>, but is dispatched after focus is shifted, and does not bubble.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- focusin -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-focusIn"><dfn id="dfn-focusin"><a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>focusin</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> losing focus (if any).</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> is about
+ to receive focus. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the element is given focus. The <a class="def" href="#glossary-event-target">event target</a> <em class="rfc2119" title="MUST">MUST</em>
+ be the element which is about to receive focus. This event type is similar to <a class="eventtype" href="#event-type-focus"><code>focus</code></a>, but is dispatched
+ before focus is shifted, and does bubble.</p>
+
+ <div class="note"><div class="note-title" id="h_note_41"><span>Note</span></div><p class="" id="_9"><strong>Note:</strong> When using this event type, the content author can use the event's <code class="attribute-name"><a href="#widl-FocusEvent-relatedTarget">
+ FocusEvent.relatedTarget</a></code> attribute (or a host-language-specific method or means) to get the currently focused element before the focus shifts to the
+ next focus <a class="def" href="#glossary-event-target">event target</a>, thus having access to both the element losing focus and the element gaining focus
+ without the use of the <a class="eventtype" href="#event-type-blur"><code>blur</code></a> or <a class="eventtype" href="#event-type-focusout">focusout</a> event
+ types.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- focusout -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-focusout"><dfn id="dfn-focusout"><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>focusout</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> receiving focus.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> is about
+ to lose focus. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the element loses focus. The <a class="def" href="#glossary-event-target">event target</a> <em class="rfc2119" title="MUST">MUST</em> be the
+ element which is about to lose focus. This event type is similar to <a class="eventtype" href="#event-type-blur"><code>blur</code></a>, but is dispatched before
+ focus is shifted, and does bubble.</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <div id="events-mouseevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-mouseevents"><span class="secno">5.2.3 </span>Mouse Event Types</h4>
+
+ <p>The mouse event module originates from the [<cite><a class="informative" href="#references-HTML40">HTML 4.01</a></cite>] <code>onclick</code>, <code>ondblclick</code>,
+ <code>onmousedown</code>, <code>onmouseup</code>, <code>onmouseover</code>, <code>onmousemove</code>, and <code>onmouseout</code> attributes. This event module
+ is specifically designed for use with pointing input devices, such as a mouse or a trackball.</p>
+
+ <div id="interface-MouseEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-MouseEvent">Interface MouseEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 2, modified in DOM Level 3</p>
+
+ <p>The <code>MouseEvent</code> interface provides specific contextual information associated with Mouse events.</p>
+
+ <p>In the case of nested elements, mouse events are always targeted at the most deeply nested element.</p>
+
+ <div class="note"><div class="note-title" id="h_note_42"><span>Note</span></div><p class=""><strong>Note:</strong> Ancestors of the targeted element can use event bubbling to obtain notifications of mouse events which occur within their descendent
+ elements.</p></div>
+
+ <p>To create an instance of the <code>MouseEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("MouseEvent")</code></a>
+ method call.</p>
+
+ <div class="note"><div class="note-title" id="h_note_43"><span>Note</span></div><p class=""><strong>Note:</strong> When initializing <code>MouseEvent</code> objects using <code>initMouseEvent</code>, implementations can use the client
+ coordinates <code>clientX</code> and <code>clientY</code> for calculation of other coordinates (such as target coordinates exposed by <a class="def" href="#glossary-DOM-Level-0">
+ DOM Level 0</a> implementations or other proprietary attributes, e.g., <code>pageX</code>).</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-MouseEvent">interface <span class="idlInterfaceID">MouseEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-screenX">screenX</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-screenY">screenY</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-clientX">clientX</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">long</span> <span class="idlAttrName"><a href="#widl-MouseEvent-clientY">clientY</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-ctrlKey">ctrlKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-altKey">altKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-MouseEvent-metaKey">metaKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MouseEvent-button">button</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MouseEvent-buttons">buttons</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlAttrName"><a href="#widl-MouseEvent-relatedTarget">relatedTarget</a></span>;</span>
+<span class="idlSectionComment"> // Introduced in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-MouseEvent-getModifierState-boolean-DOMString-keyArg">getModifierState</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="attributes-4">Attributes</h6><dl class="attributes"><dt id="widl-MouseEvent-altKey"><code>altKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Refer to the <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a> attribute.</p>
+ </dd><dt id="widl-MouseEvent-button"><code>button</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
+ <p>During mouse events caused by the depression or release of a mouse button, <code>button</code> <em class="rfc2119" title="MUST">MUST</em> be used to indicate which pointer device button changed state.</p>
+ <p>The value of the <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be as follows:</p>
+
+ <ul>
+ <li><code>0</code> <em class="rfc2119" title="MUST">MUST</em> indicate the primary button of the device (in general, the left button or the only button on single-button devices, used to activate a user
+ interface control or select text) or the un-initialized value.</li>
+ <li><code>1</code> <em class="rfc2119" title="MUST">MUST</em> indicate the auxiliary button (in general, the middle button, often combined with a mouse wheel).</li>
+ <li><code>2</code> <em class="rfc2119" title="MUST">MUST</em> indicate the secondary button (in general, the right button, often used to display a context menu).</li>
+ </ul>
+
+ <p>Some pointing devices provide or simulate more buttons, and values higher than <code>2</code> <em class="rfc2119" title="MAY">MAY</em> be used to represent such buttons.</p>
+
+ <div class="note"><div class="note-title" id="h_note_44"><span>Note</span></div><p class=""><strong>Note:</strong> The value of <code>button</code> is not updated for events not caused by the depression/release of a mouse button. In these
+ scenarios, take care not to interpret the value <code>0</code> as the left button, but rather as the <a class="def" href="#glossary-un-initialized-value">un-initialized
+ value</a></p></div>
+
+ <div class="note"><div class="note-title" id="h_note_45"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Some <a class="def" href="#glossary-default-action">default actions</a> related to events such as
+ <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> and <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> depend on the specific mouse button in use.</p></div>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-buttons"><code>buttons</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
+ <p>During any mouse events, <code>buttons</code> <em class="rfc2119" title="MUST">MUST</em> be used to indicate which combination of mouse buttons are
+ currently being pressed, expressed as a bitmask.</p>
+
+ <div class="note"><div class="note-title" id="h_note_46"><span>Note</span></div><p class=""><strong>Note:</strong> Though similarly named, the values for the <code>buttons</code> attribute and the <a href="#widl-MouseEvent-button"><code>button</code></a>
+ attribute are very different. The value of <code>button</code> is assumed to be valid during <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a>/
+ <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> event handlers, whereas the <code>buttons</code> attribute reflects the state of the mouse's buttons for any
+ trusted <code>MouseEvent</code> object (while it is being dispatched), because it can represent the "no button currently active" state (0).</p></div>
+
+ <p>The value of the <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be as follows:</p>
+
+ <ul>
+ <li><code>0</code> <em class="rfc2119" title="MUST">MUST</em> indicate no button is currently active.</li>
+ <li><code>1</code> <em class="rfc2119" title="MUST">MUST</em> indicate the primary button of the device (in general, the left button or the only button on single-button devices, used to activate a user
+ interface control or select text).</li>
+ <li><code>2</code> <em class="rfc2119" title="MUST">MUST</em> indicate the secondary button (in general, the right button, often used to display a context menu), if present.</li>
+ <li><code>4</code> <em class="rfc2119" title="MUST">MUST</em> indicate the auxiliary button (in general, the middle button, often combined with a mouse wheel).</li>
+ </ul>
+
+ <p>Some pointing devices provide or simulate more buttons. To represent such buttons, the value <em class="rfc2119" title="MUST">MUST</em> be doubled for each successive button (in the binary series <code>
+ 8</code>, <code>16</code>, <code>32</code>, ... ).</p>
+
+ <div class="note"><div class="note-title" id="h_note_47"><span>Note</span></div><p class="" id="buttons-mask"><strong>Note:</strong> Because the sum of any set of button values is a unique number, a content author can use a bitwise operation
+ to determine how many buttons are currently being pressed and which buttons they are, for an arbitrary number of mouse buttons on a device, e.g., the value <code>3</code>
+ indicates that the left and right button are currently both pressed, while the value <code>5</code> indicates that the left and middle button are currently both
+ pressed.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_48"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>Some <a class="def" href="#glossary-default-action">default actions</a> related to events such as
+ <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> and <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> depend on the specific mouse button in use.</p></div>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-clientX"><code>clientX</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
+ <p>The horizontal coordinate at which the event occurred relative to the viewport associated with the event.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-clientY"><code>clientY</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
+ <p>The vertical coordinate at which the event occurred relative to the viewport associated with the event.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-ctrlKey"><code>ctrlKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Refer to the <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a> attribute.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-MouseEvent-metaKey"><code>metaKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Refer to the <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a> attribute.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-MouseEvent-relatedTarget"><code>relatedTarget</code> of type <span class="idlAttrType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, readonly , nullable</dt><dd>
+ <p>Used to identify a secondary <a href="#widl-EventTarget"><code>EventTarget</code></a> related to a UI event, depending on the type of event.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd><dt id="widl-MouseEvent-screenX"><code>screenX</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
+ <p>The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-screenY"><code>screenY</code> of type <span class="idlAttrType">long</span>, readonly </dt><dd>
+ <p>The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-MouseEvent-shiftKey"><code>shiftKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p>Refer to the <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a> attribute.</p>
+ </dd></dl></div><div class="section"><h6 id="methods-4">Methods</h6><dl class="methods"><dt id="widl-MouseEvent-getModifierState"><code>getModifierState</code></dt><dd>
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>Queries the state of a modifier using a key value. See also <a href="#keys-Modifiers">Modifier keys</a>.</p>
+
+ <p>Returns <code>true</code> if it is a modifier key and the modifier is activated, <code>false</code> otherwise.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-KeyboardEvent-getModifierState"><code>KeyboardEvent.getModifierState()</code></a> method for a description of this parameter.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <p id="current-click-count">Implementations <em class="rfc2119" title="MUST">MUST</em> maintain the <em>current click count</em> when generating mouse events. This <em class="rfc2119" title="MUST">MUST</em> be a non-negative integer indicating
+ the number of consecutive clicks of a pointing device button within a specific time. The delay after which the count resets is specific to the
+ environment configuration.</p>
+
+ <div id="events-mouseevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-mouseevent-event-order">Mouse Event Order</h5>
+
+ <p>Certain mouse events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in a set order relative to one another.
+ The following shows the event sequence that <em class="rfc2119" title="MUST">MUST</em> occur when a pointing
+ device's cursor is moved over an element:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center">Element</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved into element A...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center">A</td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved out of element A...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <p>When a pointing device is moved into an element <em>A</em>, and then into a nested element <em>B</em>
+ and then back out again, the following sequence of events <em class="rfc2119" title="MUST">MUST</em> occur:
+ </p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center">Element</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved into element A...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center">A</td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved into nested element B...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center">B</td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved from element B into A...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">10.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">11.</td>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">12.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center">A</td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved out of element A...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">13.</td>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">14.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <p>Sometimes elements can be visually overlapped using CSS. In the following example, three elements
+ labeled A, B, and C all have the same dimensions and absolute position on a web page.
+ Element C is a child of B, and B is a child of A in the DOM:
+ </p>
+
+ <div class="figure" style="text-align: center" id="fig-graphical-representation-of-three-stacked-elements-all-on-top-of-each-other-with-the-pointing-device-moving-over-the-stack.x">
+ <img src="images/stacked-event-mouse-dispatch.png" alt="Graphical representation of three stacked elements all on top of each other. The bottom element is labeled A and the top element is C" title="Graphical representation of three stacked elements all on top of each other, with the pointing device moving over the stack." />
+ <div class="figcaption">Fig. <span class="figno">3</span> <span class="fig-title">Graphical representation of three stacked elements all on top of each other, with the pointing device moving over the stack.</span></div></div>
+
+ <p>When the pointing device is moved from outside the element stack to the element labeled C and then moved
+ out again, the following series of events <em class="rfc2119" title="MUST">MUST</em> occur:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center">Element</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved into element C, the topmost element in the stack</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></td>
+ <td class="cell-center">C</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></td>
+ <td class="cell-center">C</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td class="cell-center">C</td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="3"><em>Pointing device is moved out of element C...</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></td>
+ <td class="cell-center">C</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">C</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">B</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">10.</td>
+ <td><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></td>
+ <td class="cell-center">A</td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <div class="note"><div class="note-title" id="h_note_49"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>mouseover</code>/<code>mouseout</code> events are only fired once, while <code>mouseenter</code>/<code>mouseleave</code>
+ events are fired three times (once to each element).</p></div>
+
+ <p>The following is the typical sequence of events when a button associated with a pointing device (e.g., a mouse button or trackpad) is pressed and released over
+ an element:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></td>
+ <td><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>, multiple events, some limits</td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">10.</td>
+ <td><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <div class="note"><div class="note-title" id="h_note_50"><span>Note</span></div><p class=""><strong>Note: </strong>The lag time, degree, distance, and number of <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a>
+ events allowed between the <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup">
+ <code>mouseup</code></a> events while still firing a <a class="eventtype" href="#event-type-click"><code>click</code></a> or <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event will be implementation-, device-, and platform-specific. This tolerance can aid users that have physical
+ disabilities like unsteady hands when these users interact with a pointing device.</p></div>
+
+ <p>Each implementation will determine the appropriate hysteresis tolerance, but in general <em class="rfc2119" title="SHOULD">SHOULD</em> fire <a class="eventtype" href="#event-type-click"><code>click</code></a>
+ and <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> events when the event target of the associated <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events is the same element with no
+ <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> or <a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a>
+ events intervening, and <em class="rfc2119" title="SHOULD">SHOULD</em> fire <a class="eventtype" href="#event-type-click"><code>click</code></a> and <a class="eventtype" href="#event-type-dblclick">
+ <code>dblclick</code></a> events on the nearest common ancestor when the event targets of the associated <a class="eventtype" href="#event-type-mousedown">
+ <code>mousedown</code></a> and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events are different.</p>
+
+ <p>If the <a class="def" href="#glossary-event-target">event target</a> (e.g. the target element) is removed from the DOM during the mouse events sequence, the remaining
+ events of the sequence <em class="rfc2119" title="MUST NOT">MUST NOT</em> be fired on that element.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>If the target element is removed from the DOM as the result of a <a class="eventtype" href="#event-type-mousedown">
+ <code>mousedown</code></a> event, no events for that element will be dispatched for <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>,
+ <a class="eventtype" href="#event-type-click"><code>click</code></a>, or <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>, nor any default
+ activation events. However, the <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> event will still be dispatched on the element that is exposed
+ to the mouse after the removal of the initial target element. Similarly, if the target element is removed from the DOM during the dispatch of a <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> event, the <a class="eventtype" href="#event-type-click"><code>click</code></a> and subsequent events will
+ not be dispatched.</p>
+ </div>
+
+ </div>
+
+ <p>The Mouse event types are listed below. In the case of nested elements, mouse event types are always targeted at the most deeply nested element. Ancestors of the
+ targeted element <em class="rfc2119" title="MAY">MAY</em> use bubbling to obtain notification of mouse events which occur within its descendent elements.</p>
+
+
+<!-- click -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-click"><dfn id="dfn-click"><a class="eventtype" href="#event-type-click"><code>click</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>click</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Varies</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ indicates the <a href="#current-click-count">current click count</a>;
+ the attribute value <em class="rfc2119" title="MUST">MUST</em> be <code>1</code> when the user begins this action and increments by <code>1</code> for each click.</li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ value based on current button pressed</li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>The <a class="eventtype" href="#event-type-click"><code>click</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched on the
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a> indicated by the pointer, when
+ the user presses down and releases the primary pointer button,
+ or otherwise activates the pointer in a manner that simulates such an action.
+ The actuation method of the mouse button depends upon the pointer device and the environment configuration,
+ e.g., it <em class="rfc2119" title="MAY">MAY</em> depend on the screen location or the delay between the press and release of the pointing device button.
+ </p>
+
+ <div class="note"><div class="note-title" id="h_note_51"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>click</code> event should only be fired for the primary
+ pointer button (i.e., when <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> value is <code>0</code>,
+ <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> value is <code>1</code>).
+ Secondary buttons (like the middle or right button on a standard mouse) <em class="rfc2119" title="MUST NOT">MUST NOT</em> fire
+ <code>click</code> events.
+ </p></div>
+
+ <p>The <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> be preceded by the <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>
+ and <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> events on the same element, disregarding changes between other node types (e.g., text
+ nodes). Depending upon the environment configuration, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> be dispatched if one or
+ more of the event types <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>, <a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a>,
+ and <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> occur between the press and release of the pointing device button. The <a class="eventtype" href="#event-type-click"><code>click</code></a> event <em class="rfc2119" title="MAY">MAY</em> also be followed by the <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>
+ event.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>If a user mouses down on a text node child of a <code><p></code> element which has been styled with
+ a large line-height, shifts the mouse slightly such that it is no longer over an area containing text but is still within the containing block of that <code><p></code>
+ element (i.e., the pointer is between lines of the same text block, but not over the text node per se), then subsequently mouses up, this will likely still trigger
+ a <a class="eventtype" href="#event-type-click"><code>click</code></a> event (if it falls within the normal temporal hysteresis for a <a class="eventtype" href="#event-type-click">
+ <code>click</code></a>), since the user has stayed within the scope of the same element. Note that user-agent-generated mouse events are not dispatched on text nodes.
+ </p>
+ </div>
+
+ <p>In addition to being associated with pointer devices, the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched as
+ part of an element activation, as described in <a href="#event-flow-activation">Activation triggers and behavior</a>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_52"><span>Note</span></div><p class=""><strong>Note:</strong> For maximum accessibility, content authors are encouraged to use the
+ <a class="eventtype" href="#event-type-click"><code>click</code></a> event type when defining activation
+ behavior for custom controls, rather than other pointing-device event types such as
+ <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> or
+ <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, which are more device-specific.
+ Though the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type has its origins
+ in pointer devices (e.g., a mouse), subsequent implementation
+ enhancements have extended it beyond that association, and it can be considered a device-independent event
+ type for element activation.
+ </p></div>
+
+ <p>The <a class="def" href="#glossary-default-action">default action</a> of the
+ <a class="eventtype" href="#event-type-click"><code>click</code></a> event type varies
+ based on the <a class="def" href="#glossary-event-target">event target</a> of the event and the value of the
+ <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a>
+ or <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attributes.
+ Typical <a class="def" href="#glossary-default-action">default actions</a>
+ of the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type are as follows:
+ </p>
+
+ <ul>
+ <li>If the <a class="def" href="#glossary-event-target">event target</a> has associated activation behavior, the <a class="def" href="#glossary-default-action">default
+ action</a> <em class="rfc2119" title="MUST">MUST</em> be to execute that activation behavior (see <a href="#event-flow-activation">Activation triggers and behavior</a>).</li>
+
+ <li>If the <a class="def" href="#glossary-event-target">event target</a> is focusable, the <a class="def" href="#glossary-default-action">default action</a> <em class="rfc2119" title="MUST">MUST</em> be
+ to give that element document focus.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- dblclick -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-dblclick"><dfn id="dfn-dblclick"><a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>dblclick</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ indicates the <a href="#current-click-count">current click count</a></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ value based on current button pressed</li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the primary button
+ of a pointing device is clicked twice over an element. The definition of a double click depends on the environment
+ configuration, except that the event target <em class="rfc2119" title="MUST">MUST</em> be the same between
+ <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>,
+ <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, and
+ <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>.
+ This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type
+ <a class="eventtype" href="#event-type-click"><code>click</code></a>
+ if a click and double click occur simultaneously,
+ and after the event type <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> otherwise.
+ </p>
+
+ <div class="note"><div class="note-title" id="h_note_53"><span>Note</span></div><p class=""><strong>Note:</strong> As with the <code>click</code> event, the <code>dblclick</code> event
+ should only be fired for the primary pointer button.
+ Secondary buttons <em class="rfc2119" title="MUST NOT">MUST NOT</em> fire <code>dblclick</code> events.
+ </p></div>
+
+ <div class="note"><div class="note-title" id="h_note_54"><span>Note</span></div><p class=""><strong>Note:</strong> Canceling the
+ <a class="eventtype" href="#event-type-click"><code>click</code></a> event does not affect the firing
+ of a <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event.
+ </p></div>
+
+ <p>As with the <a class="eventtype" href="#event-type-click"><code>click</code></a> event type, the
+ <a class="def" href="#glossary-default-action">default action</a>
+ of the <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event type varies based on the
+ <a class="def" href="#glossary-event-target">event target</a> of the event and the value of the
+ <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a> or
+ <a href="#widl-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attributes.
+ Normally, the typical <a class="def" href="#glossary-default-action">default actions</a> of the
+ <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a> event type match those of the
+ <a class="eventtype" href="#event-type-click"><code>click</code></a> event type, with the following additional
+ behavior:
+ </p>
+
+ <ul>
+ <li>If the <a class="def" href="#glossary-event-target">event target</a> is selectable, the <a class="def" href="#glossary-default-action">default action</a> <em class="rfc2119" title="MUST">MUST</em>
+ be to select part or all of the selectable content. Subsequent clicks <em class="rfc2119" title="MAY">MAY</em> select additional selectable portions of that content.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mousedown -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mousedown"><dfn id="dfn-mousedown"><a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mousedown</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Varies: Start a drag/drop operation; start a text selection; start a scroll/pan interaction (in combination with the middle mouse button, if supported)</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ indicates the <a href="#current-click-count">current click count</a> incremented by one. For example, if no click happened
+ before the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a>, <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>
+ will contain the value <code>1</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ value based on current button pressed</li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device button is pressed over an element.</p>
+
+ <div class="note"><div class="note-title" id="h_note_55"><span>Note</span></div><p class=""><strong>Note: </strong>Many implementations use the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> event to begin a variety of contextually dependent <a class="def" href="#glossary-default-action">default actions</a>. These default actions can be prevented if this event is canceled. Some of these default actions could include: beginning
+ a drag/drop interaction with an image or link, starting text selection, etc. Additionally, some implementations provide a mouse-driven panning feature that is activated when
+ the middle mouse button is pressed at the time the <a class="eventtype internalDFN" href="#dfn-mousedown"><code>mousedown</code></a> event is dispatched.</p></div>
+
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mouseenter -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mouseenter"><dfn id="dfn-mouseenter"><a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mouseenter</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is exiting, if any.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved onto the boundaries of an element or one of
+ its descendent elements. This event type is similar to <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a>, but differs in that it does
+ not bubble, and <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched when the pointer device moves from an element onto the boundaries of one of its descendent elements.</p>
+
+ <div class="note"><div class="note-title" id="h_note_56"><span>Note</span></div><p class=""><strong>Note:</strong> There are similarities between this event type and the CSS <a href="http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes" title="Selectors"><code>:hover</code> pseudo-class</a> <a href="#references-CSS2">[CSS2.1]</a>. See also the <a class="eventtype" href="#event-type-mouseleave"><code>
+ mouseleave</code></a> event type.</p></div>
+
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mouseleave -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mouseleave"><dfn id="dfn-mouseleave"><a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mouseleave</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is entering, if any.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved off of the boundaries of an element and all
+ of its descendent elements. This event type is similar to <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a>, but differs in that does
+ not bubble, and that it <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched until the pointing device has left the boundaries of the element and the boundaries of all of its children.</p>
+
+ <div class="note"><div class="note-title" id="h_note_57"><span>Note</span></div><p class=""><strong>Note:</strong> There are similarities between this event type and the CSS <a href="http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes" title="Selectors"><code>:hover</code> pseudo-class</a> <a href="#references-CSS2">[CSS2.1]</a>. See also the <a class="eventtype" href="#event-type-mouseenter"><code>
+ mouseenter</code></a> event type.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mousemove -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mousemove"><dfn id="dfn-mousemove"><a class="eventtype" href="#event-type-mousemove"><code>mousemove</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mousemove</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved while it is over an element. The frequency
+ rate of events while the pointing device is moved is implementation-, device-, and platform-specific, but multiple consecutive <a class="eventtype" href="#event-type-mousemove">
+ <code>mousemove</code></a> events <em class="rfc2119" title="SHOULD">SHOULD</em> be fired for sustained pointer-device movement, rather than a single event for each instance of mouse movement. Implementations
+ are encouraged to determine the optimal frequency rate to balance responsiveness with performance.</p>
+
+ <div class="note"><div class="note-title" id="h_note_58"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>In some implementation environments, such as a browser, <a class="eventtype internalDFN" href="#dfn-mousemove"><code>mousemove</code></a> events can continue
+ to fire if the user began a drag operation (e.g., a mouse button is pressed) and the pointing device has left the boundary of the user agent.</p></div>
+
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mouseout -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mouseout"><dfn id="dfn-mouseout"><a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mouseout</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is entering, if any.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved off of the boundaries of an element. This
+ event type is similar to <a class="eventtype" href="#event-type-mouseleave"><code>mouseleave</code></a>, but differs in that does bubble, and that it <em class="rfc2119" title="MUST">MUST</em> be dispatched
+ when the pointer device moves from an element onto the boundaries of one of its descendent elements.</p>
+
+ <div class="note"><div class="note-title" id="h_note_59"><span>Note</span></div><p class=""><strong>Note:</strong> See also the <a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a> event type.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mouseover -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mouseover"><dfn id="dfn-mouseover"><a class="eventtype" href="#event-type-mouseover"><code>mouseover</code></a></dfn></dt>
+ <dd>
+ <table summary="This table contains information about the semantics of the given event type" border="0" cellpadding="2" cellspacing="0">
+ <tbody>
+ <tr>
+ <th>Type</th>
+ <td><strong><code>mouseover</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ indicates the <a class="def" href="#glossary-event-target">event target</a> a pointing device is exiting, if any.</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device is moved onto the boundaries of an element. This event
+ type is similar to <a class="eventtype" href="#event-type-mouseenter"><code>mouseenter</code></a>, but differs in that it bubbles, and that it <em class="rfc2119" title="MUST">MUST</em> be dispatched
+ when the pointer device moves onto the boundaries of an element whose ancestor element is the <a class="def" href="#glossary-event-target">event target</a> for
+ the same event listener instance.</p>
+
+ <div class="note"><div class="note-title" id="h_note_60"><span>Note</span></div><p class=""><strong>Note:</strong> See also the <a class="eventtype" href="#event-type-mouseout"><code>mouseout</code></a> event type.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- mouseup -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-mouseup"><dfn id="dfn-mouseup"><a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>mouseup</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MouseEvent"><code>MouseEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Invoke a context menu (in combination with the right mouse button, if supported)</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ indicates the <a href="#current-click-count">current click count</a> incremented by one.</li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ value based on the pointer position on the screen</li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ value based on the pointer position within the viewport</li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ value based on current button pressed</li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a pointing device button is released over an element.</p>
+
+ <div class="note"><div class="note-title" id="h_note_61"><span>Note</span></div><p class=""><strong>Note: </strong>Many implementations will invoke a context menu as the default action of this event if the right mouse button is being released.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_62"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>In some implementation environments, such as a browser, a <a class="eventtype internalDFN" href="#dfn-mouseup"><code>mouseup</code></a> event
+ can be dispatched even if the pointing device has left the boundary of the user agent, e.g., if the user began a drag operation with a mouse button pressed).</p></div>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <div id="events-wheelevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-wheelevents"><span class="secno">5.2.4 </span>Wheel Event Types</h4>
+ <p>Wheels are devices that can be rotated in one or more spatial dimensions, and which can be associated with a pointer device. The coordinate system depends on the
+ environment configuration.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The user's environment might be configured to associate vertical scrolling with rotation along the y-axis, horizontal
+ scrolling with rotation along the x-axis, and zooming with rotation along the z-axis.</p>
+ </div>
+
+ <p>The deltaX, deltaY, and deltaZ attributes of <a href="#interface-WheelEvent"><code>WheelEvent</code></a> objects indicate a measurement along their respective axes
+ in units of pixels, lines, or pages. The reported measurements are provided after an environment-specific algorithm translates the actual rotation/movement of
+ the wheel device into the appropriate values and units.</p>
+
+ <div class="note"><div class="note-title" id="h_note_63"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> A user's environment settings can be customized to interpret actual rotation/movement of a wheel device in different ways.
+ One movement of a common <q>dented</q> mouse wheel can produce a measurement of 162 pixels (162 is just an example value, actual values can depend on the current screen
+ dimensions of the user-agent). But a user can change their default environment settings to speed-up their mouse wheel, increasing this number. Furthermore, some
+ mouse wheel software can support acceleration (the faster the wheel is rotated/moved, the greater the delta of each measurement) or even sub-pixel rotation measurements.
+ Because of this, authors can not assume a given rotation amount in one user agent will produce the same delta value in all user agents.</p></div>
+
+ <p>The sign (positive or negative) of the values of the deltaX, deltaY, and deltaZ attributes <em class="rfc2119" title="MUST">MUST</em> be consistent between multiple dispatches of the
+ <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event while the motion of the actual wheel device is rotating/moving in the same direction. If a user agent scrolls as the
+ default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event then the sign of the delta <em class="rfc2119" title="SHOULD">SHOULD</em> be given by a right-hand coordinate system where positive X,
+ Y, and Z axes are directed towards the right-most edge, bottom-most edge, and farthest depth (away from the user) of the document, respectively.</p>
+
+ <div class="note"><div class="note-title" id="h_note_64"><span>Note</span></div><p class=""><strong>Note:</strong> Individual user agents can (depending on their environment and hardware configuration) interpret the same physical user interaction
+ on the wheel differently. For example, a vertical swipe on the edge of a trackpad from top to bottom can be interpreted as a wheel action intended to either scroll the
+ page down or to pan the page up (i.e., resulting in either a positive or negative deltaY value respectively).</p></div>
+
+ <div id="interface-WheelEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-WheelEvent">Interface WheelEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The <code>WheelEvent</code> interface provides specific contextual information associated with <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> events.</p>
+
+ <p>To create an instance of the <code>WheelEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("WheelEvent")</code></a>
+ method call.</p>
+
+ <div class="note"><div class="note-title" id="h_note_65"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
+ WheelEvent objects.</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-WheelEvent">interface <span class="idlInterfaceID">WheelEvent</span> : <span class="idlSuperclass"><a href="#idl-def-MouseEvent" class="idlType"><code>MouseEvent</code></a></span> {
+<span class="idlSectionComment"> // DeltaModeCode</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_PIXEL">DOM_DELTA_PIXEL</a></span> = <span class="idlConstValue">0x00</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_LINE">DOM_DELTA_LINE</a></span> = <span class="idlConstValue">0x01</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_DELTA_PAGE">DOM_DELTA_PAGE</a></span> = <span class="idlConstValue">0x02</span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaX">deltaX</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaY">deltaY</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaZ">deltaZ</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-WheelEvent-deltaMode">deltaMode</a></span>;</span>
+};</span></pre><div class="section"><h6 id="attributes-5">Attributes</h6><dl class="attributes"><dt id="widl-WheelEvent-deltaMode"><code>deltaMode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
+ <p>The <code>deltaMode</code> attribute contains an indication of the units of measurement for the <a href="#glossary-delta"><code>delta</code></a> values.
+ The default value is <a href="#widl-WheelEvent-DOM_DELTA_PIXEL"><code class="constant-name">DOM_DELTA_PIXEL</code></a> (pixels).</p>
+
+ <p>This attribute <em class="rfc2119" title="MUST">MUST</em> be set to one of the DOM_DELTA constants to indicate the units of measurement for the <a href="#glossary-delta"><code>delta</code></a> values. The precise measurement
+ is specific to device, operating system, and application configurations.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-WheelEvent-deltaX"><code>deltaX</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
+ <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
+ the x-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
+ measurement (in pixels, lines, or pages) of the movement of a wheel device around the x-axis.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-WheelEvent-deltaY"><code>deltaY</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
+ <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
+ the y-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
+ measurement (in pixels, lines, or pages) of the movement of a wheel device around the y-axis.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-WheelEvent-deltaZ"><code>deltaZ</code> of type <span class="idlAttrType">double</span>, readonly </dt><dd>
+ <p>In user agents where the default action of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event is to scroll, the value <em class="rfc2119" title="MUST">MUST</em> be the measurement along
+ the z-axis (in pixels, lines, or pages) to be scrolled in the case where the event is not cancelled. Otherwise, this is an implementation-specific
+ measurement (in pixels, lines, or pages) of the movement of a wheel device around the z-axis.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd></dl></div><div class="section"><h6 id="constants-1">Constants</h6><dl class="constants"><dt id="widl-WheelEvent-DOM_DELTA_LINE"><code>DOM_DELTA_LINE</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be individual lines of text. This is the case for many form controls.</p>
+ </dd><dt id="widl-WheelEvent-DOM_DELTA_PAGE"><code>DOM_DELTA_PAGE</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be pages, either defined as a single screen or as a demarcated page.</p>
+ </dd><dt id="widl-WheelEvent-DOM_DELTA_PIXEL"><code>DOM_DELTA_PIXEL</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The units of measurement for the <a href="#glossary-delta"><code>delta</code></a> <em class="rfc2119" title="MUST">MUST</em> be pixels. This is the most typical case in most operating system and implementation
+ configurations.</p>
+ </dd></dl></div>
+ </div>
+
+ <p>The Wheel event types are listed below.</p>
+
+
+<!-- wheel -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-wheel"><dfn id="dfn-wheel"><a class="eventtype" href="#event-type-wheel"><code>wheel</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>wheel</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-WheelEvent"><code>WheelEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Async</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Scroll (or zoom) the document</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-topmost-event-target">topmost event target</a></li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenX"><code class="attribute-name">MouseEvent.screenX</code></a>:
+ if the wheel is associated with a pointing device, the value based on the pointer position on the screen, otherwise <code>0</code></li>
+ <li><a href="#widl-MouseEvent-screenY"><code class="attribute-name">MouseEvent.screenY</code></a>:
+ if the wheel is associated with a pointing device, the value based
+ on the pointer position on the screen, otherwise <code>0</code></li>
+ <li><a href="#widl-MouseEvent-clientX"><code class="attribute-name">MouseEvent.clientX</code></a>:
+ if the wheel is associated with a pointing device, the value based
+ on the pointer position within the viewport, otherwise <code>0</code></li>
+ <li><a href="#widl-MouseEvent-clientY"><code class="attribute-name">MouseEvent.clientY </code></a>:
+ if the wheel is associated with a pointing device, the value
+ based on the pointer position within the viewport, otherwise <code>0</code></li>
+ <li><a href="#widl-MouseEvent-altKey"><code class="attribute-name">MouseEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a>
+ modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-ctrlKey"><code class="attribute-name">MouseEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-shiftKey"><code class="attribute-name">MouseEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-metaKey"><code class="attribute-name">MouseEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-MouseEvent-button"><code class="attribute-name">MouseEvent.button</code></a>:
+ if wheel is associated with a pointing device, value based on current button pressed, otherwise <code>0</code></li>
+ <li><a href="#widl-MouseEvent-buttons"><code class="attribute-name">MouseEvent.buttons</code></a>:
+ if wheel is associated with a pointing device, value based on all buttons current depressed, <code>0</code> if no buttons pressed</li>
+ <li><a href="#widl-MouseEvent-relatedTarget"><code class="attribute-name">MouseEvent.relatedTarget</code></a>:
+ indicates the <a class="def" href="#glossary-event-target">event target</a> the pointing device is pointing at, if any.</li>
+ <li><a href="#widl-WheelEvent-deltaX"><code class="attribute-name">WheelEvent.deltaX</code></a>:
+ expected amount that the page will scroll along the x-axis according
+ to the deltaMode units; or an implemenation-specific value of movement of a wheel around the x-axis</li>
+ <li><a href="#widl-WheelEvent-deltaY"><code class="attribute-name">WheelEvent.deltaY</code></a>:
+ expected amount that the page will scroll along the y-axis according
+ to the deltaMode units; or an implemenation-specific value of movement of a wheel around the y-axis</li>
+ <li><a href="#widl-WheelEvent-deltaZ"><code class="attribute-name">WheelEvent.deltaZ</code></a>:
+ expected amount that the page will scroll along the z-axis according
+ to the deltaMode units; or an implemenation-specific value of movement of a wheel around the z-axis</li>
+ <li><a href="#widl-WheelEvent-deltaMode"><code class="attribute-name">WheelEvent.deltaMode</code></a>:
+ unit indicator (pixels, lines, or pages) for the deltaX, deltaY, and deltaZ attributes</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a mouse wheel has been rotated around any axis, or when an equivalent
+ input device (such as a mouse-ball, certain tablets or touchpads, etc.) has emulated such an action. Depending on the platform and input device, diagonal wheel
+ deltas <em class="rfc2119" title="MAY">MAY</em> be delivered either as a single <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event with multiple non-zero axes or as separate <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a>
+ events for each non-zero axis.</p>
+
+ <p>The typical <a class="def" href="#glossary-default-action">default action</a> of the <a class="eventtype" href="#event-type-wheel"><code>wheel</code></a> event
+ type is to scroll (or in some cases, zoom) the document by the indicated amount. If this event is canceled, the implementation <em class="rfc2119" title="MUST NOT">MUST NOT</em> scroll or zoom the document
+ (or perform whatever other implementation-specific default action is associated with this event type).</p>
+
+ <div class="note"><div class="note-title" id="h_note_66"><span>Note</span></div><p class=""><strong>Note:</strong> In some <a class="def" href="#glossary-user-agent">user agents</a>, or with some input devices, the speed that the wheel has been
+ turned can affect the <a href="#glossary-delta"><code>delta</code></a> values, with a faster speed producing a higher <a href="#glossary-delta"><code>delta</code></a> value.</p></div>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <div id="events-inputevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-inputevents"><span class="secno">5.2.5 </span>Input Event Types</h4>
+ <p>Input events are sent as notifications whenever the DOM is being updated.</p>
+
+ <div id="interface-InputEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-InputEvent">Interface InputEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-InputEvent">interface <span class="idlInterfaceID">InputEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-InputEvent-data">data</a></span>;</span>
+};</span></pre><div class="section"><h6 id="attributes-6">Attributes</h6><dl class="attributes"><dt id="widl-InputEvent-data"><code>data</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p><code>data</code> holds the value of the characters generated by an input method. This <em class="rfc2119" title="MAY">MAY</em> be a single Unicode character or a non-empty sequence of Unicode characters
+ [<cite><a class="normative" href="#references-Unicode">Unicode</a></cite>]. Characters <em class="rfc2119" title="SHOULD">SHOULD</em> be normalized as defined by the Unicode normalization form <em>NFC</em>,
+ defined in [<cite><a class="normative" href="#references-UnicodeNormalization">UAX #15</a></cite>]. This attribute <em class="rfc2119" title="MAY">MAY</em> be null or contain the <a class="def" href="#glossary-empty-string">
+ empty string</a>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd></dl></div>
+ </div>
+
+ <div id="events-inputevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4input event="" order<="" h4="">
+
+ <p>The input events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in a set order relative to one another.
+ </p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>DOM element is updated</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ </h4input></div>
+
+ <p>The Input event types are listed below.</p>
+
+
+<!-- beforeinput -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-beforeinput"><dfn id="dfn-beforeinput"><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>beforeinput</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code> or any <code>Element</code> with <code>contentEditable<=true</code>
+ or with <code>inputmode</code> set.</td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Update the DOM element</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> that is about to be updated</li>
+ <li><a href="#widl-InputEvent-data"><code class="attribute-name">InputEvent.data</code></a>:
+ the string containing the data that will be added to the element,
+ which <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when the DOM is about to be updated.</p>
+ </dd>
+ </dl>
+ </div>
+<!-- beforeinput -->
+
+
+
+<!-- input -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-input"><dfn id="dfn-input"><a class="eventtype" href="#event-type-input"><code>input</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>input</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-InputEvent"><code>InputEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>HTMLInputElement</code>, <code>HTMLTextAreaElement</code> or any <code>Element</code> with <code>contentEditable<=true</code>
+ or with <code>inputmode</code> set.</td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> that was just updated</li>
+ <li><a href="#widl-InputEvent-data"><code class="attribute-name">InputEvent.data</code></a>:
+ the string containing the data that was added to the element,
+ which <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event immediately after the DOM has been updated.</p>
+ </dd>
+ </dl>
+ </div>
+<!-- input -->
+
+
+ </div>
+
+ <div id="events-keyboardevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-keyboardevents"><span class="secno">5.2.6 </span>Keyboard Event Types</h4>
+
+ <p>Keyboard events are device dependent, i.e., they rely on the capabilities of the input devices and how they are mapped in the operating systems. Refer to <a href="#keys">
+ Keyboard events and key values</a> for more details, including examples on how Keyboard Events are used in combination with Composition Events. Depending on the
+ character generation device, keyboard events might not be generated.</p>
+
+ <div class="note"><div class="note-title" id="h_note_67"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Keyboard events are only one modality of providing textual input. For editing scenarios, consider also using the "input" event
+ defined in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] as an alternate to (or in addition to) keyboard events.</p></div>
+
+ <div id="interface-KeyboardEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-KeyboardEvent">Interface KeyboardEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface provides specific contextual information associated with keyboard devices. Each keyboard event references a key using a
+ value. Keyboard events are commonly directed at the element that has the focus.</p>
+
+ <p>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface provides convenient attributes for some common modifiers keys: <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a>,
+ <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a>, <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a>,
+ <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a>. These attributes are equivalent to using the method <a href="#widl-KeyboardEvent-getModifierState">
+ <code>KeyboardEvent.getModifierState(keyArg)</code></a> with <code class="key">'Control'</code>, <code class="key">'Shift'</code>, <code class="key">'Alt'</code>,
+ or <code class="key">'Meta'</code> respectively.</p>
+
+ <p>To create an instance of the <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("KeyboardEvent")</code></a>
+ method call.</p>
+
+ <div class="note"><div class="note-title" id="h_note_68"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> objects.</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent">interface <span class="idlInterfaceID">KeyboardEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
+<span class="idlSectionComment"> // KeyLocationCode</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_STANDARD">DOM_KEY_LOCATION_STANDARD</a></span> = <span class="idlConstValue">0x00</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_LEFT">DOM_KEY_LOCATION_LEFT</a></span> = <span class="idlConstValue">0x01</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_RIGHT">DOM_KEY_LOCATION_RIGHT</a></span> = <span class="idlConstValue">0x02</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned long</span> <span class="idlConstName"><a href="#DOM_KEY_LOCATION_NUMPAD">DOM_KEY_LOCATION_NUMPAD</a></span> = <span class="idlConstValue">0x03</span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-key">key</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-location">location</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-ctrlKey">ctrlKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-shiftKey">shiftKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-altKey">altKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-metaKey">metaKey</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-repeat">repeat</a></span>;</span>
+<span class="idlMethod"> <span class="idlMethType">boolean</span> <span class="idlMethName"><a href="#widl-KeyboardEvent-getModifierState-boolean-DOMString-keyArg">getModifierState</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="attributes-7">Attributes</h6><dl class="attributes"><dt id="widl-KeyboardEvent-altKey"><code>altKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p><code>true</code> if the <a href="#key-Alt"><code class="key">'Alt'</code></a> (alternative) or <code>Option</code> key modifier was active.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-ctrlKey"><code>ctrlKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p><code>true</code> if the <a href="#key-Control"><code class="key">'Control'</code></a> (control) key modifier was active.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-key"><code>key</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p><code>key</code> holds the key value of the key pressed.
+ If the value is has a printed representation, it <em class="rfc2119" title="MUST">MUST</em> be a non-empty Unicode character
+ string, conforming to the <a href="#key-algorithm">algorithm for determining the key value</a> defined in this specification.
+ If the value is a control key which has no printed representation, it <em class="rfc2119" title="MUST">MUST</em> be one of the key values defined in the
+ <a href="#keys-keyvalues">key values set</a>, as determined by the <a href="#key-algorithm">algorithm for determining the key value</a>. Implementations that are
+ unable to identify a key <em class="rfc2119" title="MUST">MUST</em> use the key value <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_69"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>key</code> attribute is not related to the legacy <code>keyCode</code> attribute and does not have the same set of values.</p></div>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd><dt id="widl-KeyboardEvent-location"><code>location</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
+ <p>The <code>location</code> attribute contains an indication of the location of the key on the device.</p>
+
+ <p>This attribute <em class="rfc2119" title="MUST">MUST</em> be set to one of the DOM_KEY_LOCATION constants to indicate the location of a key on the device. In case a DOM implementation wishes to provide a new location value, a
+ value different from the defined constant values <em class="rfc2119" title="MUST">MUST</em> be used.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-metaKey"><code>metaKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p><code>true</code> if the meta (Meta) key modifier was active.</p>
+
+ <div class="note"><div class="note-title" id="h_note_70"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>'Command'</code> key modifier on Macintosh systems is represented using this key modifier.</p></div>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-repeat"><code>repeat</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p><code>true</code> if the key has been pressed in a sustained manner. Holding down a key <em class="rfc2119" title="MUST">MUST</em> result in the repeating the events
+ <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
+ <a class="eventtype" href="#event-type-input"><code>input</code></a>
+ in this order, at a rate determined by the system configuration. For mobile devices which have <em>long-key-press</em>
+ behavior, the first key event with a <a href="#widl-KeyboardEvent-repeat">repeat</a> attribute value of <code>'true'</code> <em class="rfc2119" title="MUST">MUST</em> serve as an
+ indication of a <em>long-key-press</em>. The length of time that the key <em class="rfc2119" title="MUST">MUST</em> be pressed in order to begin repeating is configuration-dependent.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-shiftKey"><code>shiftKey</code> of type <span class="idlAttrType">boolean</span>, readonly </dt><dd>
+ <p><code>true</code> if the shift (Shift) key modifier was active.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>false</code>.</p>
+ </dd></dl></div><div class="section"><h6 id="methods-5">Methods</h6><dl class="methods"><dt id="widl-KeyboardEvent-getModifierState"><code>getModifierState</code></dt><dd>
+ <p>Queries the state of a modifier using a key value. See also <a href="#keys-Modifiers">Modifier keys</a>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>A modifier key value. Modifier keys defined in this specification are
+ <a href="#key-Alt"><code class="key">'Alt'</code></a>
+ <a href="#key-AltGraph"><code class="key">'AltGraph'</code></a>
+ <a href="#key-CapsLock"><code class="key">'CapsLock'</code></a>
+ <a href="#key-Control"><code class="key">'Control'</code></a>
+ <a href="#key-Fn"><code class="key">'Fn'</code></a>
+ <a href="#key-Meta"><code class="key">'Meta'</code></a>
+ <a href="#key-NumLock"><code class="key">'NumLock'</code></a>
+ <a href="#key-ScrollLock"><code class="key">'ScrollLock'</code></a>
+ <a href="#key-Shift"><code class="key">'Shift'</code></a>
+ <a href="#key-SymbolLock"><code class="key">'SymbolLock'</code></a>, and
+ <a href="#key-OS"><code class="key">'OS'</code></a>
+ User agents <em class="rfc2119" title="MAY">MAY</em> support additional implementation-specific modifier keys depending on the environment.</p>
+
+ <p>Returns <code>true</code> if it is a modifier key and the modifier is activated, <code>false</code> otherwise.</p>
+
+ <div class="note"><div class="note-title" id="h_note_71"><span>Note</span></div><p class=""><strong>Note:</strong> If an application wishes to distinguish between right and left modifiers, this information could be
+ deduced using keyboard events and <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>.</p></div>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div><div class="section"><h6 id="constants-2">Constants</h6><dl class="constants"><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_LEFT"><code>DOM_KEY_LOCATION_LEFT</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The key activated originated from the left key location (when there is more than one possible location for this key).</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The left <code class="key">'Control'</code> key on a PC 101 Key US keyboard.</p>
+ </div>
+ </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_NUMPAD"><code>DOM_KEY_LOCATION_NUMPAD</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad
+ (when there is more than one possible location for this key).
+ Note that the <code class="key">'NumLock'</code>key should always be encoded with a location of
+ <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code class="constant-name">DOM_KEY_LOCATION_STANDARD</code></a>.
+ </p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The <code class="key">'1'</code> key on a PC 101 Key US keyboard located on the numeric pad.</p>
+ </div>
+ </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_RIGHT"><code>DOM_KEY_LOCATION_RIGHT</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The key activation originated from the right key location (when there is more than one possible location for this key).</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The right <code class="key">'Shift'</code> key on a PC 101 Key US keyboard.</p>
+ </div>
+ </dd><dt id="widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code>DOM_KEY_LOCATION_STANDARD</code> of type <span class="idlConstType">unsigned long</span></dt><dd>
+ <p>The key activation <em class="rfc2119" title="MUST NOT">MUST NOT</em> be distinguished as the left or right version of the key, and (other than the <code class="key">'NumLock'</code>key)
+ did not originate from the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
+ </p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The <code class="key">'Q'</code> key on a PC 101 Key US keyboard.</p>
+ <p>The <code class="key">'NumLock'</code> key on a PC 101 Key US keyboard.</p>
+ <p>The <code class="key">'1'</code> key on a PC 101 Key US keyboard located in the main section of the keyboard.</p>
+ </div>
+ </dd></dl></div>
+ </div>
+
+ <div class="warning">
+ <p><strong>Warning!</strong></p>
+ <p>Legacy keyboard event implementations include three additional attributes, <code>keyCode</code>, <code>charCode</code>, and
+ <code>which</code>. The <code>keyCode</code> attribute indicates a numeric value associated with a particular key on a computer keyboard,
+ while the <code>charCode</code> attribute indicates the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> value of the character
+ associated with that key (which might be the same as the <code>keyCode</code> value) and is applicable only to keys that produce a
+ <a class="def" href="#glossary-character-value">character value</a>.
+ </p>
+ <p>In practice, <code>keyCode</code> and <code>charCode</code> are inconsistent across platforms
+ and even the same implementation on different operating systems or using different localizations.
+ DOM Level 3 Events does not define values for either
+ <code>keyCode</code> or <code>charCode</code>, or behavior for <code>charCode</code>.
+ In conforming DOM Level 3 Events implementations, content authors can instead use <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>.
+ </p>
+ <p><em>For more information, see the informative appendix on <a href="#legacy-key-attributes">Legacy key attributes</a>.</em>
+ </p>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_72"><span>Note</span></div><p class=""><strong>Note:</strong> For compatibility with existing content, virtual keyboards, such as software keyboards on screen-based
+ input devices, are expected to produce the normal range of keyboard events, even though they do not possess physical keys.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_73"><span>Note</span></div><p class=""><strong>Note:</strong> In some implementations or system configurations, some key events, or their values, might be suppressed
+ by the <a class="def" href="#glossary-ime">IME</a> in use.</p></div>
+
+ <div id="events-keyboard-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-keyboard-event-order">Keyboard Event Order</h5>
+ <p>The keyboard events defined in this specification occur in a set order relative to one another, for any given key:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td><em>(only for keys which produce a <a class="def" href="#glossary-character-value">character value</a>)</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
+ character in to the DOM.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td><em>(only for keys which have updated the DOM)</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Any events as a result of the key being held for a sustained period (see below).</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <p>If the key is depressed for a sustained period, the following events <em class="rfc2119" title="MAY">MAY</em> repeat at an environment-dependent rate:
+<!-- and the key should seek counseling -->
+
+ </p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td><em>(with <a href="#widl-KeyboardEvent-repeat">repeat</a> attribute set to <code> true</code>)</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td><em>(only for keys which produce a <a class="def" href="#glossary-character-value">character value</a>)</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
+ character in to the DOM.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td><em>(only for keys which have updated the DOM)</em></td>
+ </tr>
+ </tbody></table>
+
+ <div class="note"><div class="note-title" id="h_note_74"><span>Note</span></div><p class=""><strong>Note:</strong> Typically, any <a class="def" href="#glossary-default-action">default actions</a> associated with any particular
+ key are completed before the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event is dispatched. This might delay the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event slightly (though this is not likely to be a perceptible delay).</p></div>
+
+ <p>The <a class="def" href="#glossary-event-target">event target</a> of a key event is the currently focused element which is processing the keyboard activity. This
+ is often an HTML <code>input</code> element or a textual element which is editable, but <em class="rfc2119" title="MAY">MAY</em> be an element defined by the <a class="def" href="#glossary-host-language">
+ host language</a> to accept keyboard input for non-text purposes, such as the activation of a hotkey or trigger of some other behavior. If no suitable element
+ is in focus, the event target will be the root element.</p>
+
+ <div class="note"><div class="note-title" id="h_note_75"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="def" href="#glossary-event-target">event target</a> might change between different key events.
+ For example, a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event for the <a href="#key-Tab"><code class="key">'Tab'</code></a> key
+ will likely have a different <a class="def" href="#glossary-event-target">event target</a> than the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>
+ event on the same keystroke.</p></div>
+ </div>
+
+ <p>The keyboard event types are listed below.</p>
+
+
+<!-- keydown -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-keydown"><dfn id="dfn-keydown"><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>keydown</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Varies:
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and <a class="eventtype" href="#event-type-input"><code>input</code></a> events;
+ launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
+ <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
+ <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event;
+ <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
+ other event</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the key event, root element if no suitable input element focused</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
+ the key value of the key pressed.</li>
+ <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
+ the location of the key on the device.</li>
+ <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
+ <code>true</code> if a key has been depressed long enough to trigger key repetition, otherwise <code>false</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a key is pressed down. The <a class="eventtype" href="#event-type-keydown">
+ <code>keydown</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This
+ event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>.
+ This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched before the
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
+ <a class="eventtype" href="#event-type-input"><code>input</code></a>,
+ and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a>
+ events associated with the same key.</p>
+
+ <p>The default action of the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event depends upon the key:</p>
+
+ <ul>
+ <li>If the key is associated with a character, the default action <em class="rfc2119" title="MUST">MUST</em> be to dispatch
+ a <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> event
+ followed by an <a class="eventtype" href="#event-type-input"><code>input</code></a>
+ event.
+ In the case where the key which is associated with multiple characters (such as with a macro or certain sequences of dead keys), the default action <em class="rfc2119" title="MUST">MUST</em>
+ be to dispatch one set of
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> /
+ <a class="eventtype" href="#event-type-input"><code>input</code></a>
+ events for each character</li>
+
+ <li>If the key is associated with a <a class="def" href="#glossary-text-composition-system">text composition system</a>, the default action <em class="rfc2119" title="MUST">MUST</em> be to launch that
+ system</li>
+
+ <li>If the key is the <a href="#key-Tab"><code class="key">'Tab'</code></a> key, the default action <em class="rfc2119" title="MUST">MUST</em> be to shift the document focus from the currently focused
+ element (if any) to the new focused element, as described in <a href="#events-focusevent">Focus Event Types</a></li>
+
+ <li>If the key is the <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key and the
+ current focus is on a state-changing element, the default action <em class="rfc2119" title="MUST">MUST</em> be to dispatch a <a class="eventtype" href="#event-type-click"><code>click</code></a> event,
+ and a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event if that event type is supported by the <a class="def" href="#glossary-user-agent">
+ user agent</a> (refer to <a href="#event-flow-activation">activation triggers and behavior</a> for more details)</li>
+ </ul>
+
+ <p>If this event is canceled, the associated event types <em class="rfc2119" title="MUST NOT">MUST NOT</em> be dispatched, and the associated actions <em class="rfc2119" title="MUST NOT">MUST NOT</em> be performed.</p>
+
+ <div class="note"><div class="note-title" id="h_note_76"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup">
+ <code>keyup</code></a> events are traditionally associated with detecting any key, not just those which produce a <a class="def" href="#glossary-character-value">character
+ value</a>.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- keyup -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-keyup"><dfn id="dfn-keyup"><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>keyup</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the key event, root element if no suitable input element focused</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
+ the key value of the key pressed.</li>
+ <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
+ the location of the key on the device.</li>
+ <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
+ <code>false</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a key is released.
+ The <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event type is device dependent and relies on the
+ capabilities of the input devices and how they are mapped in the operating system.
+ This event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>.
+ This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
+ <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>,
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>,
+ and <a class="eventtype" href="#event-type-input"><code>input</code></a>
+ events associated with the same key.</p>
+
+ <div class="note"><div class="note-title" id="h_note_77"><span>Note</span></div><p class=""><strong>Note:</strong> the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup">
+ <code>keyup</code></a> events are traditionally associated with detecting any key, not just those which produce a <a class="def" href="#glossary-character-value">character
+ value</a>.</p></div>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <div id="events-compositionevents" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_events-compositionevents"><span class="secno">5.2.7 </span>Composition Event Types</h4>
+
+ <p>Composition Events provide a means for inputing text in a supplementary or alternate manner than by Keyboard Events, in order to allow the use of characters that
+ might not be commonly available on keyboard. For example, Composition Events might be used to add accents to characters despite their absence from standard US keyboards,
+ to build up logograms of many Asian languages from their base components or categories, to select word choices from a combination of key presses on a mobile device
+ keyboard, or to convert voice commands into text using a speech recognition processor. Refer to <a href="#keys">Keyboard events and key values</a> for examples
+ on how Composition Events are used in combination with keyboard events.</p>
+
+ <p>Conceptually, a composition session consists of one <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> event, one or more
+ <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a> events, and one <a class="eventtype" href="#event-type-compositionend">
+ <code>compositionend</code></a> event, with the value of the <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute persisting between each <q>stage</q>
+ of this event chain during each session.</p>
+
+ <div class="note"><div class="note-title" id="h_note_78"><span>Note</span></div><p class=""><strong>Note:</strong> While a composition session is active, keyboard events can be dispatched to the DOM if the keyboard is the input device used
+ with the composition session. See the <a href="#event-type-compositionstart"><code>compositionstart</code> event details</a> and <a href="#keys-IME">IME section</a>
+ for relevent event ordering.</p></div>
+
+ <p>Not all <a class="def" href="#glossary-ime">IME</a> systems or devices expose the necessary data to the DOM, so the active composition string (the <q>Reading Window</q>
+ or <q>candidate selection menu option</q>) might not be available through this interface, in which case the selection <em class="rfc2119" title="MAY">MAY</em> be represented by the <a class="def" href="#glossary-empty-string">
+ empty string</a>.</p>
+
+ <div id="interface-CompositionEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-CompositionEvent">Interface CompositionEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The <code>CompositionEvent</code> interface provides specific contextual information associated with Composition Events.</p>
+
+ <p>To create an instance of the <code>CompositionEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("CompositionEvent")</code></a>
+ method call.</p>
+
+ <div class="note"><div class="note-title" id="h_note_79"><span>Note</span></div><p class=""><strong>Authoring Note: </strong>See [<a href="#references-UIEvents">UI Events</a>] for information about programmatically initializing
+ <code>CompositionEvent</code> objects.</p></div>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-CompositionEvent">interface <span class="idlInterfaceID">CompositionEvent</span> : <span class="idlSuperclass"><a href="#idl-def-UIEvent" class="idlType"><code>UIEvent</code></a></span> {
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString?</span> <span class="idlAttrName"><a href="#widl-CompositionEvent-data">data</a></span>;</span>
+};</span></pre><div class="section"><h6 id="attributes-8">Attributes</h6><dl class="attributes"><dt id="widl-CompositionEvent-data"><code>data</code> of type <span class="idlAttrType">DOMString</span>, readonly , nullable</dt><dd>
+ <p><code>data</code> holds the value of the characters generated by an input method. This <em class="rfc2119" title="MAY">MAY</em> be a single Unicode character or a non-empty sequence of Unicode characters
+ [<cite><a class="normative" href="#references-Unicode">Unicode</a></cite>]. Characters <em class="rfc2119" title="SHOULD">SHOULD</em> be normalized as defined by the Unicode normalization form <em>NFC</em>,
+ defined in [<cite><a class="normative" href="#references-UnicodeNormalization">UAX #15</a></cite>]. This attribute <em class="rfc2119" title="MAY">MAY</em> be null or contain the <a class="def" href="#glossary-empty-string">
+ empty string</a>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd></dl></div>
+ </div>
+
+ <div id="events-composition-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-composition-event-order">Composition Event Order</h5>
+
+ <p>The Composition Events defined in this specification <em class="rfc2119" title="MUST">MUST</em> occur in the following set order relative to one another:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td>Multiple events</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div id="handwriting" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_handwriting">Handwriting Recognition Systems</h5>
+ <p>The following example describes a possible sequence of events when composing a text passage <q>text</q> with a handwriting recognition system, such as on a pen
+ tablet, as modeled using Composition Events.</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User writes word on tablet surface</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td><code>'test'</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User rejects first word-match suggestion, selects different match</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td><code>'text'</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td><code>'text'</code></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div id="events-composition-event-canceling" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-composition-event-canceling">Canceling Composition Events</h5>
+ <p>If a <code>keydown</code> event is canceled then any Composition Events that would have fired as a result of that <code>keydown</code> <em class="rfc2119" title="SHOULD">SHOULD</em> not be dispatched:</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td>The <a class="def" href="#glossary-default-action">default action</a> is
+ prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em><abbr title="Number, Other">No</abbr> Composition Events are dispatched</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <p>If the initial <code>compositionstart</code> event is canceled then the text composition session <em class="rfc2119" title="SHOULD">SHOULD</em> be
+ terminated. Regardless of whether or not the composition session is terminated, the
+ <code>compositionend</code> event <em class="rfc2119" title="MUST">MUST</em> be sent.</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td>The <a class="def" href="#glossary-default-action">default action</a> is
+ prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em><abbr title="Number, Other">No</abbr> Composition Events are dispatched</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div id="events-composition-event-key-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-composition-event-key-events">Key Events During Composition</h5>
+ <p>During the composition session, all <code>keydown</code> and <code>keyup</code> events <em class="rfc2119" title="SHOULD">SHOULD</em> be suppressed.</p>
+
+ <p>If key events are suppressed between <code>compositionstart</code> and <code>compositionend</code>, then the first or last key
+ pressed might result in unmatched <code>keydown</code> and <code>keyup</code> events.
+ If a <a class="def" href="#glossary-user-agent">user agent</a> suppresses key events during composition,
+ then it <em class="rfc2119" title="MUST">MUST</em> ensure that all <code>keydown</code> and <code>keyup</code> events occur in matching pairs.
+ </p>
+
+ <p>The following event sequence shows how a <a class="def" href="#glossary-user-agent">user agent</a> might insert the extra <code>keyup</code>
+ for a <code>keydown</code> that initiated a composition session.</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td>This is key event that initiates the composition.</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td>This event would normally be suppressed because of the ongoing composition session, but it is sent to match the previously sent <code>keydown</code> event.</td>
+ </tr>
+ </tbody></table>
+
+ <p>For the final key event in a composition session, a <a class="def" href="#glossary-user-agent">user agent</a> may choose to either:
+ </p>
+
+ <p>(A) Suppress both the <code>keydown</code> and <code>keyup</code> events:
+ </p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Keydown for key that exits IME suppressed during composition session</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>A keyup event would normally be sent at this time, but it is suppressed to avoid generating an unmatched keyup event.</em></td>
+ </tr>
+ </tbody></table>
+
+ <p>(B) Insert an extra <code>keydown</code> event to match the <code>keyup</code> that occurs after the composition session ends:
+ </p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Keydown for key that exits IME suppressed during composition session</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td>This is key event that was suppressed earlier. It is sent now to match the upcoming keyup.</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ </div>
+
+ <div id="events-composition-event-key-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_events-composition-event-key-events">Input Events During Composition</h5>
+
+ <p>During the composition session, the <code>compositionupdate</code> <em class="rfc2119" title="MUST">MUST</em> be dispatched before the <code>beforeinput</code>
+ and <code>input</code> events are sent.</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>Any DOM updates occur at this point.</em></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+
+ <div class="note"><div class="note-title" id="h_note_80"><span>Note</span></div><p class=""><strong>Note:</strong> Most IMEs do not support canceling updates during a composition session.</p></div>
+ </div>
+
+ <p>The composition event types are listed below.</p>
+
+
+<!-- compositionstart -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-compositionstart"><dfn id="dfn-compositionstart"><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>compositionstart</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Start a new composition session when a <a class="def" href="#glossary-text-composition-system">text composition system</a> is enabled</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the composition</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
+ the original string being edited, otherwise the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a <a class="def" href="#glossary-text-composition-system">text composition
+ system</a> is enabled and a new composition session is about to begin (or has begun, depending on the <a class="def" href="#glossary-text-composition-system">text composition
+ system</a>) in preparation for composing a passage of text. This event type is device-dependent, and <em class="rfc2119" title="MAY">MAY</em> rely upon the capabilities of the text conversion system and how it is
+ mapped into the operating system. When a keyboard is used to feed an input method editor, this event type is generated after a <a class="eventtype internalDFN" href="#dfn-keydown"><code>keydown</code></a> event,
+ but speech or handwriting recognition systems <em class="rfc2119" title="MAY">MAY</em> send this event type without keyboard events. Some implementations <em class="rfc2119" title="MAY">MAY</em> populate the
+ <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute of the <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> event
+ with the text currently selected in the document (for editing and replacement). Otherwise, the value of the <a href="#widl-CompositionEvent-data"><code>data</code></a>
+ attribute <em class="rfc2119" title="MUST">MUST</em> be the <a class="def" href="#glossary-empty-string">empty string</a>.</p>
+
+ <p>This event <em class="rfc2119" title="MUST">MUST</em> be dispatched immediately before a <a class="def" href="#glossary-text-composition-system">text composition system</a> begins a new composition session, and
+ before the DOM is modified due to the composition process. The default action of this event is for the <a class="def" href="#glossary-text-composition-system">text
+ composition system</a> to start a new composition session. If this event is canceled, the <a class="def" href="#glossary-text-composition-system">text composition system</a> <em class="rfc2119" title="SHOULD">SHOULD</em>
+ discard the current composition session.</p>
+
+ <div class="note"><div class="note-title" id="h_note_81"><span>Note</span></div><p class=""><strong>Note:</strong> Canceling the <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a> <em>event type</em> is distinct
+ from canceling the <a class="def" href="#glossary-text-composition-system">text composition system</a> itself (e.g., by hitting a cancel button or closing an <a class="def" href="#glossary-ime">IME</a> window).</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_82"><span>Note</span></div><p class=""><strong>Note:</strong> Some IMEs do not support cancelling an in-progress composition session (e.g., such as GTK which doesn't presently have such an API). In these
+ cases, calling <a href="#widl-Event-preventDefault"><code>preventDefault</code></a> will not stop this event's default action.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- compositionupdate -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-compositionupdate"><dfn id="dfn-compositionupdate"><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>compositionupdate</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the composition, <code>null</code> if not accessible</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
+ the string comprising the current results of the composition session, which <em class="rfc2119" title="MAY">MAY</em> be the
+ <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="SHOULD">SHOULD</em> dispatch this event during a composition session when a
+ <a class="def" href="#glossary-text-composition-system">text composition system</a> updates its active text passage with a
+ new character, which is reflected in the string in <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a>.
+ </p>
+
+ <p>In <a class="def" href="#glossary-text-composition-system">text composition systems</a> which keep the ongoing composition in sync
+ with the input control, the <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a> event
+ <em class="rfc2119" title="MUST">MUST</em> be dispatched before the control is updated.
+ </p>
+
+ <p>Some <a class="def" href="#glossary-text-composition-system">text composition systems</a> might not expose this information to the DOM,
+ in which case this event will not fire during the composition process.
+ </p>
+
+ <p>If the composition session is canceled, this event will be fired immediately before the
+ <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event,
+ and the <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a> attribute will be set to the
+ <a class="def" href="#glossary-empty-string">empty string</a>.
+ </p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- compositionend -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-compositionend"><dfn id="dfn-compositionend"><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>compositionend</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the composition</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-CompositionEvent-data"><code class="attribute-name">CompositionEvent.data</code></a>:
+ the string comprising the final result of the composition session, which <em class="rfc2119" title="MAY">MAY</em> be the
+ <a class="def" href="#glossary-empty-string">empty string</a> if the content has been deleted or if the composition process has been canceled</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a
+ <a class="def" href="#glossary-text-composition-system">text composition system</a> completes or cancels the current composition session,
+ and the <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the control is updated.
+ </p>
+
+ <p>This event is dispatched immediately after the <a class="def" href="#glossary-text-composition-system">text composition system</a> completes
+ the composition session (e.g., the <a class="def" href="#glossary-ime">IME</a> is closed, minimized, switched out of focus, or otherwise dismissed,
+ and the focus switched back to the <a class="def" href="#glossary-user-agent">user agent</a>).
+ </p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ </div>
+
+ </div>
+<!-- events-module -->
+
+
+
+<!-- Section 6: Keyboard and key values ========================================================-->
+
+ <div id="keys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+
+<!--OddPage-->
+<h2 id="h2_keys"><span class="secno">6. </span>Keyboard events and key values</h2>
+
+ <p>This section contains necessary information regarding keyboard events:</p>
+
+ <ul>
+ <li>Explanation of keyboard layout, mapping, and key values.</li>
+ <li>Relations between keys, such as <a class="def" href="#glossary-dead-key">dead keys</a> or modifiers keys.</li>
+ <li>Relations between keyboard events and their default actions.</li>
+ <li>The set of key values, and guidelines on how to extend this set.</li>
+ </ul>
+
+ <div class="note"><div class="note-title" id="h_note_83"><span>Note</span></div><p class=""><strong>Note:</strong> This section uses Serbian and Kanji characters which could be misrepresented or unavailable in the PDF version or printed
+ version of this specification.</p></div>
+
+ <div id="keyboard-input" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_keyboard-input"><span class="secno">6.1 </span>Keyboard Input</h3>
+
+ <p><em>This section is informative</em></p>
+
+ <p>The relationship of each key to the complete keyboard has three separate aspects, each of which vary among different models and configurations of keyboards, particularly
+ for locale-specific reasons:</p>
+
+ <ul>
+ <li><strong>Visual markings:</strong> the labels (or <em>legends</em>) that mark each key</li>
+ <li><strong>Mechanical layout:</strong> the dimensions, size, and placement of the physical keys on the keyboard</li>
+ <li><strong>Functional mapping:</strong> the abstract key-value association of each key.</li>
+ </ul>
+
+ <p>This specification only defines the functional mapping, in terms of <a href="#keys-keyvalues">key values</a>, but briefly describes <a href="#key-legends">key legends</a>
+ and <a href="#keyboard-layout">keyboard layout</a> for background.</p>
+
+ <div id="key-legends" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_key-legends"><span class="secno">6.1.1 </span>Key Legends</h4>
+
+ <p><em>This section is informative</em></p>
+
+ <p>The visual markings normally consist of one or more characters which a keystroke on that key will produce (such as <code class="glyph">'F'</code>, <code class="glyph">
+ '8'</code>, or <code class="glyph">'ш'</code>), or names or symbols which indicate that key's function (such as an upward-pointing arrow <code class="glyph">⇧</code> indicating
+ <code class="key">'Shift'</code>, or the string <code>'Enter'</code>). Keys are often referred to by this marking (e.g., <q>Press the <code>
+ 'Shift'</code> and <code>'F'</code> keys.</q>). However, the visual appearance of the key has no bearing on its digital representation, and
+ in many configurations <em class="rfc2119" title="MAY">MAY</em> be completely inaccurate. Even the control and function keys, such as <code>'Enter'</code>, <em class="rfc2119" title="MAY">MAY</em> be mapped to different
+ functionality, or even mapped as character keys.</p>
+
+ <p>For historical reasons, the character keys are typically marked with the capital-letter equivalents of the character value they produce, e.g., the <code>
+ 'F'</code> key (the key marked with the glyph <code class="glyph">'F'</code>), will produce the character value <code class="char">'f'</code> when pressing
+ without an active modifier key (<code class="key">'Shift'</code>) or modifier state (<code class="key">'CapsLock'</code>).</p>
+
+ <div class="note"><div class="note-title" id="h_note_84"><span>Note</span></div><p class=""><strong>Note:</strong> The key legends for function keys do not normally produce any characters, although the symbol might have a Unicode equivalent. For example, the <code class="key">'Shift'</code> key might bear the symbol <code class="glyph">⇧</code>, which has the <a class="def" href="#glossary-unicode-code-point">Unicode code point</a> <code class="char">
+ '\u21E7'</code>, but pressing the <code class="key">'Shift'</code> key will not produce this character value, and there is no <a class="def" href="#glossary-unicode-code-point">
+ Unicode code point</a> for <code class="key">'Shift'</code>.</p></div>
+ </div>
+
+ <div id="keyboard-layout" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keyboard-layout"><span class="secno">6.1.2 </span>Keyboard Layout</h4>
+
+ <p><em>This section is informative</em></p>
+
+ <p>As with the key labels, the physical layout of the keys on the keyboard does not not affect the digital key value for any given key. It is outside the scope of
+ this specification to provide key values based on keyboard layout, particularly since there are so many possible layouts for a keyboard, and since users can change
+ the mapping of keys in their operating system, e.g., by selecting a Dvorak <a class="def" href="#glossary-key-mapping">key mapping</a>.</p>
+
+ <p>To illustrate the concept of keyboard layout mappings and its relation with keyboard events and key values, on the same keyboard (a PC/AT US keyboard), pressing
+ the key labeled <code>Q</code> (with no modifier key activated) will produce different key values based on the mapping. With a typical US <a class="def" href="#glossary-qwerty">
+ QWERTY</a> keyboard layout mapping, it will produce the character <code class="glyph">'q'</code> (<code class="char">'\u0071'</code>, Latin Small Letter Q). If
+ the keyboard layout mapping is switched to a French mapping, pressing the same key will produce the character <code class="glyph">'a'</code> (<code class="char">'\u0061'</code>,
+ Latin Small Letter A). If the keyboard layout mapping is switched to a Serbian (Cyrillic) mapping, pressing the same key will produce the character <code class="glyph">
+ 'љ'</code> (<code class="char">'\u0459'</code>, Cyrillic Small Letter LJE).</p>
+
+ <p>However, the physical layout of the keys <em class="rfc2119" title="MAY">MAY</em> be of interest to content authors developing games or other applications in which the location of the keys has an ergonomic
+ relationship as the desired user interface controls, with little or no attention paid to the representational value of the key itself. For example, many games
+ might use the keys <code class="key">'A'</code>, <code class="key">'S'</code>, <code class="key">'D'</code>, and <code class="key">'W'</code> for <code class="key">
+ 'left'</code>, <code class="key">'down'</code>, <code class="key">'right'</code>, and <code class="key">'up'</code> respectively. Content authors <em class="rfc2119" title="SHOULD">SHOULD</em>
+ provide a means for the user to assign such controller keys to a custom setting appropriate to their keyboard configurations. Implementations <em class="rfc2119" title="MAY">MAY</em> provide a means
+ for the user to more comprehensively map the keyboard to their customized keyboard layout, but this is beyond the scope of this specification.</p>
+
+ <div class="note"><div class="note-title" id="h_note_85"><span>Note</span></div><p class=""><strong>Note:</strong> Don't confuse key values with <em>scan codes</em>, which are the low-level hexadecimal signals produced for each key
+ by the keyboard driver software. <em>Scan codes</em> are mapped at the operating system to a <acronym title="Virtual Key">VK</acronym> (<q>virtual key</q>), which
+ in turn might be mapped to the user-defined key configuration. Key values are a high-level abstraction of that final mapping.</p></div>
+
+ <div id="keyboard-desktop" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keyboard-desktop">Desktop and Laptop Keyboards</h5>
+
+ <p>In the case where a content author wishes to rely on the mechanical layout of a desktop or laptop keyboard, this specification suggests the keyboard configuration
+ specified in ISO/IEC 9995, parts 2 and 3 [<cite><a class="informative" href="#references-ISO-9995-2-3">ISO-9995-2/3</a></cite>], which defines a common layout for
+ primary, secondary, and auxiliary <a class="def" href="#glossary-key-mapping">key mappings</a> on a typical alphanumeric keyboard, as a common layout appropriate
+ to some international uses.</p>
+
+ <div class="note"><div class="note-title" id="h_note_86"><span>Note</span></div><p class=""><strong>Note:</strong> This keyboard layout is still, in essence, a <a class="def" href="#glossary-qwerty">QWERTY</a> keyboard, and will not
+ match the keyboards or configurations of many users. Content authors cannot rely upon any particular configuration, and are expected to create content in an internationalized
+ and localizable manner.</p></div>
+
+ <div id="figure-keyboard" class="figure" style="text-align: center">
+ <object type="image/svg+xml" data="images/ISOIEC-9995-3-FCD-2009A.svg" width="900" height="300">
+ <img src="images/ISOIEC-9995-3-FCD-2009A.png" alt="A graphical depiction of an ISO standard defining layouts of computer keyboards, ISO/IEC 9995, parts 2 and 3" />
+ </object>
+ <div class="figcaption">Fig. <span class="figno">4</span> <span class="fig-title">A graphical depiction of an ISO standard defining layouts of computer keyboards, ISO/IEC 9995, parts 2 and 3</span></div></div>
+ </div>
+
+ <div id="keyboard-mobile" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keyboard-mobile">Mobile Keypads</h5>
+
+ <p>In the case where a content author wishes to rely on the mechanical layout of a mobile keypad, this specification suggests the keyboard configuration specified
+ in ISO/IEC 9995-8:2006 [<cite><a class="informative" href="#references-ISO-9995-8">ISO-9995-8</a></cite>], which defines a numeric keypad layout and secondary assignment
+ of Unicode characters in the range <code class="char">'\u0061'</code>..<code class="char">'\u007A'</code> to the number keys <code>2</code> through <code>9</code>, as a common layout appropriate to some
+ international uses.</p>
+
+ <div class="note"><div class="note-title" id="h_note_87"><span>Note</span></div><p class=""><strong>Note:</strong> This keypad layout, and in particular the distribution of letters is for English devices, and will not match the keypads
+ or configurations of many users. Content authors cannot rely upon any particular configuration, and are expected to create content in an internationalized and
+ localizable manner.</p></div>
+
+ <div id="figure-numberpad" class="figure" style="text-align:center">
+ <object type="image/svg+xml" data="images/ISOIEC-9995-8-2006.svg" width="180" height="240">
+ <img src="images/ISOIEC-9995-8-2006.png" alt="A graphical depiction of an ISO standard defining layouts of numeric keypads, with distribution of letters on the keys, ISO/IEC 9995-8:2006" />
+ </object>
+ <div class="figcaption">Fig. <span class="figno">5</span> <span class="fig-title">A graphical depiction of an ISO standard defining layouts of numeric keypads, with distribution of letters on the keys, ISO/IEC 9995-8:2006</span></div></div>
+ </div>
+
+ <div id="remote-control" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_remote-control">Media Remote Controls</h5>
+
+ <p>Many keyboards contain special keys to control media functions. Increasingly, many media devices, especially televisions, are Web-enabled. Hybrid keyboard/remote-control
+ devices are becoming more common. To meet the needs of these hybrid Web/media devices, this specification defines keys that are common as remote control buttons,
+ in addition to traditional keyboard keys.</p>
+
+ <p>Because of the smaller form factor, keys (or buttons) on a remote control will often be modal, with one key performing different functions based on the context
+ of the on-screen content. Additionally, many keys serve as toggles, to change back and forth between two or more states (see toggling keys).</p>
+
+ <div id="figure-remotecontrol" class="figure" style="text-align:center">
+ <object type="image/svg+xml" data="images/remote-control.svg" width="102" height="422">
+ <img src="images/remote-control.png" alt="A graphical depiction of a media remote control, with buttons mapped to specific keys values" />
+ </object>
+ <div class="figcaption">Fig. <span class="figno">6</span> <span class="fig-title">A graphical depiction of a media remote control, with buttons mapped to specific keys values</span></div></div>
+
+ </div>
+
+ <div id="keyboard-chording-virtual" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keyboard-chording-virtual">Virtual Keyboards and Chording Keyboards</h5>
+
+ <p>Virtual keyboards are software-based sets of keys, in a variety of different arrangements, commonly found on touch-screen devices. They are often modal, with the
+ ability to switch between different dynamic sets of keys, such as alphabetic, numeric, or symbolic keys. Because of the lack of physical constraints, these keyboards
+ <em class="rfc2119" title="MAY">MAY</em> present the widest range of characters, including emoticons and other symbols, and <em class="rfc2119" title="MAY">MAY</em> have keys not represented by Unicode [<a href="#references-Unicode">Unicode</a>]
+ or by the <a href="#key-value-tables">key values</a> defined in this specification. Wherever possible, however, virtual keyboards <em class="rfc2119" title="SHOULD">SHOULD</em> produce the normal range
+ of keyboard events and values, for ease of authoring and compatibility with existing content.</p>
+
+ <p>Chording keyboards, also know as chorded keysets or chord keyboards, are key input devices which produce values by pressing several keys in combination or sequence,
+ normally to simulate a full range of characters or commands on a reduced set of keys, often for single-handed use. A chording keyboard <em class="rfc2119" title="MAY">MAY</em> have additional mode
+ keys to switch between key values, and the number and type of keys pressed to produce a key value will vary, but the final key values produced by such keyboards
+ <em class="rfc2119" title="SHOULD">SHOULD</em> match the range of key values described in this specification.</p>
+
+ <p>For these and other alternative modal keyboards, the key values <a href="#key-Alphanumeric"><code class="key">'Alphanumeric'</code></a>, <a href="#key-CapsLock">
+ <code class="key">'CapsLock'</code></a>, <a href="#key-NumLock"><code class="key">'NumLock'</code></a>, and <a href="#key-SymbolLock"><code class="key">
+ 'SymbolLock'</code></a> are <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em> for the keys which switch between different modes.</p>
+
+ </div>
+
+ </div>
+
+ </div>
+
+ <div id="keys-keyvalues" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_keys-keyvalues"><span class="secno">6.2 </span>Key Values</h3>
+
+ <p>A key value is a <code>DOMString</code> that can be used to indicate any given key on a keyboard, regardless of position or state, by the value it produces. These
+ key values <em class="rfc2119" title="MAY">MAY</em> be used as return values for keyboard events generated by the implementation, or as input values by the content author to specify desired input (such
+ as for keyboard shortcuts). This specification defines a set of common key values (defined in the <a href="#key-value-tables">Key Value Tables</a>), and rules for production
+ of new key values.</p>
+
+ <p>Key values can be used to detect the value of a key which has been pressed, using the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
+ attribute. Content authors can retrieve the <a class="def" href="#glossary-character-value">
+ character value</a> of upper- or lower-case letters, number, symbols, or other character-producing keys, and also the <a class="def" href="#glossary-key-value">key
+ value</a> of control keys, modifier keys, function keys, or other keys that do not generate characters. These values can be used for monitoring particular
+ input strings, for detecting and acting on modifier key input in combination with other inputs (such as a mouse), for creating virtual keyboards, or for any number
+ of other purposes.</p>
+
+ <p>Key values can also be used by content authors in string comparisons, as values for markup attributes (such as the HTML <code>accesskey</code>) in conforming <a class="def" href="#glossary-host-language">host languages</a>, or for other related purposes. A conforming <a class="def" href="#glossary-host-language">host language</a>
+ <em class="rfc2119" title="SHOULD">SHOULD</em> allow content authors to use either of the two equivalent string values for a key value: the <a class="def" href="#glossary-character-value">character value</a>,
+ or the <a class="def" href="#glossary-key-value">key value</a>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_88"><span>Note</span></div><p class=""><strong>Note:</strong> While implementations will use the most relevant value for a key independently of the platform or keyboard layout mappings,
+ content authors can not make assumptions on the ability of keyboard devices to generate them. When using keyboard events and key values for shortcut-key combinations,
+ content authors can <q>consider using numbers and function keys (F4, F5, and so on) instead of letters</q> ([<cite><a class="informative" href="#references-DWW95">DWW95</a></cite>])
+ given that most keyboard layouts will provide keys for those.</p></div>
+
+ <p>A key value does not indicate a specific key on the physical keyboard, nor does it reflect the character printed on the key. A key
+ value indicates the current value of the event with consideration to the current state of all active keys and key input modes (including shift modes and <a class="def" href="#glossary-dead-key">dead keys</a>), as reflected in the operating-system mapping of the keyboard and reported to the implementation. In other words, the
+ key value for the key marked <code class="glyph">'O'</code> on a <a class="def" href="#glossary-qwerty">QWERTY</a> keyboard has the key value <code class="key">'o'</code> in an unshifted
+ state, <code class="key">'O'</code> in a shifted state, <code class="key">'ö'</code> in an unshifted state during a dead-key operation to add an umlaut diacritic, and <code class="key">'Ö'</code>
+ in a shifted state during a dead-key operation to add an umlaut diacritic. Because a user can map their keyboard to an arbitrary custom configuration, the content
+ author is encouraged not to assume that a relationship exists between the shifted and unshifted states of a key and the majuscule form (uppercase or capital letters)
+ and minuscule form (lowercase or small letters) of a character representation, but is encouraged instead to use the value of the <a href="#widl-KeyboardEvent-key">
+ <code>KeyboardEvent.key</code></a> attribute. The keyboard depicted in <a href="#figure-keyboard" class="fig-ref">
+ Figure 4</a> illustrates one possible set of <a class="def" href="#glossary-key-mapping">key mappings</a> on one possible keyboard layout. Many others exist,
+ both standard and idiosyncratic.</p>
+
+ <p>It is also important to note that there is not a one-to-one relationship between key event states and key values. A particular key value might be associated with
+ multiple keys. For example, many standard keyboards contain more than one key with the <code class="key">'Shift'</code> key value (normally distinguished by the
+ <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> values <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_LEFT"><code class="constant-name">DOM_KEY_LOCATION_LEFT</code></a>
+ and <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_RIGHT"><code class="constant-name">DOM_KEY_LOCATION_RIGHT</code></a>) or <code class="key">'8'</code> key value (normally
+ distinguished by the <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> values
+ <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_STANDARD"><code class="constant-name">DOM_KEY_LOCATION_STANDARD</code></a>
+ and <a href="#widl-KeyboardEvent-DOM_KEY_LOCATION_NUMPAD"><code class="constant-name">DOM_KEY_LOCATION_NUMPAD</code></a>), and user-configured
+ custom keyboard layouts <em class="rfc2119" title="MAY">MAY</em> duplicate any key value in multiple key-state scenarios (note that <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>
+ is intended for standard keyboard layouts, and cannot always indicate a meaningful distinction).</p>
+
+ <p>Finally, the meaning of any given character representation is context-dependent and complex. For example, in some contexts, the asterisk (star) glyph (<code class="glyph">'*'</code>) represents a footnote or emphasis (when bracketing a passage of text). However, in some documents or executable programs it is equivalent
+ to the mathematical multiplication operation, while in other documents or executable programs, that function is reserved for the multiplication symbol (<code class="glyph">'×'</code>,
+ Unicode value <code class="char">'\u00D7'</code>) or the Latin small letter <code>'x'</code> (due to the lack of a multiplication key on many keyboards
+ and the superficial resemblance of the glyphs <code class="glyph">'×'</code> and <code class="glyph">'x'</code>). Thus, the semantic meaning or function of
+ character representations is outside the scope of this specification.</p>
+
+ <div id="keys-unicode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-unicode"><span class="secno">6.2.1 </span>Key Values and Unicode</h4>
+
+ <p>The <a class="def" href="#glossary-character-value">character values</a> described in this specification are Unicode [<a href="#references-Unicode">Unicode</a>]
+ codepoints, and as such, have certain advantages.</p>
+
+ <p>The most obvious advantage is that it allows the content author to use the full range of internationalized language functionality available in the implementation,
+ regardless of the limitations of the text input devices on the system. This opens up possibilities for virtual keyboards and Web-application-based <a class="def" href="#glossary-ime">input method editors</a>.</p>
+
+ <p>Another benefit is that it allows the content author to utilize the Unicode general category properties programmatically.</p>
+
+ <p>With legacy keyboard event attributes such as <code class="attribute-name">keyCode</code> and <code class="attribute-name">charCode</code>, content authors are forced to
+ filter key input using cryptic, platform- and implementation-specific numeric codes, with poor internationalization, such as the following pseudocode:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <pre><code>if ( ( event.charCode == 45 || event.charCode == 36 ) ||
+ ( event.charCode >= 48 && event.charCode <= 57 ) ||
+ ( event.charCode >= 96 && event.charCode <= 105 ) ) {
+ <span class="comment">// minus sign, dollar sign, and numeric characters from keyboard and numpad</span>
+ <span class="comment">// ...</span>
+}
+else if ( ( event.charCode >= 65 && event.charCode <= 90 ) ||
+ ( event.charCode >= 97 && event.charCode <= 122 ) ) {
+ <span class="comment">// alphabetic characters from Latin character set, A-Z, a-z</span>
+ <span class="comment">// ...</span>
+}
+else {
+ <span class="comment">// ...</span>
+}
+</code></pre>
+ </div>
+
+ <p>With key values and regular expressions, however, content authors can support selective and intuitive ranges for key-based input, in a cross-platform manner with
+ advanced internationalization support, such as the following pseudocode:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <pre><code>if ( event.key == "-" || event.key.match("\p{Sc}") || event.key.match("\p{N}") ) {
+ <span class="comment">// minus sign, any currency symbol, and numeric characters (regardless of key location)</span>
+ <span class="comment">// ...</span>
+}
+else if ( event.key.match("\p{L}") ) {
+ <span class="comment">// alphabetic characters from any language, upper and lower case</span>
+ <span class="comment">// ...</span>
+}
+else {
+ <span class="comment">// ...</span>
+}
+</code></pre>
+ </div>
+
+ <p>In addition, because Unicode categorizes each assigned <a class="def" href="#glossary-unicode-code-point">code point</a> into a group of code points used by a particular
+ human writing system, even more advanced capabilities are possible.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A content author can match characters from a particular human script (e.g., Tibetan) using a regular expression such as
+ <code>\p{Tibetan}</code>, to filter out other characters, or discover if a <a class="def" href="#glossary-unicode-code-point">code point</a> is in
+ a certain code block (range of code points), using a regular expression like <code>\p{InCyrillic}</code>.</p>
+ </div>
+
+ <p>To facilitate this, implementations <em class="rfc2119" title="SHOULD">SHOULD</em> support Unicode range detection using regular expressions, in a manner such as the Perl Compatible Regular Expressions
+ (PCRE) [<a href="#references-pcre">PCRE</a>].</p>
+ </div>
+
+ <div id="keys-Modifiers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-Modifiers"><span class="secno">6.2.2 </span>Modifier keys</h4>
+
+ <p>Keyboard input uses modifier keys to change the normal behavior of a key. Like other keys, modifier keys generate <a class="eventtype" href="#event-type-keydown">
+ <code>keydown</code></a> and <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events, as shown in the example below. Some modifiers are activated
+ while the key is being pressed down or maintained pressed such as <code class="key">'Alt'</code>, <code class="key">'Control'</code>, <code class="key">'Shift'</code>,
+ <code class="key">'AltGraph'</code>, or <code class="key">'Meta'</code>. Others modifiers are activated depending on their state such as <code class="key">'CapsLock'</code>,
+ <code class="key">'NumLock'</code>, or <code class="key">'ScrollLock'</code>. Change in the state happens when the modifier key is being pressed down. The <a href="#interface-KeyboardEvent">
+ <code>KeyboardEvent</code></a> interface provides convenient attributes for some common modifiers keys: <a href="#widl-KeyboardEvent-ctrlKey"><code>KeyboardEvent.ctrlKey</code></a>,
+ <a href="#widl-KeyboardEvent-shiftKey"><code>KeyboardEvent.shiftKey</code></a>, <a href="#widl-KeyboardEvent-altKey"><code>KeyboardEvent.altKey</code></a>,
+ <a href="#widl-KeyboardEvent-metaKey"><code>KeyboardEvent.metaKey</code></a>. Some operating systems simulate the <code class="key">'AltGraph'</code> modifier
+ key with the combination of the <code class="key">'Alt'</code> and <code class="key">'Control'</code> modifier keys. Implementations are encouraged to use the
+ <code class="key">'AltGraph'</code> modifier key.</p>
+
+ <p>The following example describes a possible sequence of events associated with the generation of the Unicode character Q (Latin Capital Letter Q, <a class="def" href="#glossary-unicode-code-point">Unicode code point</a> <code class="char">'\u0051'</code>) on a PC/AT US keyboard using a US mapping:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td><code class="attribute-name">shiftKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td><code class="attribute-name">shiftKey</code></td>
+ <td>Latin Capital Letter Q</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td class="cell-center"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td><code class="attribute-name">shiftKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>The following example describes an alternate sequence of keys to the example above, where the <code class="key">'Shift'</code> key is released before the <code class="key">'Q'</code> key. The key value for the key labeled <code class="key">'Q'</code> will revert to its unshifted value for the <a class="eventtype" href="#event-type-keyup">
+ <code>keyup</code></a> event:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td><code class="attribute-name">shiftKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td><code class="attribute-name">shiftKey</code></td>
+ <td>Latin Capital Letter Q</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td class="cell-center"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'q'</code></td>
+ <td></td>
+ <td>Latin Small Letter Q</td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>The following example describes a possible sequence of keys that does not generate a Unicode character (using the same configuration):</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'v'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td>Latin Small Letter V</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'v'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td>Latin Small Letter V</td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>The following example shows the sequence of events when both <code class="key">'Shift'</code> and <code class="key">'Control'</code> are pressed:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'V'</code></td>
+ <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
+ <td>Latin Capital Letter V</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'V'</code></td>
+ <td><code class="attribute-name">ctrlKey</code> <code class="attribute-name">shiftKey</code></td>
+ <td>Latin Capital Letter V</td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>For non-US keyboard layouts, the sequence of events is the same, but the value of the key is based on the current
+ keyboard layout. The following example shows a sequence of events when an Arabic keyboard layout is used:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'ر'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td>Arabic Letter Reh</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="4"><em><abbr title="Number, Other">No</abbr> beforeinput or input events are generated.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'ر'</code></td>
+ <td><code class="attribute-name">ctrlKey</code></td>
+ <td>Arabic Letter Reh</td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Control'</code></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_89"><span>Note</span></div><p class=""><strong>Note:</strong> The value in the keydown and keyup events varies based on the current keyboard layout
+ in effect when the key is pressed. This means that the <code class="key">'v'</code> key on a US layout and the
+ <code class="key">'ر'</code> key on an Arabic layout will generate different events even though they are the same physical
+ key. To identify these events as coming from the same physical key, you will need to make use of the <code>code</code> attribute
+ as specified in the [<a href="#references-UIEvents">UI Events</a>] specification.</p></div>
+
+ <p>In some cases, modifier keys change the key value value for a key event. For example, on some MacOS keyboards, the key labeled <code>'delete'</code>
+ functions the same as the <code class="key">'Backspace'</code> key on the Windows OS when unmodified, but when modified by the <code class="key">'Fn'</code>
+ key, acts as the <code class="key">'Del'</code> key, and the value of the key value will match the most appropriate function of the key in its current modified
+ state.</p>
+
+ </div>
+
+ <div id="keys-DeadKeys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-DeadKeys"><span class="secno">6.2.3 </span>Dead keys</h4>
+
+ <p>Some keyboard input uses <a class="def" href="#glossary-dead-key">dead keys</a> for the input of composed character sequences. Unlike the handwriting sequence,
+ in which users enter the base character first, keyboard input requires to enter a special state when a <a class="def" href="#glossary-dead-key">dead key</a> is
+ pressed and emit the character(s) only when one of a limited number of <q>legal</q> base character is entered.</p>
+
+ <div class="note"><div class="note-title" id="h_note_90"><span>Note</span></div><p class=""><strong>Note:</strong> The MacOS and Linux operating systems use input methods to process
+ <a class="def" href="#glossary-dead-key">dead keys</a>.
+ </p></div>
+
+ <p>The <a class="def" href="#glossary-dead-key">dead keys</a> are represented in the key values set using combining diacritical marks. While Unicode combining characters
+ always follow the handwriting sequence, with the combining character trailing the corresponding letter, typical deadkey input <em class="rfc2119" title="MAY">MAY</em> reverse the sequence, with the
+ combining character before the corresponding letter. For example, the word <em>naïve</em>, using the combining diacritic <em>¨</em>, would be represented sequentially
+ in Unicode as <em>nai¨ve</em>, but <em class="rfc2119" title="MAY">MAY</em> be typed <em>na¨ive</em>. The sequence of keystrokes <code class="char">'\u0302'</code> (Combining Circumflex Accent key) and <code class="char">'\u0065'</code>
+ (key marked with the Latin Small Letter E) will likely produce (on a PC/AT french keyboard using a french mapping and without any modifier activated) the Unicode
+ character <code class="glyph">'ê'</code> (Latin Small Letter E With Circumflex), as preferred by the Unicode Normalization Form <em>NFC</em>:</p>
+
+ <div class="note"><div class="note-title" id="h_note_91"><span>Note</span></div><p class=""><strong>Note:</strong> The <code>keydown</code> and <code>keyup</code> events shown in these
+ examples would normally be suppressed during the composition session.
+ They are included in these examples to make the user actions (pressing and releasing keys) more apparent.
+ </p></div>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br />data</code></a></th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td>Combining Circumflex Accent</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="char">'\u0302'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'ê'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'ê'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'ê'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'e'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter E</td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_92"><span>Note</span></div><p class=""><strong>Note:</strong> In the second <code>keydown</code> event (step 5), the key value
+ (assuming the event is not suppressed) will
+ <em>not</em> be <code class="key">'e'</code> (Latin Small Letter E key) under normal circumstances
+ because the value delivered to the user agent will already be modified by the dead key operation.</p></div>
+
+ <p>This process might be aborted when a user types an unsupported base character (that is, a base character for which the which the active diacritical mark is not
+ available) after pressing a <a class="def" href="#glossary-dead-key">dead key</a>:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br />data</code></a></th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td>Combining Circumflex Accent</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="char">'\u0302'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'q'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter Q</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'q'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+
+ <div id="keys-IME" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-IME"><span class="secno">6.2.4 </span>Input Method Editors</h4>
+
+ <p>This specification includes a model for <a class="def" href="#glossary-ime">input method editors (IMEs)</a>, through the <a href="#interface-CompositionEvents">CompositionEvent</a>
+ interface and events. However, Composition Events and Keyboard Events do not necessarily map as a one-to-one relationship. As an example, receiving a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> for the <a href="#key-Accept"><code class="key">'Accept'</code></a> key value does not necessarily imply
+ that the text currently selected in the <a class="def" href="#glossary-ime">IME</a> is being accepted, but indicates only that a keystroke happened, disconnected
+ from the <a class="def" href="#glossary-ime">IME</a> Accept functionality (which would normally result in a <a class="eventtype" href="#event-type-compositionend">
+ <code>compositionend</code></a> event in most <a class="def" href="#glossary-ime">IME</a> systems). Keyboard events cannot be used to determine the current
+ state of the input method editor, which can be obtained through the <a href="#widl-CompositionEvent-data"><code>data</code></a> attribute of the <a href="#interface-CompositionEvents">
+ CompositionEvent</a> interface. Additionally, <a class="def" href="#glossary-ime">IME</a> systems and devices vary in their functionality, and in which keys
+ are used for activating that functionality, such that the <code class="key">'Convert'</code> and <code class="key">'Accept'</code> keys <em class="rfc2119" title="MAY">MAY</em> be represented
+ by other available keys. Keyboard events correspond to the events generated by the input device after the keyboard layout mapping.</p>
+
+ <div class="note"><div class="note-title" id="h_note_93"><span>Note</span></div><p class=""><strong>Note:</strong> In some implementations or system configurations, some key events, or their values, might be suppressed
+ by the <a class="def" href="#glossary-ime">IME</a> in use.</p></div>
+
+ <p>The following example describes a possible sequence of keys to generate the Unicode character <code class="glyph">'市'</code> (Kanji character, part of CJK Unified Ideographs) using Japanese
+ input methods. This example assumes that the input method editor is activated and in the Japanese-Romaji input mode. The keys <code class="key">'Convert'</code>
+ and <code class="key">'Accept'</code> <em class="rfc2119" title="MAY">MAY</em> be replaced by others depending on the input device in use and the configuration of the IME, e.g., it can be respectively
+ <code class="char">'\u0020'</code> (Space key) and <code class="key">'Enter'</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_94"><span>Note</span></div><p class=""><strong>Note:</strong> <code class="glyph">'詩'</code> (<q>poem</q>) and <code class="glyph">'市'</code> (<q>city</q>) are homophones, both
+ pronounced し (<q>shi</q>), so the user needs to use the <code class="key">'Convert'</code> key to select the proper option.</p></div>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br />data</code></a></th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter S</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'i'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter I</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'し'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'i'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td>Convert</td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'詩'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">10.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">11.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td>Convert</td>
+ </tr>
+ <tr>
+ <td class="cell-number">12.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'市'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">13.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">14.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Accept'</code></td>
+ <td class="cell-center"></td>
+ <td>Accept</td>
+ </tr>
+ <tr>
+ <td class="cell-number">15.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'市'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">16.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Accept'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>IME composition can also be canceled as in the following example, with conditions identical to the previous example. The key <a href="#key-Cancel"><code class="key">
+ 'Cancel'</code></a> might also be replaced by others depending on the input device in use and the configuration of the IME, e.g., it could be <code class="char">'\u001B'</code>
+ (Escape key).</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-CompositionEvent-data"><code>CompositionEvent<br />data</code></a></th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter S</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'s'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'i'</code></td>
+ <td class="cell-center"></td>
+ <td>Latin Small Letter I</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'し'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'i'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td>Convert</td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'詩'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">10.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">11.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td>Convert</td>
+ </tr>
+ <tr>
+ <td class="cell-number">12.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'市'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">13.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Convert'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">14.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Cancel'</code></td>
+ <td class="cell-center"></td>
+ <td>Cancel</td>
+ </tr>
+ <tr>
+ <td class="cell-number">15.</td>
+ <td><a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">16.</td>
+ <td><a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">''</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">17.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Cancel'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_95"><span>Note</span></div><p class=""><strong>Note:</strong> Some <a class="def" href="#glossary-ime">input method editors</a> (such as on the MacOS operating system) might set an <a class="def" href="#glossary-empty-string">
+ empty string</a> to the composition data attribute before canceling a composition.</p></div>
+
+ <h4 id="x6.2.4.1-input-method-editor-mode-keys"><a id="keys-IME_keys" href="#keys-IME_keys">6.2.4.1 Input Method Editor mode keys</a></h4>
+ <div>
+
+ <p>Some keys on certain devices are intended to activate <a class="def" href="#glossary-ime">input method editor</a> functionality, or to change the mode of an active
+ <a class="def" href="#glossary-ime">input method editor</a>. Custom keys for this purpose can be defined for different devices or language modes. The keys defined
+ in this specification for this purpose are: <code>Alphanumeric</code>, <code>CodeInput</code>, <code>FinalMode</code>, <code>HangulMode</code>, <code>HanjaMode</code>,
+ <code>Hiragana</code>, <code>JunjaMode</code>, <code>KanaMode</code>,
+ <code>KanjiMode</code>, <code>Katakana</code>, and <code>RomanCharacters</code>. When one of these keys is pressed, and no <a class="def" href="#glossary-ime">IME</a>
+ is currently active, the appropriate <a class="def" href="#glossary-ime">IME</a> is expected to be activated in the mode indicated by the key (if available). If
+ an <a class="def" href="#glossary-ime">IME</a> is already active when the key is pressed, the active <a class="def" href="#glossary-ime">IME</a> might change to
+ the indicated mode, or a different <a class="def" href="#glossary-ime">IME</a> might be launched, or the might <em class="rfc2119" title="MAY">MAY</em> be ignored, on a device- and application-specific
+ basis.</p>
+
+ <p>This specification also defines other keys which are intended for operation specifically with <a class="def" href="#glossary-ime">input method editors</a>: <code>
+ Accept</code>, <code>AllCandidates</code>, <code>Cancel</code>, <code>Convert</code>, <code>Compose</code>, <code>FullWidth</code>, <code>HalfWidth</code>, <code>NextCandidate</code>,
+ <code>Nonconvert</code>, and <code>PreviousCandidate</code>. The functions of these keys are not defined in this specification — refer to other resources for details
+ on <a class="def" href="#glossary-ime">input method editor</a> functionality.</p>
+
+ <div class="note"><div class="note-title" id="h_note_96"><span>Note</span></div><p class=""><strong>Note:</strong> Keys with <a class="def" href="#glossary-ime">input method editor</a> functions are not restricted to that purpose, and can have other device- or implementation-specific
+ purposes.</p></div>
+ </div>
+ </div>
+
+ <div id="keys-cancelable_keys" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-cancelable_keys"><span class="secno">6.2.5 </span>Default actions and cancelable keyboard events</h4>
+
+ <p>Canceling the <a class="def" href="#glossary-default-action">default action</a> of a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event
+ <em class="rfc2119" title="MUST NOT">MUST NOT</em> affect its respective <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event, but it <em class="rfc2119" title="MUST">MUST</em> prevent the respective
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> and
+ <a class="eventtype" href="#event-type-input"><code>input</code></a> events
+ from being generated. The following example describes a possible sequence of keys
+ to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br />data</code></a></th>
+ <th class="cell-center">Modifiers</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td>The <a class="def" href="#glossary-default-action">default action</a> is
+ prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="5">
+ <em><abbr title="Number, Other">No</abbr> <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> or
+ <a class="eventtype" href="#event-type-input"><code>input</code></a> events are generated</em>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>If the key is a modifier key, the keystroke <em class="rfc2119" title="MUST">MUST</em> still be taken into account for the modifiers states. The following example describes a possible sequence of keys
+ to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br />data</code></a></th>
+ <th class="cell-center">Modifiers</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td>The <a class="def" href="#glossary-default-action">default action</a> is
+ prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Q'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="attribute-name"><a href="#widl-MouseEvent-shiftKey">shiftKey</a></code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'Shift'</code></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ <p>If the key is part of a sequence of several keystrokes, whether it is a <a class="def" href="#glossary-dead-key">dead key</a> or it is contributing to an Input
+ Method Editor sequence, the keystroke <em class="rfc2119" title="MUST">MUST</em> be ignored (not taken into account) only if the <a class="def" href="#glossary-default-action">default action</a> is
+ canceled on the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event.
+ Canceling a <a class="def" href="#glossary-dead-key">dead key</a>
+ on a <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event has no effect on
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> or
+ <a class="eventtype" href="#event-type-input"><code>input</code></a> events.
+ The following example uses the keystrokes <code class="char">'\u0302'</code> (Combining Circumflex Accent key) and the key marked <code class="key">
+ 'e'</code> (<code class="char">'\u0065'</code>, Latin Small Letter E key) (on a PC/AT French keyboard using a French mapping and without any modifier activated):</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br />data</code></a></th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td>The <a class="def" href="#glossary-default-action">default action</a> is
+ prevented, e.g., by invoking <a href="#widl-Event-preventDefault"><code>Event.preventDefault()</code></a>.
+ </td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'\u0302'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'e'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'e'</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'e'</code></td>
+ <td class="cell-center"></td>
+ <td></td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+
+ <div id="keys-Guide" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-Guide"><span class="secno">6.2.6 </span>Guidelines for selecting and defining key values</h4>
+
+ <p><strong>This section is normative.</strong></p>
+
+ <p>The list of key values contained in this specification is not exhaustive, and input devices <em class="rfc2119" title="MAY">MAY</em> have to define their own key values. Consider the current function
+ of the key (i.e., with modifiers), taking into consideration the keyboard layout mapping in use, to determine if the key is represented by the set of defined key
+ values, if a corresponding Unicode character exists from which a key value <em class="rfc2119" title="MAY">MAY</em> be derived, or if a new key value <em class="rfc2119" title="MUST">MUST</em> be defined. The following algorithm determines
+ the <em>key value</em> and <em>character value</em> to use:</p>
+
+ <ol class="algo" id="key-algorithm">
+ <li>If the primary current function of the key is to generate a character, then:
+ <ol class="algo">
+ <li>If there exists an appropriate character in the <a href="#keys-keyvalues">key values set</a>, then
+ the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
+ of the <em>key value</em> of that character.</li>
+ <li>If there is no appropriate key value in the <a href="#keys-keyvalues">key values set</a>, and there exists an appropriate <a class="def" href="#glossary-unicode-code-point">
+ Unicode code point</a>, then
+ the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
+ of the <em>char value</em> of that character.</li>
+ </ol>
+ </li>
+ <li>If the primary current function of the key is to serve as a function key, then:
+ <ol class="algo">
+ <li>If there exists an appropriate key value in the <a href="#keys-keyvalues">key values set</a>, then:
+ the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute <em class="rfc2119" title="MUST">MUST</em> be a string consisting
+ of the <em>key value</em> of that character.</li>
+ </ol>
+ </li>
+ </ol>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <ul>
+ <li>On a PC/AT US keyboard with a right-handed single-hand Dvorak <a class="def" href="#glossary-key-mapping">key mapping</a>, the key labeled <code class="key">
+ 'Q'</code> maps to the key values <code class="key">'5'</code> (unmodified) and <code class="key">'%'</code> (shifted). The primary function of this key
+ is to generate the character <code class="key">'5'</code> (<code class="char">'\u0035'</code>). Since this character is a character (in Unicode general category
+ <abbr title="Number, Decimal Digit">Nd</abbr>), the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
+ attribute value for the unmodified key will be <code class="key">'5'</code>.
+ </li>
+ <li>On a French PC keyboard with a standard French mapping, the primary function of the <code class="key">'^'</code> key is as a
+ <a class="def" href="#glossary-dead-key">dead key</a> for the circumflex diacritical mark.
+ The Unicode value for this key is <code class="char">'\u0302'</code>.
+ </li>
+ <li>On a Korean PC keyboard with a standard Korean mapping, the primary function of the <code class="key">'Ha/En'</code> key is to switch between Hangul and English
+ input. The predefined key value list has an appropriate entry for this key, <code class="key">'HangulMode'</code>, so this will be the key value.
+ </li>
+ <li>On some models of mobile devices, there are special keys to launch specific applications.
+ For a standard application like Calendar, there is a predefined key value of <code class="key">'LaunchCalendar'</code>.
+ For applications not listed in the key value list, a new value can be devised.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div id="key-value-tables" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_key-value-tables"><span class="secno">6.3 </span>Key Value Tables</h3>
+
+ <p>This section defines a list of key values which implementations <em class="rfc2119" title="MUST">MUST</em> support, at a minimum, in addition to support for the full range of Unicode [<a href="#references-Unicode">Unicode</a>]
+ codepoints. Implementations <em class="rfc2119" title="MAY">MAY</em> support additional key values, in a manner conforming to the <a href="#keys-Guide">guidelines for selecting and defining key values</a>.
+ The <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute of an event <em class="rfc2119" title="MUST">MUST</em> always contain one of these control key
+ or character values (even if the value is <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>). If the key represents one of the set of printable
+ control characters which has a Unicode character entry, such as the tab key, the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute
+ <em class="rfc2119" title="MUST">MUST</em> have the key value (e.g., <a href="#key-Tab"><code class="key">'Tab'</code></a>).</p>
+
+ <p>Implementations that are unable to identify a key <em class="rfc2119" title="MUST">MUST</em> use the key value <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> Conforming implementations <em class="rfc2119" title="MUST">MUST</em> only use <a href="#key-Unidentified"><code class="key">'Unidentified'</code></a>
+ as a key value when there is no way for the implementation to detect the key value.
+ Exposing only this value <em class="rfc2119" title="MUST NOT">MUST NOT</em> indicate a conforming implementation.</p>
+
+ <p>The <a class="def" href="#glossary-key-value">key values</a> defined in this specification are based in part on the sets of keycodes from
+ the <code>java.awt.event.KeyEvent</code> interface of the Java Platform, Standard Edition 6 API Specification
+ [<cite><a class="informative" href="#references-KeyEvent">KeyEvent for Java</a></cite>],
+ and the <code>System.Windows.Forms.Keys</code> key enumeration of the Microsoft .NET Framework 4.0 Class Library
+ [<cite><a class="informative" href="#references-Keys">Keys enumeration for .Net</a></cite>].
+ </p>
+
+ <div class="note"><div class="note-title" id="h_note_97"><span>Note</span></div><p class=""><strong>Note:</strong> The keys on the numeric keypad (e.g., the keypad <code>'1'</code> key) do not generate distinct <code>key</code> values
+ from their non-keypad counterparts (e.g., the <code>'1'</code> key in the main part of the keyboard).
+ The <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a> attribute can be used to determine if a key originated from the numeric keypad.</p></div>
+
+ <div class="note"><div class="note-title" id="h_note_98"><span>Note</span></div><div class="">
+ <p><strong>Note:</strong> There are special internationalization considerations for ECMAScript escaped characters. CharMod conformance [<cite><a class="normative" href="#references-charmod">CharMod</a></cite>] <a href="http://www.w3.org/TR/charmod/#C045">expects</a> the use of code points rather than surrogate pairs in escapes.
+ ECMAScript escaped characters use surrogate pairs for characters outside the Basic Multilingual Plane (<code class="char">"\uD84E\uDDC2"</code> for <code class="glyph">'𣧂'</code>,
+ a Chinese character meaning <q>untidy</q>), rather than C-style fixed-length characters (<code class="char">"\U000239c2"</code> for <code class="glyph">'𣧂'</code>) or delimited escapes
+ such as Numeric Character References (<code>"&#x239C2;"</code>). Characters escaped in this manner:</p>
+
+ <ul>
+ <li>are based on UTF-16 encoding, in that it uses surrogate pairs for values outside the Basic Multilingual Plane</li>
+ <li>are expressed using surrogate pairs, which makes it difficult for a human to look up the value, and might require unnecessary overhead for machine processing
+ — this can also cause problems with software written in the incorrect belief that Unicode is a 16-bit character set</li>
+ <li>are problematic for characters on supplementary planes (emoji, or Chinese characters on plane 2), some of which are expected to be input using a keyboard</li>
+ <li>are not be suitable for Java or C, which use different escaping mechanisms (could be solved with a normalizing method)</li>
+ </ul>
+ </div></div>
+
+ <p>The following sub-sections contain the normative list of case-sensitive key values, their character values (where applicable), an informative description of typical usage,
+ and an informative categorization. A conforming implementation of the <a href="#interface-KeyboardEvent">KeyboardEvent</a> interface <em class="rfc2119" title="MUST">MUST</em> support at least this set
+ of values for use in the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
+ attributes, though not all values <em class="rfc2119" title="MAY">MAY</em> be available on all platforms or devices.</p>
+
+ <p>Future versions of this specification <em class="rfc2119" title="MAY">MAY</em> include key values not included here, which have become common since the publication of this specification.</p>
+
+ <div id="keys-special" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-special"><span class="secno">6.3.1 </span>Special Key Values</h4>
+
+
+<!-- Key tables. Note that all keys must be defined within a <div class="key-table"> -->
+
+ <div id="key-table-general" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Unidentified" class="key">'Unidentified'</code></td><td>This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-general -->
+
+
+ <div id="keys-modifier" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-modifier"><span class="secno">6.3.2 </span>Modifier Keys</h4>
+ <div id="key-table-modifier" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Alt" class="key">'Alt'</code></td><td>The Alternative (Alt, Option, Menu) key. Enable alternate modifier function for interpreting concurrent or subsequent keyboard input.
+ This key value is also used for the Apple <code>'Option'</code> key.
+ </td></tr><tr><td class="key-table-key"><code id="key-AltGraph" class="key">'AltGraph'</code></td><td>The Alternate Graphics (AltGr or AltGraph) key.
+ This key is used enable the ISO Level 3 shift modifier (the standard <code>'Shift'</code> key is the level 2 modifier).
+ </td></tr><tr><td class="key-table-key"><code id="key-CapsLock" class="key">'CapsLock'</code></td><td>The Caps Lock (Capital) key.
+ Toggle capital character lock function for interpreting subsequent keyboard input event.
+ </td></tr><tr><td class="key-table-key"><code id="key-Control" class="key">'Control'</code></td><td>The Control (Ctrl) key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-Fn" class="key">'Fn'</code></td><td>The Function switch (Fn) key.
+ Activating this key simultaneously with another key changes that key's value to an alternate character or function.
+ This key is often handled directly in the keyboard hardware and does not usually generate key events.
+ </td></tr><tr><td class="key-table-key"><code id="key-FnLock" class="key">'FnLock'</code></td><td>The Function-Lock (FnLock, F-Lock) key.
+ Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function.
+ This key is often handled directly in the keyboard hardware and does not usually generate key events.
+ </td></tr><tr><td class="key-table-key"><code id="key-Hyper" class="key">'Hyper'</code></td><td>The Hyper key.</td></tr><tr><td class="key-table-key"><code id="key-Meta" class="key">'Meta'</code></td><td>The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input.
+ This key value is also used for the Apple <code>'Command'</code> key.
+ </td></tr><tr><td class="key-table-key"><code id="key-NumLock" class="key">'NumLock'</code></td><td>The Number Lock key, to toggle numer-pad mode function for interpreting subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-OS" class="key">'OS'</code></td><td>The operating system key (e.g. the <q>Windows Logo</q> key).</td></tr><tr><td class="key-table-key"><code id="key-Shift" class="key">'Shift'</code></td><td>The Shift key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.</td></tr><tr><td class="key-table-key"><code id="key-Super" class="key">'Super'</code></td><td>The Super key.</td></tr><tr><td class="key-table-key"><code id="key-Symbol" class="key">'Symbol'</code></td><td>The Symbol modifier key (used on some virtual keyboards).</td></tr><tr><td class="key-table-key"><code id="key-SymbolLock" class="key">'SymbolLock'</code></td><td>The Symbol Lock key.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-modifier -->
+
+
+ <div id="keys-whitespace" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-whitespace"><span class="secno">6.3.3 </span>Whitespace Keys</h4>
+ <div id="key-table-whitespace" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Enter" class="key">'Enter'</code></td><td>The Enter key, to activate current selection or accept current input.
+ This key value is also used for the <code class="key">'Return'</code> (Macintosh numpad) key.
+ </td></tr><tr><td class="key-table-key"><code id="key-Separator" class="key">'Separator'</code></td><td>The Separator key, for context-sensitive text separators.</td></tr><tr><td class="key-table-key"><code id="key-Tab" class="key">'Tab'</code></td><td>The Horizontal Tabulation (Tab) key.</td></tr></tbody></table></div>
+ <div class="note"><div class="note-title" id="h_note_99"><span>Note</span></div><p class=""><strong>Note:</strong> The space or spacebar key is encoded as <code class="glyph">' '</code>.
+ </p></div>
+ </div>
+<!-- keys-whitespace -->
+
+
+ <div id="keys-navication" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-navication"><span class="secno">6.3.4 </span>Navigation Keys</h4>
+ <div id="key-table-navigation" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-ArrowDown" class="key">'ArrowDown'</code></td><td>The down arrow key, to navigate or traverse downward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowLeft" class="key">'ArrowLeft'</code></td><td>The left arrow key, to navigate or traverse leftward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowRight" class="key">'ArrowRight'</code></td><td>The right arrow key, to navigate or traverse rightward.</td></tr><tr><td class="key-table-key"><code id="key-ArrowUp" class="key">'ArrowUp'</code></td><td>The up arrow key, to navigate or traverse upward.</td></tr><tr><td class="key-table-key"><code id="key-End" class="key">'End'</code></td><td>The End key, used with keyboard entry to go to the end of content.</td></tr><tr><td class="key-table-key"><code id="key-Home" class="key">'Home'</code></td><td>The Home key, used with keyboard entry, to go to start of content.</td></tr><tr><td class="key-table-key"><code id="key-PageDown" class="key">'PageDown'</code></td><td>The Page Down key, to scroll down or display next page of content.</td></tr><tr><td class="key-table-key"><code id="key-PageUp" class="key">'PageUp'</code></td><td>The Page Up key, to scroll up or display previous page of content.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-navigation -->
+
+
+ <div id="keys-editing" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-editing"><span class="secno">6.3.5 </span>Editing Keys</h4>
+ <div id="key-table-editing" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Backspace" class="key">'Backspace'</code></td><td>The Backspace key.
+ This key value is also used for the key labeled <code>'delete'</code> on MacOS keyboards.
+ </td></tr><tr><td class="key-table-key"><code id="key-Clear" class="key">'Clear'</code></td><td>The Clear key, for removing current selected input.</td></tr><tr><td class="key-table-key"><code id="key-Copy" class="key">'Copy'</code></td><td>The Copy key.</td></tr><tr><td class="key-table-key"><code id="key-CrSel" class="key">'CrSel'</code></td><td>The Cursor Select (Crsel) key.</td></tr><tr><td class="key-table-key"><code id="key-Cut" class="key">'Cut'</code></td><td>The Cut key.</td></tr><tr><td class="key-table-key"><code id="key-Delete" class="key">'Delete'</code></td><td>The Delete (Del) Key.
+ This key value is also used for the key labeled <code>'delete'</code> on MacOS keyboards when modified by the <code class="key">'Fn'</code> key.
+ </td></tr><tr><td class="key-table-key"><code id="key-EraseEof" class="key">'EraseEof'</code></td><td>The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field.</td></tr><tr><td class="key-table-key"><code id="key-ExSel" class="key">'ExSel'</code></td><td>The Extend Selection (Exsel) key.</td></tr><tr><td class="key-table-key"><code id="key-Insert" class="key">'Insert'</code></td><td>The Insert (Ins) key, to toggle between text modes for insertion or overtyping.</td></tr><tr><td class="key-table-key"><code id="key-Paste" class="key">'Paste'</code></td><td>The Paste key.</td></tr><tr><td class="key-table-key"><code id="key-Redo" class="key">'Redo'</code></td><td>The Redo key.</td></tr><tr><td class="key-table-key"><code id="key-Undo" class="key">'Undo'</code></td><td>The Undo key.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-editing -->
+
+
+ <div id="keys-ui" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-ui"><span class="secno">6.3.6 </span>UI Keys</h4>
+ <div id="key-table-ui" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Accept" class="key">'Accept'</code></td><td>The Accept (Commit, OK) key. Accept current option or input method sequence conversion.</td></tr><tr><td class="key-table-key"><code id="key-Again" class="key">'Again'</code></td><td>The Again key, to redo or repeat an action.</td></tr><tr><td class="key-table-key"><code id="key-Attn" class="key">'Attn'</code></td><td>The Attention (Attn) key.</td></tr><tr><td class="key-table-key"><code id="key-Cancel" class="key">'Cancel'</code></td><td>The Cancel key.</td></tr><tr><td class="key-table-key"><code id="key-ContextMenu" class="key">'ContextMenu'</code></td><td>Show the application's context menu.
+ This key is commonly found between the right <code>'OS'</code> key and the right <code>'Control'</code> key.
+ </td></tr><tr><td class="key-table-key"><code id="key-Escape" class="key">'Escape'</code></td><td>The Escape (Esc) key, to initiate an escape sequence.</td></tr><tr><td class="key-table-key"><code id="key-Execute" class="key">'Execute'</code></td><td>The Execute key.</td></tr><tr><td class="key-table-key"><code id="key-Find" class="key">'Find'</code></td><td>The Find key.</td></tr><tr><td class="key-table-key"><code id="key-Help" class="key">'Help'</code></td><td>Toggle display of help information.</td></tr><tr><td class="key-table-key"><code id="key-Pause" class="key">'Pause'</code></td><td>Pause the current state or application (as appropriate).
+ <div class="note"><div class="note-title" id="h_note_100"><span>Note</span></div><p class=""><strong>Note:</strong> Do not use this value for the pause button on media controllers. Use <code>'MediaPause'</code> instead.</p></div>
+ </td></tr><tr><td class="key-table-key"><code id="key-Play" class="key">'Play'</code></td><td>Play or resume the current state or application (as appropriate).
+ <div class="note"><div class="note-title" id="h_note_101"><span>Note</span></div><p class=""><strong>Note:</strong> Do not use this value for the play button on media controllers. Use <code>'MediaPlay'</code> instead.</p></div>
+ </td></tr><tr><td class="key-table-key"><code id="key-Props" class="key">'Props'</code></td><td>The properties (Props) key.</td></tr><tr><td class="key-table-key"><code id="key-ScrollLock" class="key">'ScrollLock'</code></td><td>The Scroll Lock key, to toggle between scrolling and cursor movement modes.</td></tr><tr><td class="key-table-key"><code id="key-ZoomIn" class="key">'ZoomIn'</code></td><td>The ZoomIn key.</td></tr><tr><td class="key-table-key"><code id="key-ZoomOut" class="key">'ZoomOut'</code></td><td>The ZoomOut key.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-ui -->
+
+
+ <div id="keys-device" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-device"><span class="secno">6.3.7 </span>Device Keys</h4>
+ <div id="key-table-device" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-BrightnessDown" class="key">'BrightnessDown'</code></td><td>The Brightness Down key. Typically controls the display brightness.</td></tr><tr><td class="key-table-key"><code id="key-BrightnessUp" class="key">'BrightnessUp'</code></td><td>The Brightness Up key. Typically controls the display brightness.</td></tr><tr><td class="key-table-key"><code id="key-Camera" class="key">'Camera'</code></td><td>The Camera key.</td></tr><tr><td class="key-table-key"><code id="key-Eject" class="key">'Eject'</code></td><td>Toggle removable media to eject (open) and insert (close) state.</td></tr><tr><td class="key-table-key"><code id="key-LogOff" class="key">'LogOff'</code></td><td>The LogOff key.</td></tr><tr><td class="key-table-key"><code id="key-Power" class="key">'Power'</code></td><td>Toggle power state.
+ <div class="note"><div class="note-title" id="h_note_102"><span>Note</span></div><p class=""><strong>Note:</strong> Some devices might not expose this key to the operating environment.</p></div>
+ </td></tr><tr><td class="key-table-key"><code id="key-PowerOff" class="key">'PowerOff'</code></td><td>The PowerOff key. Sometime called "PowerDown".</td></tr><tr><td class="key-table-key"><code id="key-PrintScreen" class="key">'PrintScreen'</code></td><td>The Print Screen (PrintScrn, SnapShot) key, to initiate print-screen function.</td></tr><tr><td class="key-table-key"><code id="key-Hibernate" class="key">'Hibernate'</code></td><td>The Hibernate key.
+ This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown.
+ </td></tr><tr><td class="key-table-key"><code id="key-Standby" class="key">'Standby'</code></td><td>The Standby key.
+ This key turns off the display and places the computer into a low-power mode without completely shutting down.
+ It is sometimes called the "Suspend" or "Sleep" key.
+ </td></tr><tr><td class="key-table-key"><code id="key-WakeUp" class="key">'WakeUp'</code></td><td>The WakeUp key.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-device -->
+
+
+ <div id="keys-composition" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_keys-composition"><span class="secno">6.3.8 </span>IME and Composition Keys</h4>
+ <div id="key-table-composition" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-AllCandidates" class="key">'AllCandidates'</code></td><td>The All Candidates key, to initate the multi-candidate mode.</td></tr><tr><td class="key-table-key"><code id="key-Alphanumeric" class="key">'Alphanumeric'</code></td><td>The Alphanumeric key.</td></tr><tr><td class="key-table-key"><code id="key-CodeInput" class="key">'CodeInput'</code></td><td>The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points.</td></tr><tr><td class="key-table-key"><code id="key-Compose" class="key">'Compose'</code></td><td>The Compose key, also known as <em>Multi_key</em> on the X Window System. This key acts in a manner similar to a
+ <a class="def" href="#glossary-dead-key">dead key</a>, triggering a mode where subsequent key presses are combined to produce a different character.
+ </td></tr><tr><td class="key-table-key"><code id="key-Convert" class="key">'Convert'</code></td><td>The Convert key, to convert the current input method sequence.</td></tr><tr><td class="key-table-key"><code id="key-FinalMode" class="key">'FinalMode'</code></td><td>The Final Mode (Final) key used on some Asian keyboards, to enable the final mode for IMEs.</td></tr><tr><td class="key-table-key"><code id="key-GroupFirst" class="key">'GroupFirst'</code></td><td>Switch to the first character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupLast" class="key">'GroupLast'</code></td><td>Switch to the last character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupNext" class="key">'GroupNext'</code></td><td>Switch to the next character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-GroupPrevious" class="key">'GroupPrevious'</code></td><td>Switch to the previous character group. (ISO/IEC 9995)</td></tr><tr><td class="key-table-key"><code id="key-ModeChange" class="key">'ModeChange'</code></td><td>The Mode Change key, to toggle between or cycle through input modes of IMEs.</td></tr><tr><td class="key-table-key"><code id="key-NextCandidate" class="key">'NextCandidate'</code></td><td>The Next Candidate function key.</td></tr><tr><td class="key-table-key"><code id="key-NonConvert" class="key">'NonConvert'</code></td><td>The Nonconvert (Don't Convert) key, to accept current input method sequence without conversion in IMEs.</td></tr><tr><td class="key-table-key"><code id="key-PreviousCandidate" class="key">'PreviousCandidate'</code></td><td>The Previous Candidate function key.</td></tr><tr><td class="key-table-key"><code id="key-Process" class="key">'Process'</code></td><td>The Process key.</td></tr><tr><td class="key-table-key"><code id="key-SingleCandidate" class="key">'SingleCandidate'</code></td><td>The Single Candidate function key.</td></tr></tbody></table></div>
+
+ <p>Keys specific to Korean keyboards</p>
+ <div id="key-table-ime-korean" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-RomanCharacters" class="key">'RomanCharacters'</code></td><td>The Roman Characters function key, also known as the <code>'Youngja'</code> or <code>'Young'</code> key.</td></tr><tr><td class="key-table-key"><code id="key-HangulMode" class="key">'HangulMode'</code></td><td>The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes.</td></tr><tr><td class="key-table-key"><code id="key-HanjaMode" class="key">'HanjaMode'</code></td><td>The Hanja (Korean characters) Mode key.</td></tr><tr><td class="key-table-key"><code id="key-JunjaMode" class="key">'JunjaMode'</code></td><td>The Junja (Korean characters) Mode key.</td></tr></tbody></table></div>
+
+ <p>Keys specific to Japanese keyboards</p>
+ <div id="key-table-ime-japanese" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Zenkaku" class="key">'Zenkaku'</code></td><td>The Zenkaku (Full-Width) Characters key.</td></tr><tr><td class="key-table-key"><code id="key-Hankaku" class="key">'Hankaku'</code></td><td>The (Half-Width) Characters key.</td></tr><tr><td class="key-table-key"><code id="key-ZenkakuHankaku" class="key">'ZenkakuHankaku'</code></td><td>The Zenkaku/Hankaku (full-width/half-width) toggle key.</td></tr><tr><td class="key-table-key"><code id="key-KanaMode" class="key">'KanaMode'</code></td><td>The Kana Mode (Kana Lock) key.</td></tr><tr><td class="key-table-key"><code id="key-KanjiMode" class="key">'KanjiMode'</code></td><td>The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.</td></tr><tr><td class="key-table-key"><code id="key-Hiragana" class="key">'Hiragana'</code></td><td>The Hiragana (Japanese Kana characters) key.</td></tr><tr><td class="key-table-key"><code id="key-Katakana" class="key">'Katakana'</code></td><td>The Katakana (Japanese Kana characters) key.</td></tr><tr><td class="key-table-key"><code id="key-HiraganaKatakana" class="key">'HiraganaKatakana'</code></td><td>The Hiragana/Katakana toggle key.</td></tr><tr><td class="key-table-key"><code id="key-Eisu" class="key">'Eisu'</code></td><td>The Eisu key. This key may close the IME, but it's purpose is defined by the current IME.</td></tr></tbody></table></div>
+
+ <div id="keys-function" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keys-function">General-Purpose Function Keys</h5>
+ <p>The exact number of these general purpose function keys varies on different platforms, and only the first
+ few are defined explicitly here. Additional function key names are implicitly defined by incrementing the
+ base-10 index at the end of the function key name. Thus, <span class="key">'F24'</span>
+ and <span class="key">'Soft8'</span> are all valid key values.
+ </p>
+ <div id="key-table-function" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-F1" class="key">'F1'</code></td><td>The F1 key, a general purpose function key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-F2" class="key">'F2'</code></td><td>The F2 key, a general purpose function key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-F3" class="key">'F3'</code></td><td>The F3 key, a general purpose function key, as index 3.</td></tr><tr><td class="key-table-key"><code id="key-F4" class="key">'F4'</code></td><td>The F4 key, a general purpose function key, as index 4.</td></tr><tr><td class="key-table-key"><code id="key-F5" class="key">'F5'</code></td><td>The F5 key, a general purpose function key, as index 5.</td></tr><tr><td class="key-table-key"><code id="key-F6" class="key">'F6'</code></td><td>The F6 key, a general purpose function key, as index 6.</td></tr><tr><td class="key-table-key"><code id="key-F7" class="key">'F7'</code></td><td>The F7 key, a general purpose function key, as index 7.</td></tr><tr><td class="key-table-key"><code id="key-F8" class="key">'F8'</code></td><td>The F8 key, a general purpose function key, as index 8.</td></tr><tr><td class="key-table-key"><code id="key-F9" class="key">'F9'</code></td><td>The F9 key, a general purpose function key, as index 9.</td></tr><tr><td class="key-table-key"><code id="key-F10" class="key">'F10'</code></td><td>The F10 key, a general purpose function key, as index 10.</td></tr><tr><td class="key-table-key"><code id="key-F11" class="key">'F11'</code></td><td>The F11 key, a general purpose function key, as index 11.</td></tr><tr><td class="key-table-key"><code id="key-F12" class="key">'F12'</code></td><td>The F12 key, a general purpose function key, as index 12.</td></tr><tr><td class="key-table-key"><code id="key-Soft1" class="key">'Soft1'</code></td><td>General purpose virtual function key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-Soft2" class="key">'Soft2'</code></td><td>General purpose virtual function key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-Soft3" class="key">'Soft3'</code></td><td>General purpose virtual function key, as index 3.</td></tr><tr><td class="key-table-key"><code id="key-Soft4" class="key">'Soft4'</code></td><td>General purpose virtual function key, as index 4.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-function -->
+
+
+ <div id="keys-multimedia" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keys-multimedia">Mediamedia Keys</h5>
+ <p>These are extra keys found on "multimedia" keyboards.</p>
+
+ <div id="key-table-multimedia" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-Close" class="key">'Close'</code></td><td>Close the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-MailForward" class="key">'MailForward'</code></td><td>Open an editor to forward the current message.</td></tr><tr><td class="key-table-key"><code id="key-MailReply" class="key">'MailReply'</code></td><td>Open an editor to reply to the current message.</td></tr><tr><td class="key-table-key"><code id="key-MailSend" class="key">'MailSend'</code></td><td>Send the current message.</td></tr><tr><td class="key-table-key"><code id="key-MediaPlayPause" class="key">'MediaPlayPause'</code></td><td>Toggle media between play and pause states.</td></tr><tr><td class="key-table-key"><code id="key-MediaSelect" class="key">'MediaSelect'</code></td><td>Select media.</td></tr><tr><td class="key-table-key"><code id="key-MediaStop" class="key">'MediaStop'</code></td><td>Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped.</td></tr><tr><td class="key-table-key"><code id="key-MediaTrackNext" class="key">'MediaTrackNext'</code></td><td>Seek to next media or program track.</td></tr><tr><td class="key-table-key"><code id="key-MediaTrackPrevious" class="key">'MediaTrackPrevious'</code></td><td>Seek to previous media or program track.</td></tr><tr><td class="key-table-key"><code id="key-New" class="key">'New'</code></td><td>Open a new document or message.</td></tr><tr><td class="key-table-key"><code id="key-Open" class="key">'Open'</code></td><td>Open an existing document or message.</td></tr><tr><td class="key-table-key"><code id="key-Print" class="key">'Print'</code></td><td>Print the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-Save" class="key">'Save'</code></td><td>Save the current document or message.</td></tr><tr><td class="key-table-key"><code id="key-SpellCheck" class="key">'SpellCheck'</code></td><td>Spellcheck the current document or selection.</td></tr><tr><td class="key-table-key"><code id="key-VolumeDown" class="key">'VolumeDown'</code></td><td>Decrease audio volume.</td></tr><tr><td class="key-table-key"><code id="key-VolumeUp" class="key">'VolumeUp'</code></td><td>Increase audio volume.</td></tr><tr><td class="key-table-key"><code id="key-VolumeMute" class="key">'VolumeMute'</code></td><td>Toggle between muted state and prior volume level.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-function -->
+
+
+ <div id="keys-apps" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keys-apps">Application Keys</h5>
+ <p>The exact number of these LaunchApplication keys varies on different platforms, and only the first
+ few are defined explicitly here. Additional key names are implicitly defined by incrementing the
+ base-10 index at the end of the function key name. Thus
+ <span class="key">'LaunchApplication12'</span> is a valid key value.
+ </p>
+
+<!-- Key tables. Note that all keys must be defined within a <div class="key-table"> -->
+
+ <div id="key-table-apps" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-LaunchCalculator" class="key">'LaunchCalculator'</code></td><td>The 'Calculator' key. This is often the generic 'LaunchApplication' key, as index 2.</td></tr><tr><td class="key-table-key"><code id="key-LaunchCalendar" class="key">'LaunchCalendar'</code></td><td>The 'Calendar' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMail" class="key">'LaunchMail'</code></td><td>The 'Mail' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMediaPlayer" class="key">'LaunchMediaPlayer'</code></td><td>The 'Media Player' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMusicPlayer" class="key">'LaunchMusicPlayer'</code></td><td>The 'Music Player' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchMyComputer" class="key">'LaunchMyComputer'</code></td><td>The 'My Computer' key. This is often the generic 'LaunchApplication' key, as index 1.</td></tr><tr><td class="key-table-key"><code id="key-LaunchScreenSaver" class="key">'LaunchScreenSaver'</code></td><td>The 'Screen Saver' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchSpreadsheet" class="key">'LaunchSpreadsheet'</code></td><td>The 'Spreadsheet' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWebBrowser" class="key">'LaunchWebBrowser'</code></td><td>The 'Web Browser' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWebCam" class="key">'LaunchWebCam'</code></td><td>The 'WebCam' key.</td></tr><tr><td class="key-table-key"><code id="key-LaunchWordProcessor" class="key">'LaunchWordProcessor'</code></td><td>The 'Word Processor' key.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-apps -->
+
+
+ <div id="keys-browser" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keys-browser">Browser Keys</h5>
+ <div id="key-table-browser" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-BrowserBack" class="key">'BrowserBack'</code></td><td>Navigate to previous content or page in current history.</td></tr><tr><td class="key-table-key"><code id="key-BrowserFavorites" class="key">'BrowserFavorites'</code></td><td>The Browser Favorites key.</td></tr><tr><td class="key-table-key"><code id="key-BrowserForward" class="key">'BrowserForward'</code></td><td>Navigate to next content or page in current history.</td></tr><tr><td class="key-table-key"><code id="key-BrowserHome" class="key">'BrowserHome'</code></td><td>The Browser Home key, used with keyboard entry, to go to the home page.</td></tr><tr><td class="key-table-key"><code id="key-BrowserRefresh" class="key">'BrowserRefresh'</code></td><td>The Browser Refresh key, to refresh the current page or content.</td></tr><tr><td class="key-table-key"><code id="key-BrowserSearch" class="key">'BrowserSearch'</code></td><td>The Browser Search key, to call up the user's preferred search page.</td></tr><tr><td class="key-table-key"><code id="key-BrowserStop" class="key">'BrowserStop'</code></td><td>The Browser Stop key, to stop loading the current page or content.</td></tr></tbody></table></div>
+ </div>
+<!-- keys-browser -->
+
+
+ <div id="keys-media-controller" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keys-media-controller">Media Controller Keys</h5>
+
+ <p>The <a class="def" href="#glossary-key-value">key values</a> for media controllers (e.g. remote controls for television, audio systems, and set-top boxes)
+ are derived in part from the consumer electronics technical specifications:</p>
+ <ul>
+ <li>DTV Application Software Environment [<cite><a href="#references-DASE">DASE</a></cite>]</li>
+ <li>Open Cable Application Platform 1.1.3 [<cite><a href="#references-OCAP">OCAP</a></cite>]</li>
+ <li>ANSI/CEA-2014-B, Web-based Protocol and Framework for Remote User Interface on UPnPTM Networks and the Internet [<cite><a href="#references-WEB4CE">WEB4CE</a></cite>]</li>
+ </ul>
+ <p></p>
+
+ <div id="key-table-media-controller" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code id="key-AudioBalanceLeft" class="key">'AudioBalanceLeft'</code></td><td>Adjust audio balance leftward. (VK_AUDIO_BALANCE_LEFT)</td></tr><tr><td class="key-table-key"><code id="key-AudioBalanceRight" class="key">'AudioBalanceRight'</code></td><td>Adjust audio balance rightward. (VK_AUDIO_BALANCE_RIGHT)</td></tr><tr><td class="key-table-key"><code id="key-AudioBassBoostDown" class="key">'AudioBassBoostDown'</code></td><td>Decrease audio bass boost or cycle down through bass boost states. (VK_BASS_BOOST_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-AudioBassBoostUp" class="key">'AudioBassBoostUp'</code></td><td>Increase audio bass boost or cycle up through bass boost states. (VK_BASS_BOOST_UP)</td></tr><tr><td class="key-table-key"><code id="key-AudioFaderFront" class="key">'AudioFaderFront'</code></td><td>Adjust audio fader towards front. (VK_FADER_FRONT)</td></tr><tr><td class="key-table-key"><code id="key-AudioFaderRear" class="key">'AudioFaderRear'</code></td><td>Adjust audio fader towards rear. (VK_FADER_REAR)</td></tr><tr><td class="key-table-key"><code id="key-AudioSurroundModeNext" class="key">'AudioSurroundModeNext'</code></td><td>Advance surround audio mode to next available mode. (VK_SURROUND_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-ChannelDown" class="key">'ChannelDown'</code></td><td>Select next (numerically or logically) lower channel. (VK_CHANNEL_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-ChannelUp" class="key">'ChannelUp'</code></td><td>Select next (numerically or logically) higher channel. (VK_CHANNEL_UP)</td></tr><tr><td class="key-table-key"><code id="key-ColorF0Red" class="key">'ColorF0Red'</code></td><td>General purpose color-coded media function key, as index 0 (red). (VK_COLORED_KEY_0)</td></tr><tr><td class="key-table-key"><code id="key-ColorF1Green" class="key">'ColorF1Green'</code></td><td>General purpose color-coded media function key, as index 1 (green). (VK_COLORED_KEY_1)</td></tr><tr><td class="key-table-key"><code id="key-ColorF2Yellow" class="key">'ColorF2Yellow'</code></td><td>General purpose color-coded media function key, as index 2 (yellow). (VK_COLORED_KEY_2)</td></tr><tr><td class="key-table-key"><code id="key-ColorF3Blue" class="key">'ColorF3Blue'</code></td><td>General purpose color-coded media function key, as index 3 (blue). (VK_COLORED_KEY_3)</td></tr><tr><td class="key-table-key"><code id="key-ColorF4Grey" class="key">'ColorF4Grey'</code></td><td>General purpose color-coded media function key, as index 4 (grey). (VK_COLORED_KEY_4)</td></tr><tr><td class="key-table-key"><code id="key-ColorF5Brown" class="key">'ColorF5Brown'</code></td><td>General purpose color-coded media function key, as index 5 (brown). (VK_COLORED_KEY_5)</td></tr><tr><td class="key-table-key"><code id="key-ClosedCaptionToggle" class="key">'ClosedCaptionToggle'</code></td><td>Toggle the display of Closed Captions. (VK_CC)</td></tr><tr><td class="key-table-key"><code id="key-Dimmer" class="key">'Dimmer'</code></td><td>Adjust brightness of device, by toggling between or cycling through states. (VK_DIMMER)</td></tr><tr><td class="key-table-key"><code id="key-DisplaySwap" class="key">'DisplaySwap'</code></td><td>Swap video sources. (VK_DISPLAY_SWAP)</td></tr><tr><td class="key-table-key"><code id="key-Exit" class="key">'Exit'</code></td><td>Exit the current application. (VK_EXIT)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear0" class="key">'FavoriteClear0'</code></td><td>Clear program or content stored as favorite 0. (VK_CLEAR_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear1" class="key">'FavoriteClear1'</code></td><td>Clear program or content stored as favorite 1. (VK_CLEAR_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear2" class="key">'FavoriteClear2'</code></td><td>Clear program or content stored as favorite 2. (VK_CLEAR_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteClear3" class="key">'FavoriteClear3'</code></td><td>Clear program or content stored as favorite 3. (VK_CLEAR_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall0" class="key">'FavoriteRecall0'</code></td><td>Select (recall) program or content stored as favorite 0. (VK_RECALL_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall1" class="key">'FavoriteRecall1'</code></td><td>Select (recall) program or content stored as favorite 1. (VK_RECALL_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall2" class="key">'FavoriteRecall2'</code></td><td>Select (recall) program or content stored as favorite 2. (VK_RECALL_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteRecall3" class="key">'FavoriteRecall3'</code></td><td>Select (recall) program or content stored as favorite 3. (VK_RECALL_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore0" class="key">'FavoriteStore0'</code></td><td>Store current program or content as favorite 0. (VK_STORE_FAVORITE_0)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore1" class="key">'FavoriteStore1'</code></td><td>Store current program or content as favorite 1. (VK_STORE_FAVORITE_1)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore2" class="key">'FavoriteStore2'</code></td><td>Store current program or content as favorite 2. (VK_STORE_FAVORITE_2)</td></tr><tr><td class="key-table-key"><code id="key-FavoriteStore3" class="key">'FavoriteStore3'</code></td><td>Store current program or content as favorite 3. (VK_STORE_FAVORITE_3)</td></tr><tr><td class="key-table-key"><code id="key-Guide" class="key">'Guide'</code></td><td>Toggle display of program or content guide. (VK_GUIDE)</td></tr><tr><td class="key-table-key"><code id="key-GuideNextDay" class="key">'GuideNextDay'</code></td><td>If guide is active and displayed, then display next day's content. (VK_NEXT_DAY)</td></tr><tr><td class="key-table-key"><code id="key-GuidePreviousDay" class="key">'GuidePreviousDay'</code></td><td>If guide is active and displayed, then display previous day's content. (VK_PREV_DAY)</td></tr><tr><td class="key-table-key"><code id="key-Info" class="key">'Info'</code></td><td>Toggle display of information about currently selected context or media. (VK_INFO)</td></tr><tr><td class="key-table-key"><code id="key-InstantReplay" class="key">'InstantReplay'</code></td><td>Toggle instant replay. (VK_INSTANT_REPLAY)</td></tr><tr><td class="key-table-key"><code id="key-Link" class="key">'Link'</code></td><td>Launch linked content, if available and appropriate. (VK_LINK)</td></tr><tr><td class="key-table-key"><code id="key-ListProgram" class="key">'ListProgram'</code></td><td>List the current program. (VK_LIST)</td></tr><tr><td class="key-table-key"><code id="key-LiveContent" class="key">'LiveContent'</code></td><td>Toggle display listing of currently available live content or programs. (VK_LIVE)</td></tr><tr><td class="key-table-key"><code id="key-Lock" class="key">'Lock'</code></td><td>Lock or unlock current content or program. (VK_LOCK)</td></tr><tr><td class="key-table-key"><code id="key-MediaApps" class="key">'MediaApps'</code></td><td>Show a list of media applications. (VK_APPS)
+ <div class="note"><div class="note-title" id="h_note_103"><span>Note</span></div><p class=""><strong>Note:</strong> Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as <code>'ContextMenu'</code>.</p></div>
+ </td></tr><tr><td class="key-table-key"><code id="key-MediaFastForward" class="key">'MediaFastForward'</code></td><td>Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. (VK_FAST_FWD)</td></tr><tr><td class="key-table-key"><code id="key-MediaLast" class="key">'MediaLast'</code></td><td>Select previously selected channel or media. (VK_LAST)</td></tr><tr><td class="key-table-key"><code id="key-MediaPause" class="key">'MediaPause'</code></td><td>Pause the currently playing media. (VK_PAUSE)
+ <div class="note"><div class="note-title" id="h_note_104"><span>Note</span></div><p class=""><strong>Note:</strong> Media controller devices should use this value rather than <code>'Pause'</code> for their pause keys.</p></div>
+ </td></tr><tr><td class="key-table-key"><code id="key-MediaPlay" class="key">'MediaPlay'</code></td><td>Initiate or continue media playback at normal speed, if not currently playing at normal speed. (VK_PLAY)</td></tr><tr><td class="key-table-key"><code id="key-MediaRecord" class="key">'MediaRecord'</code></td><td>Initiate or resume recording of currently selected media. (VK_RECORD)</td></tr><tr><td class="key-table-key"><code id="key-MediaRewind" class="key">'MediaRewind'</code></td><td>Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. (VK_REWIND)</td></tr><tr><td class="key-table-key"><code id="key-MediaSkip" class="key">'MediaSkip'</code></td><td>Skip forward to next content or program. (VK_SKIP)</td></tr><tr><td class="key-table-key"><code id="key-NextFavoriteChannel" class="key">'NextFavoriteChannel'</code></td><td>Cycle to next favorite channel (in favorites list). (VK_NEXT_FAVORITE_CHANNEL)</td></tr><tr><td class="key-table-key"><code id="key-NextUserProfile" class="key">'NextUserProfile'</code></td><td>Cycle to next user profile (if there are multiple user profiles). (VK_USER)</td></tr><tr><td class="key-table-key"><code id="key-OnDemand" class="key">'OnDemand'</code></td><td>Access on-demand content or programs. (VK_ON_DEMAND)</td></tr><tr><td class="key-table-key"><code id="key-PinPDown" class="key">'PinPDown'</code></td><td>Move picture-in-picture window down. (VK_PINP_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-PinPMove" class="key">'PinPMove'</code></td><td>Move picture-in-picture window. (VK_PINP_MOVE)</td></tr><tr><td class="key-table-key"><code id="key-PinPToggle" class="key">'PinPToggle'</code></td><td>Toggle display of picture-in-picture window. (VK_PINP_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-PinPUp" class="key">'PinPUp'</code></td><td>Move picture-in-picture window up. (VK_PINP_UP)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedDown" class="key">'PlaySpeedDown'</code></td><td>Decrease media playback speed. (VK_PLAY_SPEED_DOWN)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedReset" class="key">'PlaySpeedReset'</code></td><td>Reset playback to normal speed. (VK_PLAY_SPEED_RESET)</td></tr><tr><td class="key-table-key"><code id="key-PlaySpeedUp" class="key">'PlaySpeedUp'</code></td><td>Increase media playback speed. (VK_PLAY_SPEED_UP)</td></tr><tr><td class="key-table-key"><code id="key-RandomToggle" class="key">'RandomToggle'</code></td><td>Toggle random media or content shuffle mode. (VK_RANDOM_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-RcLowBattery" class="key">'RcLowBattery'</code></td><td>Not a physical key, but this key code is sent when the remote control battery is low. (VK_RC_LOW_BATTERY)</td></tr><tr><td class="key-table-key"><code id="key-RecordSpeedNext" class="key">'RecordSpeedNext'</code></td><td>Toggle or cycle between media recording speeds. (VK_RECORD_SPEED_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-RfBypass" class="key">'RfBypass'</code></td><td>Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). (VK_RF_BYPASS)</td></tr><tr><td class="key-table-key"><code id="key-ScanChannelsToggle" class="key">'ScanChannelsToggle'</code></td><td>Toggle scan channels mode. (VK_SCAN_CHANNELS_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-ScreenModeNext" class="key">'ScreenModeNext'</code></td><td>Advance display screen mode to next available mode. (VK_SCREEN_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-Settings" class="key">'Settings'</code></td><td>Toggle display of device settings screen. (VK_SETTINGS)</td></tr><tr><td class="key-table-key"><code id="key-SplitScreenToggle" class="key">'SplitScreenToggle'</code></td><td>Toggle split screen mode. (VK_SPLIT_SCREEN_TOGGLE)</td></tr><tr><td class="key-table-key"><code id="key-Subtitle" class="key">'Subtitle'</code></td><td>Toggle display of subtitles, if available. (VK_SUBTITLE)</td></tr><tr><td class="key-table-key"><code id="key-Teletext" class="key">'Teletext'</code></td><td>Toggle display of teletext, if available (VK_TELETEXT).</td></tr><tr><td class="key-table-key"><code id="key-VideoModeNext" class="key">'VideoModeNext'</code></td><td>Advance video mode to next available mode.(VK_VIDEO_MODE_NEXT)</td></tr><tr><td class="key-table-key"><code id="key-Wink" class="key">'Wink'</code></td><td>Cause device to identify itself in some manner, e.g., audibly or visibly. (VK_WINK)</td></tr><tr><td class="key-table-key"><code id="key-ZoomToggle" class="key">'ZoomToggle'</code></td><td>Toggle between full-screen and scaled content, or alter magnification level. (VK_ZOOM)</td></tr></tbody></table></div>
+
+ <p>Some of the keys defined in the media controller standards already have appropriate keys defined in other sections of this specification.
+ These following table summarizes the key values that <em class="rfc2119" title="MUST">MUST</em> be used:
+ </p>
+
+ <div id="key-table-media-controller-dup" class="key-table"><table class="data-table key-value-table"><tbody><tr><th width="20%">Key</th><th width="80%">Typical Usage (Informative)</th></tr><tr><td class="key-table-key"><code class="key">'BrowserBack'</code></td><td>Navigate to previous content or page in current history. (VK_BACK)</td></tr><tr><td class="key-table-key"><code class="key">'BrowserForward'</code></td><td>Navigate to next content or page in current history. (VK_FORWARD)</td></tr><tr><td class="key-table-key"><code class="key">'ContextMenu'</code></td><td>Toggle display of the on-screen menu. (VK_MENU)</td></tr><tr><td class="key-table-key"><code class="key">'Eject'</code></td><td>Toggle removable media to eject (open) and insert (close) state. (VK_EJECT_TOGGLE)</td></tr><tr><td class="key-table-key"><code class="key">'End'</code></td><td>The End key, used with keyboard entry to go to the end of content. (VK_GO_TO_END)</td></tr><tr><td class="key-table-key"><code class="key">'Enter'</code></td><td>The Enter key, to activate current selection or accept current input. (VK_SELECT)</td></tr><tr><td class="key-table-key"><code class="key">'Home'</code></td><td>The Home key, used with keyboard entry, to go to start of content. (VK_GO_TO_START)</td></tr><tr><td class="key-table-key"><code class="key">'MediaPlayPause'</code></td><td>Toggle media between play and pause states. (VK_PLAY_PAUSE)</td></tr><tr><td class="key-table-key"><code class="key">'MediaStop'</code></td><td>Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. (VK_STOP)</td></tr><tr><td class="key-table-key"><code class="key">'MediaTrackNext'</code></td><td>Seek to next media or program track. (VK_TRACK_NEXT)</td></tr><tr><td class="key-table-key"><code class="key">'MediaTrackPrevious'</code></td><td>Seek to previous media or program track. (VK_TRACK_PREV)</td></tr><tr><td class="key-table-key"><code class="key">'Power'</code></td><td>Toggle power state. (VK_POWER)</td></tr><tr><td class="key-table-key"><code class="key">'Unidentified'</code></td><td>This key value is used when an implementations is unable to identify another key value, due to either hardware, platform, or software constraints. (VK_UNDEFINED)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeDown'</code></td><td>Decrease audio volume. (VK_VOLUME_DOWN)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeUp'</code></td><td>Increase audio volume. (VK_VOLUME_UP)</td></tr><tr><td class="key-table-key"><code class="key">'VolumeMute'</code></td><td>Toggle between muted state and prior volume level. (VK_VOLUME_MUTE)</td></tr></tbody></table></div>
+
+ </div>
+<!-- keys-media-controller -->
+
+
+ </div>
+
+ </div>
+
+
+<!-- Appendix A: Initializing New Event Interfaces ========================================================-->
+
+ <div id="new-event-interface-initializers" class="appendix section" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+ <h3 id="h3_new-event-interface-initializers"><span class="secno">6.4 </span>Initializing New Event Interfaces</h3>
+
+ <p><em>This section is informative</em></p>
+
+ <p>This specification defines several new event interfaces without a mechanism for content authors to initialize their respective events.</p>
+
+ <p>These new event interfaces are:</p>
+
+ <ul>
+ <li><a href="#interface-CustomEvent"><code>CustomEvent</code></a></li>
+ <li><a href="#interface-FocusEvent"><code>FocusEvent</code></a></li>
+ <li><a href="#interface-WheelEvent"><code>WheelEvent</code></a></li>
+ <li><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></li>
+ <li><a href="#interface-CompositionEvent"><code>CompositionEvent</code></a></li>
+ </ul>
+
+ <p>In DOM Level 2 Events, the initialization of these event interfaces was possible through an init method on the interface (for example <code>initMouseEvent</code>).
+ These init methods needed a long list of parameters that, in most cases, did not fully initialize all attributes of the event object. In order to fully initialize
+ an event interface which was derived from the basic <code>Event</code> interface, it was necessary to call the initializer of each of the derived interfaces explicitly.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>Initializing all the attributes of a MutationEvent requires calls to two initializer methods: <code>initEvent</code> and
+ <code>initMutationEvent</code>.</p>
+ </div>
+
+ <p>Due in part to the length of time in the development of this standard, some implementations <em class="rfc2119" title="MAY">MAY</em> have taken a dependency on a set of initializer methods that were
+ formerly defined in this specification. For completeness, these legacy event intializers are described in this Appendix.</p>
+
+ <p>The initialization of new derived event objects becomes easier with the introduction of event constructors in
+ [<a href="#references-UIEvents">UI Events</a>]. Event constructors
+ are a new mechanism for initializing the event object's attributes that allows authors to pick-and-choose which of all the possible event attributes <em class="rfc2119" title="SHOULD">SHOULD</em> be initialized to
+ a value. For the omitted values, a suitable default is applied.</p>
+
+ <p>This specification does not require a conforming implementation to support event constructors. Likewise it does not require a conforming implementation to support
+ the legacy event initializers. However, it would be prudent for a conforming implementation to support one or the other, so that authors have some mechanism to initilize
+ the new event interfaces defined in this specification.</p>
+
+ <div class="note"><div class="note-title" id="h_note_105"><span>Note</span></div><p class=""><strong>Note: </strong>Event constructors are a relatively new concept and are subject to change. For the latest syntax, please refer to the UI Events specification
+ [<a href="#references-UIEvents">UI Events</a>].</p></div>
+
+ <div id="event-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_event-initializers"><span class="secno">6.4.1 </span>Supplemental Initializer Interfaces</h4>
+ <p><em>This section is informative</em></p>
+ <p>
+ This section documents legacy initializer methods <b>and</b> suggested event constructors for the following event interfaces introduced in DOM Level 3 Events:
+ </p>
+ <ul>
+ <li><a href="#idl-interface-CustomEvent-initializers"><code>CustomEvent</code></a></li>
+ <li><a href="#idl-interface-FocusEvent-initializers"><code>FocusEvent</code></a></li>
+ <li><a href="#idl-interface-WheelEvent-initializers"><code>WheelEvent</code></a></li>
+ <li><a href="#idl-interface-KeyboardEvent-initializers"><code>KeyboardEvent</code></a></li>
+ <li><a href="#idl-interface-CompositionEvent-initializers"><code>CompositionEvent</code></a></li>
+ </ul>
+ <p>
+ This section also documents suggested event constructors for the following event interfaces which were introduced in DOM Level 2 Events [<a href="#references-DOM2Events">DOM2 Events</a>] and deprecated in this specification:
+ </p>
+ <ul>
+ <li><a href="#idl-interface-UIEvent-initializers"><code>UIEvent</code></a></li>
+ <li><a href="#idl-interface-MouseEvent-initializers"><code>MouseEvent</code></a></li>
+ </ul>
+ <p>
+ For completeness, this section also documents suggested event constructors for the following event interfaces which were introduced in DOM Level 2 Events [<a href="#references-DOM2Events">DOM2 Events</a>] but not deprecated in this specification:
+ </p>
+ <ul>
+ <li><a href="#idl-interface-Event-initializers"><code>Event</code></a></li>
+ </ul>
+
+ <div id="idl-interface-Event-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-Event-initializers">Initializers for interface Event</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-EventInit">dictionary <span class="idlDictionaryID">EventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-EventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-EventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-eventinit-members">Dictionary <a class="idlType" href="#idl-def-EventInit"><code>EventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-EventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-EventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-Event-1">[<span class="extAttr">Constructor(DOMString typeArg, optional EventInit eventInitDict</span>]
+partial interface <span class="idlInterfaceID">Event</span> {
+};</span></pre>
+ </div>
+
+ <div id="idl-interface-CustomEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-CustomEvent-initializers">Initializers for interface CustomEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-CustomEventInit">dictionary <span class="idlDictionaryID">CustomEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">any</span> <span class="idlMemberName"><a href="#widl-CustomEventInit-detail">detail</a></span> = <span class="idlMemberValue">null</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-customeventinit-members">Dictionary <a class="idlType" href="#idl-def-CustomEventInit"><code>CustomEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-CustomEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CustomEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CustomEventInit-detail"><code>detail</code> of type <span class="idlMemberType">any</span>, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-CustomEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional CustomEventInit customEventInitDict</span>]
+partial interface <span class="idlInterfaceID">CustomEvent</span> {
+<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-CustomEvent-initCustomEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-any-detailArg">initCustomEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">any</span> <span class="idlParamName">detailArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-6">Methods</h6><dl class="methods"><dt id="widl-CustomEvent-initCustomEvent"><code>initCustomEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>CustomEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initCustomEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
+ syntax for initializing a <code>CustomEvent</code>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-CustomEvent-detail"><code>CustomEvent.detail</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-UIEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-UIEvent-initializers">Initializers for interface UIEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-UIEventInit">dictionary <span class="idlDictionaryID">UIEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-UIEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-UIEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-UIEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-UIEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-uieventinit-members">Dictionary <a class="idlType" href="#idl-def-UIEventInit"><code>UIEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-UIEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-UIEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-UIEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-UIEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-UIEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional UIEventInit uiEventInitDict</span>]
+partial interface <span class="idlInterfaceID">UIEvent</span> {
+<span class="idlSectionComment"> // Deprecated in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-UIEvent-initUIEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg">initUIEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-7">Methods</h6><dl class="methods"><dt id="widl-UIEvent-initUIEvent"><code>initUIEvent</code></dt><dd>
+ <p>Initializes attributes of an <code>UIEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initUIEvent</code> method is deprecated, but supported for backwards-compatibility with widely-deployed
+ implementations. See [<a href="#references-UIEvents">UI Events</a>] for an alternate initializer syntax.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-UIEvent-view"><code>UIEvent.view</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p>
+ </td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a>.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-FocusEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-FocusEvent-initializers">Initializers for interface FocusEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-FocusEventInit">dictionary <span class="idlDictionaryID">FocusEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-FocusEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-focuseventinit-members">Dictionary <a class="idlType" href="#idl-def-FocusEventInit"><code>FocusEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-FocusEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-FocusEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-FocusEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-FocusEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-FocusEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-FocusEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict</span>]
+partial interface <span class="idlInterfaceID">FocusEvent</span> {
+<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-FocusEvent-initFocusEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-EventTarget-relatedTargetArg">initFocusEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-8">Methods</h6><dl class="methods"><dt id="widl-FocusEvent-initFocusEvent"><code>initFocusEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>FocusEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initFocusEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
+ syntax for initializing a <code>FocusEvent</code>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-FocusEvent-relatedTarget"><code>FocusEvent.relatedTarget</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-MouseEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-MouseEvent-initializers">Initializers for interface MouseEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-MouseEventInit">dictionary <span class="idlDictionaryID">MouseEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-screenX">screenX</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-screenY">screenY</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-clientX">clientX</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-clientY">clientY</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-button">button</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-buttons">buttons</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-MouseEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-mouseeventinit-members">Dictionary <a class="idlType" href="#idl-def-MouseEventInit"><code>MouseEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-MouseEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-button"><code>button</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-buttons"><code>buttons</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-clientX"><code>clientX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-clientY"><code>clientY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-MouseEventInit-screenX"><code>screenX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-screenY"><code>screenY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-MouseEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-MouseEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-MouseEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict</span>]
+partial interface <span class="idlInterfaceID">MouseEvent</span> {
+<span class="idlSectionComment"> // Deprecated in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-MouseEvent-initMouseEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-long-screenXArg-long-screenYArg-long-clientXArg-long-clientYArg-boolean-ctrlKeyArg-boolean-altKeyArg-boolean-shiftKeyArg-boolean-metaKeyArg-unsigned-short-buttonArg-EventTarget-relatedTargetArg">initMouseEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenYArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientYArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">ctrlKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">altKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">shiftKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">metaKeyArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">buttonArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-9">Methods</h6><dl class="methods"><dt id="widl-MouseEvent-initMouseEvent"><code>initMouseEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>MouseEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initMouseEvent</code> method is deprecated, but supported for backwards-compatibility with widely-deployed
+ implementations. See [<a href="#references-UIEvents">UI Events</a>] for an alternate initializer syntax.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">screenXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-screenX"><code>MouseEvent.screenX</code></a>.</p>
+ </td></tr><tr><td class="prmName">screenYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-screenY"><code>MouseEvent.screenY</code></a>.</p>
+ </td></tr><tr><td class="prmName">clientXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-clientX"><code>MouseEvent.clientX</code></a>.</p>
+ </td></tr><tr><td class="prmName">clientYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-clientY"><code>MouseEvent.clientY</code></a>.</p>
+ </td></tr><tr><td class="prmName">ctrlKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-ctrlKey"><code>MouseEvent.ctrlKey</code></a>.</p>
+ </td></tr><tr><td class="prmName">altKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-altKey"><code>MouseEvent.altKey</code></a>.</p>
+ </td></tr><tr><td class="prmName">shiftKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-shiftKey"><code>MouseEvent.shiftKey</code></a>.</p>
+ </td></tr><tr><td class="prmName">metaKeyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-metaKey"><code>MouseEvent.metaKey</code></a>.</p>
+ </td></tr><tr><td class="prmName">buttonArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-button"><code>MouseEvent.button</code></a>.</p>
+ </td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MouseEvent-relatedTarget"><code>MouseEvent.relatedTarget</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>null</code>.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-WheelEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-WheelEvent-initializers">Initializers for interface WheelEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-WheelEventInit">dictionary <span class="idlDictionaryID">WheelEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-screenX">screenX</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-screenY">screenY</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-clientX">clientX</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-clientY">clientY</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-button">button</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned short</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-buttons">buttons</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-relatedTarget">relatedTarget</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaX">deltaX</a></span> = <span class="idlMemberValue">0.0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaY">deltaY</a></span> = <span class="idlMemberValue">0.0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">double</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaZ">deltaZ</a></span> = <span class="idlMemberValue">0.0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-WheelEventInit-deltaMode">deltaMode</a></span> = <span class="idlMemberValue">0</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-wheeleventinit-members">Dictionary <a class="idlType" href="#idl-def-WheelEventInit"><code>WheelEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-WheelEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-button"><code>button</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-buttons"><code>buttons</code> of type <span class="idlMemberType">unsigned short</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-clientX"><code>clientX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-clientY"><code>clientY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaMode"><code>deltaMode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaX"><code>deltaX</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaY"><code>deltaY</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-deltaZ"><code>deltaZ</code> of type <span class="idlMemberType">double</span>, defaulting to <code>0.0</code></dt><dd></dd><dt id="widl-WheelEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-relatedTarget"><code>relatedTarget</code> of type <span class="idlMemberType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a></span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-WheelEventInit-screenX"><code>screenX</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-screenY"><code>screenY</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-WheelEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-WheelEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-WheelEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict</span>]
+partial interface <span class="idlInterfaceID">WheelEvent</span> {
+<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-WheelEvent-initWheelEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-long-screenXArg-long-screenYArg-long-clientXArg-long-clientYArg-unsigned-short-buttonArg-EventTarget-relatedTargetArg-DOMString-modifiersListArg-double-deltaXArg-double-deltaYArg-double-deltaZArg-unsigned-long-deltaMode">initWheelEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">screenYArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientXArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">clientYArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">buttonArg</span></span>, <span class="idlParam"><span class="idlParamType"><a href="#idl-def-EventTarget" class="idlType"><code>EventTarget</code></a>?</span> <span class="idlParamName">relatedTargetArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">modifiersListArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaXArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaYArg</span></span>, <span class="idlParam"><span class="idlParamType">double</span> <span class="idlParamName">deltaZArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned long</span> <span class="idlParamName">deltaMode</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-10">Methods</h6><dl class="methods"><dt id="widl-WheelEvent-initWheelEvent"><code>initWheelEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>WheelEvent</code> object. This method has the same behavior as <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initWheelEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected future
+ syntax for initializing a <code>WheelEvent</code>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">screenXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">screenYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">clientXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">clientYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">buttonArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">relatedTargetArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-MouseEvent-initMouseEvent"><code>MouseEvent.initMouseEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">modifiersListArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>A <a class="normative" href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S"><em>white space</em></a> separated list of modifier key values to be activated
+ on this object. As an example, <code>"Control Shift"</code> marks the control and shift modifiers as activated (the <a href="#widl-MouseEvent-ctrlKey">
+ <code>MouseEvent.ctrlKey</code></a> and <a href="#widl-MouseEvent-shiftKey"><code>MouseEvent.shiftKey</code></a> inherited attributes will be <code>true</code>
+ on the initialized <code>WheelEvent</code> object).</p>
+ </td></tr><tr><td class="prmName">deltaXArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaX"><code>WheelEvent.deltaX</code></a>.</p></td></tr><tr><td class="prmName">deltaYArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaY"><code>WheelEvent.deltaY</code></a>.</p></td></tr><tr><td class="prmName">deltaZArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaZ"><code>WheelEvent.deltaZ</code></a>.</p></td></tr><tr><td class="prmName">deltaMode</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-WheelEvent-deltaMode"><code>WheelEvent.deltaMode</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-KeyboardEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-KeyboardEvent-initializers">Initializers for interface KeyboardEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-KeyboardEventInit">dictionary <span class="idlDictionaryID">KeyboardEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">DOMString</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-key">key</a></span> = <span class="idlMemberValue">""</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-location">location</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-ctrlKey">ctrlKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-shiftKey">shiftKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-altKey">altKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-metaKey">metaKey</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-repeat">repeat</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-charCode">charCode</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-keyCode">keyCode</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">unsigned long</span> <span class="idlMemberName"><a href="#widl-KeyboardEventInit-which">which</a></span> = <span class="idlMemberValue">0</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-keyboardeventinit-members">Dictionary <a class="idlType" href="#idl-def-KeyboardEventInit"><code>KeyboardEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-KeyboardEventInit-altKey"><code>altKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-charCode"><code>charCode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-ctrlKey"><code>ctrlKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-key"><code>key</code> of type <span class="idlMemberType">DOMString</span>, defaulting to <code>""</code></dt><dd></dd><dt id="widl-KeyboardEventInit-keyCode"><code>keyCode</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-location"><code>location</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-KeyboardEventInit-metaKey"><code>metaKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-repeat"><code>repeat</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-shiftKey"><code>shiftKey</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-KeyboardEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-KeyboardEventInit-which"><code>which</code> of type <span class="idlMemberType">unsigned long</span>, defaulting to <code>0</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict</span>]
+partial interface <span class="idlInterfaceID">KeyboardEvent</span> {
+<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-KeyboardEvent-initKeyboardEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-DOMString-keyArg-unsigned-long-locationArg-DOMString-modifiersListArg-boolean-repeat">initKeyboardEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">long</span> <span class="idlParamName">detailArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">keyArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned long</span> <span class="idlParamName">locationArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">modifiersListArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">repeat</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-11">Methods</h6><dl class="methods"><dt id="widl-KeyboardEvent-initKeyboardEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-long-detailArg-DOMString-keyArg-unsigned-long-locationArg-DOMString-modifiersListArg-boolean-repeat"><code>initKeyboardEvent</code></dt><dd>
+ <p>Initializes attributes of a <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.
+ The value of <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a> remains undefined.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initKeyboardEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected
+ future syntax for initializing a <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">detailArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">keyArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>.</p></td></tr><tr><td class="prmName">locationArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-KeyboardEvent-location"><code>KeyboardEvent.location</code></a>.</p></td></tr><tr><td class="prmName">modifiersListArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>A <a class="normative" href="http://www.w3.org/TR/2004/REC-xml-20040204/#NT-S"><em>white space</em></a> separated list of modifier key values to be activated on
+ this object. As an example, <code>"Control Alt"</code> marks the control and alt modifiers as activated.</p>
+ </td></tr><tr><td class="prmName">repeat</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies whether the key event is repeating. See <a href="#widl-KeyboardEvent-repeat"><code>KeyboardEvent.repeat</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ <div id="idl-interface-CompositionEvent-initializers" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_idl-interface-CompositionEvent-initializers">Initializers for interface CompositionEvent</h5>
+ <pre class="idl"><span class="idlDictionary" id="idl-def-CompositionEventInit">dictionary <span class="idlDictionaryID">CompositionEventInit</span> {
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-bubbles">bubbles</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">boolean</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-cancelable">cancelable</a></span> = <span class="idlMemberValue">false</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">AbstractView?</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-view">view</a></span> = <span class="idlMemberValue">null</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">long</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-detail">detail</a></span> = <span class="idlMemberValue">0</span>;</span>
+<span class="idlMember"> <span class="idlMemberType">DOMString?</span> <span class="idlMemberName"><a href="#widl-CompositionEventInit-data">data</a></span> = <span class="idlMemberValue">null</span>;</span>
+};</span></pre><div class="section"><h6 id="dictionary-compositioneventinit-members">Dictionary <a class="idlType" href="#idl-def-CompositionEventInit"><code>CompositionEventInit</code></a> Members</h6><dl class="dictionary-members"><dt id="widl-CompositionEventInit-bubbles"><code>bubbles</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CompositionEventInit-cancelable"><code>cancelable</code> of type <span class="idlMemberType">boolean</span>, defaulting to <code>false</code></dt><dd></dd><dt id="widl-CompositionEventInit-data"><code>data</code> of type <span class="idlMemberType">DOMString</span>, nullable, defaulting to <code>null</code></dt><dd></dd><dt id="widl-CompositionEventInit-detail"><code>detail</code> of type <span class="idlMemberType">long</span>, defaulting to <code>0</code></dt><dd></dd><dt id="widl-CompositionEventInit-view"><code>view</code> of type <span class="idlMemberType">AbstractView</span>, nullable, defaulting to <code>null</code></dt><dd></dd></dl></div>
+ <pre class="idl"><span class="idlInterface" id="idl-def-CompositionEvent-1">[<span class="extAttr">Constructor(DOMString typeArg, optional CompositionEventInit compositionEventInitDict</span>]
+partial interface <span class="idlInterfaceID">CompositionEvent</span> {
+<span class="idlSectionComment"> // Originally introduced (and deprecated) in DOM Level 3</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-CompositionEvent-initCompositionEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-DOMString-dataArg">initCompositionEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">AbstractView?</span> <span class="idlParamName">viewArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString?</span> <span class="idlParamName">dataArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="methods-12">Methods</h6><dl class="methods"><dt id="widl-CompositionEvent-initCompositionEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-AbstractView-viewArg-DOMString-dataArg"><code>initCompositionEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>CompositionEvent</code> object. This method has the same behavior as <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a>.
+ The value of <a href="#widl-UIEvent-detail"><code>UIEvent.detail</code></a> remains undefined.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <code>initCompositionEvent</code> method is deprecated. Event constructor syntax, introduced in [<a href="#references-UIEvents">UI Events</a>], is the expected
+ future syntax for initializing a <code>CompositionEvent</code>.</p>
+
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">viewArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Refer to the <a href="#widl-UIEvent-initUIEvent"><code>UIEvent.initUIEvent()</code></a> method for a description of this parameter.</p></td></tr><tr><td class="prmName">dataArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc"><p>Specifies <a href="#widl-CompositionEvent-data"><code>CompositionEvent.data</code></a>.</p></td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div>
+ </div>
+
+ </div>
+ </div>
+
+
+<!-- Appendix B: Legacy Key Attributes ========================================================-->
+
+ <div id="legacy-key-attributes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_legacy-key-attributes"><span class="secno">6.5 </span>Legacy Key Attributes</h3>
+ <p><em>This section is informative</em></p>
+
+ <p>This section provides a non-normative description of the attributes that are currently used when handling keyboard events.</p>
+
+ <p>These features were never formally specified and the current browser implementations vary in significant ways.
+ The large amount of legacy content, including script libraries, that relies upon detecting the <a class="def" href="#glossary-user-agent">user agent</a>
+ and acting accordingly means that any attempt to formalize these legacy attributes and events would risk breaking as much content as it would fix or enable.
+ Additionally, these attributes are not suitable for international usage, nor do they address accessibility concerns.</p>
+
+ <p>Therefore, this specification does not normatively define the events and attributes commonly employed for handling keyboard input,
+ though they <em class="rfc2119" title="MAY">MAY</em> be present in <a class="def" href="#glossary-user-agent">user agents</a> for compatibility with legacy content.
+ Authors <em class="rfc2119" title="SHOULD">SHOULD</em> use the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a> attribute instead of the <code class="attribute-name">charCode</code>
+ and <code class="attribute-name">keyCode</code> attributes.</p>
+
+ <p>However, for the purpose of documenting the current state of these features and their relation to normative events and attributes, this section provides an
+ informative description.
+ For implementations which do support these attributes and events, it is suggested that the definitions provided in this section be used.</p>
+
+ <div id="KeyboardEvent-supplemental-interface" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_KeyboardEvent-supplemental-interface"><span class="secno">6.5.1 </span>Legacy <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> supplemental interface</h4>
+ <p><em>This section is informative</em></p>
+
+ <p>Browser support for keyboards has traditionally relied on three ad-hoc attributes, <code class="attribute-name">keyCode</code>, <code class="attribute-name">charCode</code>,
+ and <code class="attribute-name">which</code>.</p>
+
+ <p>All three of these attributes return a numerical code that represents some aspect of the key pressed: <code class="attribute-name">keyCode</code> is an index of
+ the key itself. <code class="attribute-name">charCode</code> is the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> value of the character keys. <code class="attribute-name">which</code> is the character
+ value where available and otherwise the key index. The values for these attributes, and the availability of the attribute, is inconsistent across platforms, keyboard
+ languages and layouts, <a class="def" href="#glossary-user-agent">user agents</a>, versions, and even event types.</p>
+
+ <dl>
+ <dt><strong>Interface <em>KeyboardEvent (supplemental)</em></strong></dt>
+ <dd>
+ <p class="intro-dom">Introduced in DOM Level 3</p>
+
+ <p>The partial
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
+ interface is an informative extension of the
+ <a href="#interface-KeyboardEvent">KeyboardEvent</a>
+ interface, which adds the
+ <a href="#widl-KeyboardEvent-charCode">charCode</a>,
+ <a href="#widl-KeyboardEvent-keyCode">keyCode</a>,
+ and <a href="#widl-KeyboardEvent-which">which</a>
+ attributes.</p>
+
+ <p>The partial
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
+ interface can be obtained by using the
+ <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("KeyboardEvent")</code></a>
+ method call in implementations that support this extension.</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-KeyboardEvent-2">partial interface <span class="idlInterfaceID">KeyboardEvent</span> {
+<span class="idlSectionComment"> // The following support legacy user agents</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-charCode">charCode</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-keyCode">keyCode</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned long</span> <span class="idlAttrName"><a href="#widl-KeyboardEvent-which">which</a></span>;</span>
+};</span></pre><div class="section"><h5 id="attributes-9">Attributes</h5><dl class="attributes"><dt id="widl-KeyboardEvent-charCode"><code>charCode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
+ <p><code class="attribute-name">charCode</code> holds a character value, for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events which
+ generate character input. The value is the Unicode reference number (code point) of that character (e.g. <code>event.charCode = event.char.charCodeAt(0)</code>).
+ For <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> or <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> events, the
+ value of <code class="attribute-name">charCode</code> is <code>0</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-keyCode"><code>keyCode</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
+ <p><code class="attribute-name">keyCode</code> holds a system- and implementation-dependent numerical code signifying the unmodified identifier associated with the
+ key pressed. Unlike the <a href="#widl-KeyboardEvent-key"><code>KeyboardEvent.key</code></a>
+ attribute, the set of possible values are not normatively defined in this specification. Typically, these value of the <code class="attribute-name">keyCode</code>
+ <em class="rfc2119" title="SHOULD">SHOULD</em> represent the decimal codepoint in <acronym title="American Standard Code for Information Interchange">ASCII</acronym> [<a href="#ref-rfc20">RFC20</a>][<a href="#ref-US-ASCII">US-<acronym title="American Standard Code for Information Interchange">ASCII</acronym></a>] or Windows 1252 [<a href="#ref-WIN1252">WIN1252</a>],
+ but <em class="rfc2119" title="MAY">MAY</em> be drawn from a different appropriate character set. Implementations that are unable to identify a key use the key value <code class="key">'0'</code>.</p>
+
+ <p>See <a href="#legacy-key-models">Legacy key models</a> for more details on how to determine the values for <code class="attribute-name">keyCode</code>.</p>
+ </dd><dt id="widl-KeyboardEvent-which"><code>which</code> of type <span class="idlAttrType">unsigned long</span>, readonly </dt><dd>
+ <p><code>which</code> holds a system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. In most cases,
+ the value is identical to <code class="attribute-name"><a href="#widl-KeyboardEvent-keyCode">keyCode</a></code>.</p>
+ </dd></dl></div>
+
+ </dd>
+ </dl>
+ </div>
+
+ <div id="legacy-key-models" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_legacy-key-models"><span class="secno">6.5.2 </span>Legacy key models</h4>
+ <p><em>This section is informative</em></p>
+
+ <p>Implementations differ on which values are exposed on these attributes for different event types. An implementation <em class="rfc2119" title="MAY">MAY</em> choose to expose both virtual key codes
+ and character codes in the <code class="attribute-name">keyCode</code> property (<em>conflated model</em>), or report separate <code class="attribute-name">keyCode</code>
+ and <code class="attribute-name">charCode</code> properties (<em>split model</em>).</p>
+
+ <div id="determine-keydown-keyup-keyCode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_determine-keydown-keyup-keyCode">How to determine <code class="attribute-name">keyCode</code> for <code>keydown</code>
+ and <code>keyup</code> events</h5>
+
+ <p>The <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> or <a class="eventtype" href="#event-type-keyup">
+ <code>keyup</code></a> events is calculated as follows:</p>
+
+ <ol>
+ <li>Read the virtual key code from the operating system's event information, if such information is available.</li>
+ <li>If an Input Method Editor is processing key input and the event is <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>, return 229.</li>
+ <li>If input key when pressed without modifiers would insert a numerical character (0-9), return the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> code of that numerical character.</li>
+ <li>If input key when pressed without modifiers would insert a a lower case character in the a-z alphabetical range, return the <acronym title="American Standard Code for Information Interchange">ASCII</acronym> code of the upper case equivalent.</li>
+ <li>If the implementation supports a key code conversion table for the operating system and platform, look up the value. If the conversion table specifies an alternate
+ virtual key value for the given input, return the specified value.</li>
+ <li>If the key's function, as determined in an implementation-specific way, corresponds to one of the keys in the <a href="#fixed-virtual-key-codes">table of fixed
+ virtual key codes</a>, return the corresponding key code.</li>
+ <li>Return the virtual key code from the operating system.</li>
+ <li>If no key code was found, return 0.</li>
+ </ol>
+ </div>
+
+ <div id="determine-keypress-keyCode" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_determine-keypress-keyCode">How to determine <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events</h5>
+
+ <p>The <code class="attribute-name">keyCode</code> for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> events is calculated as follows:</p>
+
+ <ol>
+ <li>If the implementation supports a <em>conflated model</em>, set <code class="attribute-name">keyCode</code> to the Unicode code point of the character being entered.
+ </li>
+ <li>If the implementation supports a <em>split model</em>, set <code class="attribute-name">keyCode</code> to 0.</li>
+ </ol>
+ </div>
+
+ <div id="fixed-virtual-key-codes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_fixed-virtual-key-codes">Fixed virtual key codes</h5>
+
+ <p>The virtual key codes for the following keys do not usually change with keyboard layouts on desktop systems:</p>
+
+ <table class="legacy-key-table">
+ <tbody><tr>
+ <th>Key</th>
+ <th class="cell-center">Virtual Key<br />Code</th>
+ <th>Notes</th>
+ </tr>
+ <tr><td><code class="key">'Backspace'</code></td> <td class="cell-center">8</td> <td></td> </tr>
+ <tr><td><code class="key">'Tab'</code></td> <td class="cell-center">9</td> <td></td> </tr>
+ <tr><td><code class="key">'Enter'</code></td> <td class="cell-center">13</td> <td></td> </tr>
+ <tr><td><code class="key">'Shift'</code></td> <td class="cell-center">16</td> <td></td> </tr>
+ <tr><td><code class="key">'Control'</code></td> <td class="cell-center">17</td> <td></td> </tr>
+ <tr><td><code class="key">'Alt'</code></td> <td class="cell-center">18</td> <td></td> </tr>
+ <tr><td><code class="key">'CapsLock'</code></td> <td class="cell-center">20</td> <td></td> </tr>
+ <tr><td><code class="key">'Escape'</code></td> <td class="cell-center">27</td> <td><em>Esc</em></td> </tr>
+ <tr><td><code class="key">' '</code></td> <td class="cell-center">32</td> <td><em>Space</em></td> </tr>
+ <tr><td><code class="key">'PageUp'</code></td> <td class="cell-center">33</td> <td></td> </tr>
+ <tr><td><code class="key">'PageDown'</code></td> <td class="cell-center">34</td> <td></td> </tr>
+ <tr><td><code class="key">'End'</code></td> <td class="cell-center">35</td> <td></td> </tr>
+ <tr><td><code class="key">'Home'</code></td> <td class="cell-center">36</td> <td></td> </tr>
+ <tr><td><code class="key">'Left'</code></td> <td class="cell-center">37</td> <td></td> </tr>
+ <tr><td><code class="key">'Up'</code></td> <td class="cell-center">38</td> <td></td> </tr>
+ <tr><td><code class="key">'Right'</code></td> <td class="cell-center">39</td> <td></td> </tr>
+ <tr><td><code class="key">'Down'</code></td> <td class="cell-center">40</td> <td></td> </tr>
+ <tr><td><code class="key">'Delete'</code></td> <td class="cell-center">46</td> <td><em>Del</em></td> </tr>
+ </tbody></table>
+ </div>
+
+ <div id="optionally-fixed-virtual-key-codes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_optionally-fixed-virtual-key-codes">Optionally fixed virtual key codes</h5>
+
+ <p>The following punctuation characters <em class="rfc2119" title="MAY">MAY</em> change virtual codes between keyboard layouts, but reporting these values will likely be more compatible with legacy content
+ expecting US-English keyboard layout:</p>
+
+ <table class="legacy-key-table">
+ <tbody><tr>
+ <th>Key</th>
+ <th class="cell-center">Character</th>
+ <th class="cell-center">Virtual Key<br />Code</th>
+ </tr>
+ <tr><td>Semicolon</td> <td class="cell-center"><code class="glyph">';'</code></td> <td class="cell-center">186</td> </tr>
+ <tr><td>Colon</td> <td class="cell-center"><code class="glyph">':'</code></td> <td class="cell-center">186</td> </tr>
+ <tr><td>Equals sign</td> <td class="cell-center"><code class="glyph">'='</code></td> <td class="cell-center">187</td> </tr>
+ <tr><td>Plus</td> <td class="cell-center"><code class="glyph">'+'</code></td> <td class="cell-center">187</td> </tr>
+ <tr><td>Comma</td> <td class="cell-center"><code class="glyph">','</code></td> <td class="cell-center">188</td> </tr>
+ <tr><td>Less than sign</td> <td class="cell-center"><code class="glyph">'<'</code></td> <td class="cell-center">188</td> </tr>
+ <tr><td>Minus</td> <td class="cell-center"><code class="glyph">'-'</code></td> <td class="cell-center">189</td> </tr>
+ <tr><td>Underscore</td> <td class="cell-center"><code class="glyph">'_'</code></td> <td class="cell-center">189</td> </tr>
+ <tr><td>Period</td> <td class="cell-center"><code class="glyph">'.'</code></td> <td class="cell-center">190</td> </tr>
+ <tr><td>Greater than sign</td> <td class="cell-center"><code class="glyph">'>'</code></td> <td class="cell-center">190</td> </tr>
+ <tr><td>Forward slash</td> <td class="cell-center"><code class="glyph">'/'</code></td> <td class="cell-center">191</td> </tr>
+ <tr><td>Question mark</td> <td class="cell-center"><code class="glyph">'?'</code></td> <td class="cell-center">191</td> </tr>
+ <tr><td>Backtick</td> <td class="cell-center"><code class="glyph">'`'</code></td> <td class="cell-center">192</td> </tr>
+ <tr><td>Tilde</td> <td class="cell-center"><code class="glyph">'~'</code></td> <td class="cell-center">192</td> </tr>
+ <tr><td>Opening square bracket</td> <td class="cell-center"><code class="glyph">'['</code></td> <td class="cell-center">219</td> </tr>
+ <tr><td>Opening curly brace</td> <td class="cell-center"><code class="glyph">'{'</code></td> <td class="cell-center">219</td> </tr>
+ <tr><td>Backslash</td> <td class="cell-center"><code class="glyph">'\'</code></td> <td class="cell-center">220</td> </tr>
+ <tr><td>Pipe</td> <td class="cell-center"><code class="glyph">'|'</code></td> <td class="cell-center">220</td> </tr>
+ <tr><td>Closing square bracket</td> <td class="cell-center"><code class="glyph">']'</code></td> <td class="cell-center">221</td> </tr>
+ <tr><td>Closing curly brace</td> <td class="cell-center"><code class="glyph">'}'</code></td> <td class="cell-center">221</td> </tr>
+ <tr><td>Single quote</td> <td class="cell-center"><code class="glyph">'''</code></td> <td class="cell-center">222</td> </tr>
+ <tr><td>Double quote</td> <td class="cell-center"><code class="glyph">'"'</code></td> <td class="cell-center">222</td> </tr>
+ </tbody></table>
+ </div>
+ </div>
+ </div>
+
+
+<!-- Appendix C: Legacy Event Types ========================================================-->
+
+ <div id="legacy-event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_legacy-event-types"><span class="secno">6.6 </span>Legacy Event Types</h3>
+ <p><em>This section is informative</em></p>
+
+ <p>This section provides a non-normative description of the event types that are deprecated in this document.</p>
+
+ <p>The purpose of this section is to document the current state of these features and their relation to normative events.
+ For implementations which do support these events, it is suggested that the definitions provided in this section be used.</p>
+
+ <p>The following table provides an informative summary of the event types which are deprecated in this specification. They are included here for reference and completeness.</p>
+
+ <table class="data-table" summary="This table contains the complete list of the deprecated 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.">
+ <tbody><tr>
+ <th>Event Type</th>
+ <th>Sync / Async</th>
+ <th>Bubbling phase</th>
+ <th>Trusted event target types</th>
+ <th>DOM interface</th>
+ <th>Cancelable</th>
+ <th>Default Action</th>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ <td>Yes</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Text</code>, <code>Comment</code>, <code>CDATASection</code>, <code>ProcessingInstruction</code></td>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Element</code></td>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a></td>
+ <td>Sync</td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td><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><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>DocumentFragment</code>, <code>Element</code>, <code>Attr</code>
+ </td>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ <td><abbr title="Number, Other">No</abbr></td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></td>
+ <td>Sync</td>
+ <td>Yes</td>
+ <td><code>Document</code>, <code>Element</code></td>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ <td>Yes</td>
+ <td>Varies:
+ launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
+ <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
+ <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
+ other event</td>
+ </tr>
+ </tbody></table>
+
+ <div id="legacy-uievent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_legacy-uievent-events"><span class="secno">6.6.1 </span>Legacy <a href="#interface-UIEvent"><code>UIEvent</code></a> events</h4>
+
+
+<!-- DOMActivate -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMActivate"><dfn id="dfn-domactivate"><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMActivate</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-UIEvent"><code>UIEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element being activated</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a button, link, or other state-changing element is activated. Refer to
+ <a href="#event-flow-activation">Activation triggers and behavior</a> for more details.</p>
+
+ <p class="warning" id="DOMActivate-deprecated"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a> is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">
+ deprecates</a> the use of this event type in favor of the related <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click">
+ <code>click</code></a>. Other specifications <em class="rfc2119" title="MAY">MAY</em> define and maintain their own <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a>
+ <a class="def" href="#glossary-event-type">event type</a> for backwards compatibility.</p>
+
+ <div class="note"><div class="note-title" id="h_note_106"><span>Note</span></div><p class="" id="DOMActivate-click"><strong>Note:</strong> While <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> and <a class="eventtype" href="#event-type-click"><code>click</code></a> are not completely equivalent, implemented behavior for the <a class="eventtype" href="#event-type-click"><code>click</code></a>
+ <a class="def" href="#glossary-event-type">event type</a> has developed to encompass the most critical accessibility aspects for which the <a class="eventtype" href="#event-type-DOMActivate">
+ <code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a> was designed, and is more widely implemented. Content authors are encouraged
+ to use the <a class="eventtype" href="#event-type-click"><code>click</code></a> <a class="def" href="#glossary-event-type">event type</a> rather than the related
+ <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a> or <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a> <a class="def" href="#glossary-event-type">event type</a> to ensure maximum accessibility.</p></div>
+ </dd>
+ </dl>
+ </div>
+
+ <p>Implementations which support the <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event
+ type</a> <em class="rfc2119" title="SHOULD">SHOULD</em> also dispatch a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event as a <a class="def" href="#glossary-default-action">
+ default action</a> of a <a class="eventtype" href="#event-type-click"><code>click</code></a> event which is associated with an <a class="def" href="#glossary-activation-trigger">
+ activation trigger</a>. However, such implementations <em class="rfc2119" title="SHOULD">SHOULD</em> only initiate the associated <a class="def" href="#glossary-activation-behavior">activation behavior</a>
+ once for any given occurrence of an <a class="def" href="#glossary-activation-trigger">activation trigger</a>.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a>
+ <a class="def" href="#glossary-event-type">event type</a> is <em class="rfc2119" title="REQUIRED">REQUIRED</em> to be supported for XForms [<cite><a class="informative" href="#ref-xforms">XFORMS</a></cite>],
+ which is intended for implementation within a <a class="def" href="#glossary-host-language">host language</a>. In a scenario where a plugin or script-based implementation
+ of XForms is intended for installation in a native implementation of this specification which does not support the <a class="eventtype" href="#event-type-DOMActivate">
+ <code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">event type</a>, the XForms <a class="def" href="#glossary-user-agent">user agent</a>
+ has to synthesize and dispatch its own <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events based on the appropriate <a class="def" href="#glossary-activation-trigger">activation triggers</a>. Thus, when a <a class="eventtype" href="#event-type-click"><code>click</code></a> event is dispatched
+ by the DOM Level 3 Events <a class="def" href="#glossary-user-agent">user agent</a>, the XForms <a class="def" href="#glossary-user-agent">user agent</a> has to
+ determine whether to synthesize a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event with the same relevant properties as a
+ <a class="def" href="#glossary-default-action">default action</a> of that <a class="eventtype" href="#event-type-click"><code>click</code></a> event. Appropriate
+ cues might be whether the <a class="eventtype" href="#event-type-click"><code>click</code></a> event is <a href="#trusted-events">trusted</a>, or whether its <a class="def" href="#glossary-event-target">event target</a> has a <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event listener
+ registered.</p>
+ </div>
+
+ <div class="note"><div class="note-title" id="h_note_107"><span>Note</span></div><p class=""><strong>Authoring Note:</strong> Don't rely upon the interoperable support of <a class="eventtype" href="#event-type-DOMActivate">
+ <code>DOMActivate</code></a> in many <a class="def" href="#glossary-user-agent">user agents</a>. Use the <a class="eventtype" href="#event-type-click"><code>click</code></a>
+ <a class="def" href="#glossary-event-type">event type</a> for more accessible behavior instead, due to wider implementation.</p></div>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> <a class="def" href="#glossary-event-type">
+ event type</a> is deprecated in this specification.</p>
+
+ <div id="legacy-uievent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_legacy-uievent-event-order">Activation event order</h5>
+
+ <p>If the <code>DOMActivate</code> event is supported by the <a class="def" href="#glossary-user-agent">user agent</a>, then the
+ events <em class="rfc2119" title="MUST">MUST</em> be dispatched in a set order relative to each other: (with only pertinent events listed):</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
+ <td><a class="def" href="#glossary-default-action">default action</a>, if supported
+ by the <a class="def" href="#glossary-user-agent">user agent</a>; synthesized; <code>trusted="false"</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td colspan="2">
+ <em>All other <a class="def" href="#glossary-default-action">default actions</a>,
+ including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>If the focused element is activated by a key event, then the following shows the typical sequence of events (with only pertinent events listed):</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td><em class="rfc2119" title="MUST">MUST</em> be a key which can activate the element, such as the
+ <a href="#key-Enter"><code class="key">'Enter'</code></a> or <code class="key">' '</code> key,
+ or the element is not activated</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-click"><code>click</code></a></td>
+ <td><a class="def" href="#glossary-default-action">default action</a>; synthesized; <code>trusted="false"</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a></td>
+ <td><a class="def" href="#glossary-default-action">default action</a>, if supported
+ by the <a class="def" href="#glossary-user-agent">user agent</a>; synthesized; <code>trusted="false"</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td colspan="2">
+ <em>All other <a class="def" href="#glossary-default-action">default actions</a>,
+ including the <a class="def" href="#glossary-activation-behavior">activation behavior</a></em>
+ </td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+
+ <div id="legacy-focusevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_legacy-focusevent-events"><span class="secno">6.6.2 </span>Legacy <a href="#interface-FocusEvent"><code>FocusEvent</code></a> events</h4>
+
+
+<!-- DOMFocusIn -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMFocusIn"><dfn id="dfn-domfocusin"><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMFocusIn</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> receiving focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> receives
+ focus. The focus <em class="rfc2119" title="MUST">MUST</em> be given to the element before the dispatch of this event type. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type <a class="eventtype" href="#event-type-focus"><code>focus</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a> event type is defined in this
+ specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in favor
+ of the related event types <a class="eventtype" href="#event-type-focus"><code>focus</code></a> and <a class="eventtype" href="#event-type-focusIn"><code>focusin</code></a>.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMFocusOut -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMFocusOut"><dfn id="dfn-domfocusout"><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMFocusOut</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-FocusEvent"><code>FocusEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ <a class="def" href="#glossary-event-target">event target</a> losing focus</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>null</code></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-FocusEvent-relatedTarget"><code class="attribute-name">FocusEvent.relatedTarget</code></a>:
+ <code>null</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when an <a class="def" href="#glossary-event-target">event target</a> loses
+ focus. The focus <em class="rfc2119" title="MUST">MUST</em> be taken from the element before the dispatch of this event type. This event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the event type <a class="eventtype" href="#event-type-blur"><code>blur</code></a>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a> event type is defined in
+ this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in
+ favor of the related event types <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focusout"><code>focusout</code></a>.</p>
+ </dd>
+ </dl>
+ </div>
+
+ <div id="legacy-focusevent-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_legacy-focusevent-event-order">Legacy FocusEvent event order</h5>
+ <p>
+ The following is the typical sequence of events when a focus is shifted between elements, including the deprecated
+ <a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a>
+ and <a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a>
+ events. The order shown assumes that no element is initially focused.</p>
+
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User shifts focus</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
+ <td>Sent before first target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
+ <td>Sent after first target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
+ <td>If supported</td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colspan="2"><em>User shifts focus</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-focusout"><code>focusout</code></a></td>
+ <td>Sent before first target element loses focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-focusin"><code>focusin</code></a></td>
+ <td>Sent before second target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">6.</td>
+ <td><a class="eventtype" href="#event-type-blur"><code>blur</code></a></td>
+ <td>Sent after first target element loses focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">7.</td>
+ <td><a class="eventtype" href="#event-type-DOMFocusOut"><code>DOMFocusOut</code></a></td>
+ <td>If supported</td>
+ </tr>
+ <tr>
+ <td class="cell-number">8.</td>
+ <td><a class="eventtype" href="#event-type-focus"><code>focus</code></a></td>
+ <td>Sent after second target element receives focus</td>
+ </tr>
+ <tr>
+ <td class="cell-number">9.</td>
+ <td><a class="eventtype" href="#event-type-DOMFocusIn"><code>DOMFocusIn</code></a></td>
+ <td>If supported</td>
+ </tr>
+ </tbody></table>
+ </div>
+
+ </div>
+
+ <div id="legacy-keyboardevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_legacy-keyboardevent-events"><span class="secno">6.6.3 </span>Legacy <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> events</h4>
+
+ <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is the traditional method for capturing key events and
+ processing them before the DOM is updated with the effects of the key press. Code that makes use of the
+ <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
+ event typically relies on the legacy
+ <a href="#widl-KeyboardEvent-charCode">charCode</a>,
+ <a href="#widl-KeyboardEvent-keyCode">keyCode</a>,
+ and <a href="#widl-KeyboardEvent-which">which</a>
+ attributes.</p>
+
+ <p>Note that the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is specific to key events, and has been replaced
+ by the more general event sequence of <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
+ and <a class="eventtype" href="#event-type-input"><code>input</code></a> events.
+ These new input events are not specific to keyboard actions and can be used to capture user input regardless of the original source.
+ </p>
+
+
+<!-- keypress -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-keypress"><dfn id="dfn-keypress"><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>keypress</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Document</code>, <code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>Varies:
+ launch <a class="def" href="#glossary-text-composition-system">text composition system</a>;
+ <a class="eventtype" href="#event-type-blur"><code>blur</code></a> and <a class="eventtype" href="#event-type-focus"><code>focus</code></a> events;
+ <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> event;
+ other event</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ focused element processing the key event, root element if no suitable input element focused</li>
+ <li><a href="#widl-UIEvent-view"><code class="attribute-name">UIEvent.view</code></a>:
+ <a class="def" href="#glossary-defaultView"><code>defaultView</code></a></li>
+ <li><a href="#widl-UIEvent-detail"><code class="attribute-name">UIEvent.detail</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-KeyboardEvent-charCode"><code class="attribute-name">KeyboardEvent.charCode</code></a>:
+ legacy character value for this event</li>
+ <li><a href="#widl-KeyboardEvent-keyCode"><code class="attribute-name">KeyboardEvent.keyCode</code></a>:
+ legacy numerical code for this key</li>
+ <li><a href="#widl-KeyboardEvent-which"><code class="attribute-name">KeyboardEvent.which</code></a>:
+ legacy numerical code for this key</li>
+ <li><a href="#widl-KeyboardEvent-key"><code class="attribute-name">KeyboardEvent.key</code></a>:
+ the key value of the key pressed.</li>
+ <li><a href="#widl-KeyboardEvent-location"><code class="attribute-name">KeyboardEvent.location</code></a>:
+ the location of the key on the device.</li>
+ <li><a href="#widl-KeyboardEvent-altKey"><code class="attribute-name">KeyboardEvent.altKey</code></a>:
+ <code>true</code> if <a href="#key-Alt"><code class="key">'Alt'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-shiftKey"><code class="attribute-name">KeyboardEvent.shiftKey</code></a>:
+ <code>true</code> if <a href="#key-Shift"><code class="key">'Shift'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-ctrlKey"><code class="attribute-name">KeyboardEvent.ctrlKey</code></a>:
+ <code>true</code> if <a href="#key-Control"><code class="key">'Control'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-metaKey"><code class="attribute-name">KeyboardEvent.metaKey</code></a>:
+ <code>true</code> if <a href="#key-Meta"><code class="key">'Meta'</code></a> modifier was active, otherwise <code>false</code></li>
+ <li><a href="#widl-KeyboardEvent-repeat"><code class="attribute-name">KeyboardEvent.repeat</code></a>:
+ <code>true</code> if a key has been depressed long enough to trigger key repetition, otherwise <code>false</code></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>If supported by a <a class="def" href="#glossary-user-agent">user agent</a>, this event <em class="rfc2119" title="MUST">MUST</em> be dispatched when a key is pressed down, if and only if that key normally produces a <a class="def" href="#glossary-character-value">character value</a>. The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is device
+ dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type <em class="rfc2119" title="MUST">MUST</em> be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a>. It <em class="rfc2119" title="MUST NOT">MUST NOT</em> be fired when using an <a class="def" href="#glossary-ime">input method editor</a>.
+ If this event is canceled, it should prevent the
+ <a class="eventtype" href="#event-type-input"><code>input</code></a>
+ event from firing, in addition to canceling the
+ <a class="def" href="#glossary-default-action">default action</a>.</p>
+
+ <p>Authors <em class="rfc2119" title="SHOULD">SHOULD</em> use the
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
+ event instead of the
+ <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
+ event.</p>
+
+ <div class="note"><div class="note-title" id="h_note_108"><span>Note</span></div><p class=""><strong>Note:</strong> The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is traditionally associated with detecting a
+ <a class="def" href="#glossary-character-value">character value</a> rather than a physical key, and might not be available on all keys in some configurations.</p></div>
+
+ <div class="warning">
+ <p><strong>Warning!</strong></p>
+ <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is defined in this specification for
+ reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.
+ When in editing contexts, authors can subscribe to the <code>beforeinput</code> event instead.
+ </p>
+ </div>
+
+ </dd>
+ </dl>
+ </div>
+
+ <div id="keypress-event-order" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_keypress-event-order"><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event order</h5>
+
+ <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
+ <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event and before the
+ <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event associated with the same key.</p>
+
+ <p>The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type <em class="rfc2119" title="MUST">MUST</em> be dispatched after the
+ <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a> event and before the
+ <a class="eventtype" href="#event-type-input"><code>input</code></a> event associated with the same key.</p>
+
+ <p>The sequence of key events for user-agents the support the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event
+ is demonstrated in the following example:</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <table class="event-sequence-table">
+ <tbody><tr>
+ <td class="cell-number"></td>
+ <th>Event Name</th>
+ <th class="cell-center"><a href="#widl-KeyboardEvent-key"><code>KeyboardEvent<br />key</code></a></th>
+ <th class="cell-center"><a href="#widl-InputEvent-data"><code>InputEvent<br />data</code></a></th>
+ </tr>
+ <tr>
+ <td class="cell-number">1.</td>
+ <td><a class="eventtype" href="#event-type-keydown"><code>keydown</code></a></td>
+ <td class="cell-center"><code class="key">'a'</code></td>
+ <td class="cell-center"></td>
+ </tr>
+ <tr>
+ <td class="cell-number">2.</td>
+ <td><a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"><code class="key">'a'</code></td>
+ </tr>
+ <tr>
+ <td class="cell-number">3.</td>
+ <td><a class="eventtype" href="#event-type-keypress"><code>keypress</code></a></td>
+ <td class="cell-center"><code class="key">'a'</code></td>
+ <td class="cell-center"></td>
+ </tr>
+ <tr>
+ <td class="cell-number"></td>
+ <td colapsan="3"><em>Any <a class="def" href="#glossary-default-action">default actions</a> related to this key, such as inserting a
+ character in to the DOM.</em></td>
+ </tr>
+ <tr>
+ <td class="cell-number">4.</td>
+ <td><a class="eventtype" href="#event-type-input"><code>input</code></a></td>
+ <td class="cell-center"></td>
+ <td class="cell-center"></td>
+ </tr>
+ <tr>
+ <td class="cell-number">5.</td>
+ <td><a class="eventtype" href="#event-type-keyup"><code>keyup</code></a></td>
+ <td class="cell-center"><code class="key">'a'</code></td>
+ <td class="cell-center"></td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+ </div>
+
+ <div id="legacy-mutationevent-events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_legacy-mutationevent-events"><span class="secno">6.6.4 </span>Legacy <a href="#interface-MutationEvent"><code>MutationEvent</code></a> events</h4>
+
+ <p>The mutation and mutation name event modules are designed to allow notification of any changes to the structure of a document, including attribute, text, or name
+ modifications.</p>
+
+ <div class="note"><div class="note-title" id="h_note_109"><span>Note</span></div><p class=""><strong>Note:</strong> None of the event types associated with the <code>MutationEvent</code> interface are designated as cancelable. This stems from
+ the fact that it is very difficult to make use of existing DOM interfaces which cause document modifications if any change to the document might or might not take
+ place due to cancelation of the resulting event. Although this is still a desired capability, it was decided that it would be better left until the addition of
+ transactions into the DOM.</p></div>
+
+ <p>Many single modifications of the tree can cause multiple mutation events to be dispatched. Rather than attempt to specify the ordering of mutation events due to
+ every possible modification of the tree, the ordering of these events is left to the implementation.</p>
+
+ <div class="warning">
+ <p><strong>Warning!</strong></p>
+ <p>The <a href="#interface-MutationEvent">MutationEvent interface</a> was introduced in DOM Level 2 Events, but has not yet been
+ completely and interoperably implemented across <a class="def" href="#glossary-user-agent">user agents</a>.
+ In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge.
+ </p>
+ <p>DOM4 [<a href="#references-DOM4">DOM4</a>] provides a new mechanism using a <code>MutationObserver</code> interface which
+ addresses the use cases that mutation events solve, but in a more performant manner.
+ Thus, this specification describes mutation events for reference and completeness of legacy behavior, but
+ <a class="def" href="#glossary-deprecated">deprecates</a> the use of the <a href="#interface-MutationEvent"><code>MutationEvent</code></a> interface.
+ </p>
+ </div>
+
+ <div id="interface-MutationEvent" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_interface-MutationEvent">Interface MutationEvent</h5>
+
+ <p class="intro-dom">Introduced in DOM Level 2, deprecated in DOM Level 3</p>
+
+ <p>The <code>MutationEvent</code> interface provides specific contextual information associated with Mutation events.</p>
+
+ <p>To create an instance of the <code>MutationEvent</code> interface, use the <a href="#widl-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("MutationEvent")</code></a>
+ method call.</p>
+
+ <pre class="idl"><span class="idlInterface" id="idl-def-MutationEvent">interface <span class="idlInterfaceID">MutationEvent</span> : <span class="idlSuperclass"><a href="#idl-def-Event" class="idlType"><code>Event</code></a></span> {
+<span class="idlSectionComment"> // attrChangeType</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#MODIFICATION">MODIFICATION</a></span> = <span class="idlConstValue">1</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#ADDITION">ADDITION</a></span> = <span class="idlConstValue">2</span>;</span>
+<span class="idlConst"> const <span class="idlConstType">unsigned short</span> <span class="idlConstName"><a href="#REMOVAL">REMOVAL</a></span> = <span class="idlConstValue">3</span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">Node?</span> <span class="idlAttrName"><a href="#widl-MutationEvent-relatedNode">relatedNode</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-prevValue">prevValue</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-newValue">newValue</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-MutationEvent-attrName">attrName</a></span>;</span>
+<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unsigned short</span> <span class="idlAttrName"><a href="#widl-MutationEvent-attrChange">attrChange</a></span>;</span>
+<span class="idlMethod"> <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-MutationEvent-initMutationEvent-void-DOMString-typeArg-boolean-bubblesArg-boolean-cancelableArg-Node-relatedNodeArg-DOMString-prevValueArg-DOMString-newValueArg-DOMString-attrNameArg-unsigned-short-attrChangeArg">initMutationEvent</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">typeArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">bubblesArg</span></span>, <span class="idlParam"><span class="idlParamType">boolean</span> <span class="idlParamName">cancelableArg</span></span>, <span class="idlParam"><span class="idlParamType">Node?</span> <span class="idlParamName">relatedNodeArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">prevValueArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">newValueArg</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">attrNameArg</span></span>, <span class="idlParam"><span class="idlParamType">unsigned short</span> <span class="idlParamName">attrChangeArg</span></span>);</span>
+};</span></pre><div class="section"><h6 id="attributes-10">Attributes</h6><dl class="attributes"><dt id="widl-MutationEvent-attrChange"><code>attrChange</code> of type <span class="idlAttrType">unsigned short</span>, readonly </dt><dd>
+ <p><code>attrChange</code> indicates the type of change which triggered the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event. The values can be <code>MODIFICATION</code>, <code>ADDITION</code>, or <code>REMOVAL</code>.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>0</code>.</p>
+
+ <div class="note"><div class="note-title" id="h_note_110"><span>Note</span></div><p class=""><strong>Note:</strong> There is no defined constant for the attrChange value of 0 (the un-initialized value).</p></div>
+ </dd><dt id="widl-MutationEvent-attrName"><code>attrName</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p><code>attrName</code> indicates the name of the changed <code>Attr</code> node in a <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd><dt id="widl-MutationEvent-newValue"><code>newValue</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p><code>newValue</code> indicates the new value of the <code>Attr</code> node in <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ events, and of the <code>CharacterData</code> node in <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
+ events.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd><dt id="widl-MutationEvent-prevValue"><code>prevValue</code> of type <span class="idlAttrType">DOMString</span>, readonly </dt><dd>
+ <p><code>prevValue</code> indicates the previous value of the <code>Attr</code> node in <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ events, and of the <code>CharacterData</code> node in <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
+ events.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>""</code> (the empty string).</p>
+ </dd><dt id="widl-MutationEvent-relatedNode"><code>relatedNode</code> of type <span class="idlAttrType">Node</span>, readonly , nullable</dt><dd>
+ <p><code>relatedNode</code> <em class="rfc2119" title="MUST">MUST</em> be used to identify a secondary node related to a mutation event. For example, if a mutation event is dispatched to a node indicating
+ that its parent has changed, the <code>relatedNode</code> will be the changed parent. If an event is instead dispatched to a subtree indicating a node was changed
+ within it, the <code>relatedNode</code> <em class="rfc2119" title="MUST">MUST</em> be the changed node. In the case of the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event it indicates the <code>Attr</code> node which was modified, added, or removed.</p>
+
+ <p>The <a class="def" href="#glossary-un-initialized-value">un-initialized value</a> of this attribute <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+ </dd></dl></div><div class="section"><h6 id="methods-13">Methods</h6><dl class="methods"><dt id="widl-MutationEvent-initMutationEvent"><code>initMutationEvent</code></dt><dd>
+ <p>Initializes attributes of a <code>MutationEvent</code> object. This method has the same behavior as <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a>.</p>
+
+ <table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">typeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">bubblesArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">cancelableArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Refer to the <a href="#widl-Event-initEvent"><code>Event.initEvent()</code></a> method for a description of this parameter.</p>
+ </td></tr><tr><td class="prmName">relatedNodeArg</td><td class="prmType"><code></code></td><td class="prmNullTrue"><span aria-label="True">✔</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MutationEvent-relatedNode"><code>MutationEvent.relatedNode</code></a>.</p>
+ </td></tr><tr><td class="prmName">prevValueArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MutationEvent-prevValue"><code>MutationEvent.prevValue</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">
+ empty string</a>.</p>
+ </td></tr><tr><td class="prmName">newValueArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MutationEvent-newValue"><code>MutationEvent.newValue</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty
+ string</a>.</p>
+ </td></tr><tr><td class="prmName">attrNameArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MutationEvent-attrName"><code>MutationEvent.attrName</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be the <a class="def" href="#glossary-empty-string">empty
+ string</a>.</p>
+ </td></tr><tr><td class="prmName">attrChangeArg</td><td class="prmType"><code></code></td><td class="prmNullFalse"><span aria-label="False">✘</span></td><td class="prmOptFalse"><span aria-label="False">✘</span></td><td class="prmDesc">
+ <p>Specifies <a href="#widl-MutationEvent-attrChange"><code>MutationEvent.attrChange</code></a>. This value <em class="rfc2119" title="MAY">MAY</em> be <code>0</code>.</p>
+ </td></tr></tbody></table><div><em>Return type: </em><code></code></div></dd></dl></div><div class="section"><h6 id="constants-3">Constants</h6><dl class="constants"><dt id="widl-MutationEvent-ADDITION"><code>ADDITION</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The <code>Attr</code> was just added.</p>
+ </dd><dt id="widl-MutationEvent-MODIFICATION"><code>MODIFICATION</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The <code>Attr</code> was modified in place.</p>
+ </dd><dt id="widl-MutationEvent-REMOVAL"><code>REMOVAL</code> of type <span class="idlConstType">unsigned short</span></dt><dd>
+ <p>The <code>Attr</code> was just removed.</p>
+ </dd></dl></div>
+ </div>
+
+ <p>The mutation event types are listed below.</p>
+
+
+<!-- DOMAttrModified -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMAttrModified"><dfn id="dfn-domattrmodified"><a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMAttrModified</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Element</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element whose attribute is being modified</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the name of the changed <code>Attr</code> node</li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ the numerical code corresponding to the most applicable <a href="#widl-MutationEvent-attrChangeType">attrChangeType</a></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ the <code>Attr</code> node that has been modified, added, or removed.</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ new value of the attribute, if the <code>Attr</code> node has been added or modified</li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ previous value of the attribute, if the <code>Attr</code> node has been removed or modified</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event after an <code>Attr.value</code> has been modified and after an <code>Attr</code>
+ node has been added to or removed from an <code>Element</code>. The <a class="def" href="#glossary-event-target">event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the <code>Element</code>
+ node where the change occurred. It is implementation dependent whether this event type occurs when the children of the <code>Attr</code> node are changed in ways
+ that do not affect the value of <code>Attr.value</code>.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a> event type is defined
+ in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMCharacterDataModified -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMCharacterDataModified"><dfn id="dfn-domcharacterdatamodified"><a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMCharacterDataModified</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><code>Text</code>, <code>Comment</code>, <code>CDATASection</code>, <code>ProcessingInstruction</code></td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ object whose content is being modified</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ parent node of the object whose content is being modified</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ new value of the object</li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ previous value of the object</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event after <code>CharacterData.data</code> or <code>ProcessingInstruction.data</code>
+ have been modified, but the node itself has not been inserted or deleted. The <a class="def" href="#glossary-event-target">event target</a> of this event <em class="rfc2119" title="MUST">MUST</em>
+ be the <code>CharacterData</code> node or the <code>ProcessingInstruction</code> node.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>
+ event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
+ use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMNodeInserted -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMNodeInserted"><dfn id="dfn-domnodeinserted"><a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMNodeInserted</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><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>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element which is being inserted</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event type when a node other than an <code>Attr</code> node has been added as a child
+ of another node. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> dispatch this event when an <code>Attr</code> node has been added to an <code>Element</code>
+ node (see <a href="#DOMNodeInserted-attr">note</a> below). This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the insertion has taken place. The <a class="def" href="#glossary-event-target">
+ event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being inserted.</p>
+
+ <div class="note"><div class="note-title" id="h_note_111"><span>Note</span></div><p class="" id="DOMNodeInserted-attr"><strong>Note:</strong> For detecting attribute insertion, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event type instead.</p></div>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a> event type is defined in this specification
+ for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMNodeInsertedIntoDocument -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMNodeInsertedIntoDocument"><dfn id="dfn-domnodeinsertedintodocument"><a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMNodeInsertedIntoDocument</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><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>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element which is being inserted</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node has been inserted into a document, either through direct insertion
+ of the node or insertion of a subtree in which it is contained. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> treat an <code>Attr</code>
+ node as part of an <code>Element</code>'s subtree. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after the insertion has taken place. The <a class="def" href="#glossary-event-target">
+ event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being inserted. If the node is being directly inserted, the event type <a class="eventtype" href="#event-type-DOMNodeInserted">
+ <code>DOMNodeInserted</code></a> <em class="rfc2119" title="MUST">MUST</em> occur before this event type.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeInsertedIntoDocument"><code>DOMNodeInsertedIntoDocument</code></a>
+ event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
+ use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMNodeRemoved -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMNodeRemoved"><dfn id="dfn-domnoderemoved"><a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMNodeRemoved</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><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>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element which is being removed</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node other than an <code>Attr</code> node is being removed from its
+ parent node. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> dispatch this event when an <code>Attr</code> node is being removed from its <code>ownerElement</code>
+ (see <a href="#DOMNodeRemoved-attr">note</a> below). This event <em class="rfc2119" title="MUST">MUST</em> be dispatched before the removal takes place. The <a class="def" href="#glossary-event-target">
+ event target</a> of this event <em class="rfc2119" title="MUST">MUST</em> be the node being removed.</p>
+
+ <div class="note"><div class="note-title" id="h_note_112"><span>Note</span></div><p class="" id="DOMNodeRemoved-attr"><strong>Note:</strong> For reliably detecting attribute removal, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event type instead.</p></div>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeRemoved"><code>DOMNodeRemoved</code></a> event type is defined
+ in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.
+ </p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMNodeRemovedFromDocument -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMNodeRemovedFromDocument"><dfn id="dfn-domnoderemovedfromdocument"><a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMNodeRemovedFromDocument</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><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>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ element which is being removed</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MUST">MUST</em> dispatch this event when a node is being removed from a document, either through direct removal
+ of the node or removal of a subtree in which it is contained. A <a class="def" href="#glossary-user-agent">user agent</a> <em class="rfc2119" title="MAY">MAY</em> treat an <code>Attr</code>
+ node as part of an <code>Element</code>'s subtree. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched before the removal takes place. The <a class="def" href="#glossary-event-target">event
+ target</a> of this event type <em class="rfc2119" title="MUST">MUST</em> be the node being removed. If the node is being directly removed, the event type <a class="eventtype" href="#event-type-DOMNodeRemoved">
+ <code>DOMNodeRemoved</code></a> <em class="rfc2119" title="MUST">MUST</em> occur before this event type.</p>
+
+ <div class="note"><div class="note-title" id="h_note_113"><span>Note</span></div><p class=""><strong>Note:</strong> For reliably detecting attribute removal, use the <a class="eventtype" href="#event-type-DOMAttrModified"><code>DOMAttrModified</code></a>
+ event type instead.</p></div>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMNodeRemovedFromDocument"><code>DOMNodeRemovedFromDocument</code></a>
+ event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the
+ use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+
+<!-- DOMSubtreeModified -->
+
+ <div class="event-definition">
+ <dl>
+ <dt id="event-type-DOMSubtreeModified"><dfn id="dfn-domsubtreemodified"><a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a></dfn></dt>
+ <dd>
+ <table border="0" summary="This table contains information about the semantics of the given event type" cellpadding="2" cellspacing="0">
+ <tbody><tr>
+ <th>Type</th>
+ <td><strong><code>DOMSubtreeModified</code></strong></td>
+ </tr>
+ <tr>
+ <th>Interface</th>
+ <td><a href="#interface-MutationEvent"><code>MutationEvent</code></a></td>
+ </tr>
+ <tr>
+ <th>Sync / Async</th>
+ <td>Sync</td>
+ </tr>
+ <tr>
+ <th>Bubbles</th>
+ <td>Yes</td>
+ </tr>
+ <tr>
+ <th>Target</th>
+ <td><a class="def" href="#glossary-defaultView"><code>defaultView</code></a>, <code>Document</code>, <code>DocumentFragment</code>, <code>Element</code>, <code>Attr</code>
+ </td>
+ </tr>
+ <tr>
+ <th>Cancelable</th>
+ <td><abbr title="Number, Other">No</abbr></td>
+ </tr>
+ <tr>
+ <th>Default action</th>
+ <td>None</td>
+ </tr>
+ <tr>
+ <th>Context info</th>
+ <td>
+ <ul>
+ <li><a href="#widl-Event-target"><code class="attribute-name">Event.target</code></a>:
+ parent node of subtree being modified</li>
+ <li><a href="#widl-MutationEvent-attrName"><code class="attribute-name">MutationEvent.attrName</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-attrChange"><code class="attribute-name">MutationEvent.attrChange</code></a>:
+ <code>0</code></li>
+ <li><a href="#widl-MutationEvent-relatedNode"><code class="attribute-name">MutationEvent.relatedNode</code></a>:
+ <code>null</code></li>
+ <li><a href="#widl-MutationEvent-newValue"><code class="attribute-name">MutationEvent.newValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ <li><a href="#widl-MutationEvent-prevValue"><code class="attribute-name">MutationEvent.prevValue</code></a>:
+ the <a class="def" href="#glossary-empty-string">empty string</a></li>
+ </ul>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <p>This is a general event for notification of all changes to the document. It can be used instead of the more specific mutation and mutation name events. It <em class="rfc2119" title="MAY">MAY</em> be
+ dispatched after a single modification to the document or, at the implementation's discretion, after multiple changes have occurred. The latter case <em class="rfc2119" title="SHOULD">SHOULD</em> generally
+ be used to accommodate multiple changes which occur either simultaneously or in rapid succession. The target of this event <em class="rfc2119" title="MUST">MUST</em> be the lowest common parent of the
+ changes which have taken place. This event <em class="rfc2119" title="MUST">MUST</em> be dispatched after any other events caused by the mutation(s) have occurred.</p>
+
+ <p class="warning"><strong>Warning!</strong> The <a class="eventtype" href="#event-type-DOMSubtreeModified"><code>DOMSubtreeModified</code></a> event type is defined in this
+ specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type.</p>
+ </dd>
+ </dl>
+ </div>
+
+ </div>
+
+ </div>
+
+
+<!-- Appendix D: Extending Events ========================================================-->
+
+ <div id="extending_events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_extending_events"><span class="secno">6.7 </span>Extending Events</h3>
+ <p><em>This section is informative</em></p>
+
+ <div id="extending_events-intro" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_extending_events-intro"><span class="secno">6.7.1 </span>Introduction</h4>
+ <p>This specification defines several interfaces and many events, however, this is not an exhaustive set of events for all purposes. To allow content
+ authors and implementers to add desired functionality, this specification provides two mechanisms for extend this set of interfaces and events without creating
+ conflicts: <a href="#extending_events-Custom_Events">custom events</a> and <a href="#extending_events-Impl_Extensions">implementation-specific extensions</a>.</p>
+ </div>
+
+ <div id="extending_events-Custom_Events" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_extending_events-Custom_Events"><span class="secno">6.7.2 </span>Custom Events</h4>
+ <p>A script author <em class="rfc2119" title="MAY">MAY</em> wish to define an application in terms of functional components, with event types that are meaningful to the application architecture. The
+ content author can use the <a href="#interface-CustomEvent"><code>CustomEvent</code></a> interface to create their own events appropriate to the level of abstraction
+ they are using.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A content author might have created an application which features a dynamically generated bar chart. This bar chart is meant to be updated
+ every 5 minutes, or when a feed shows new information, or when the user refreshes it manually by clicking a button. There are several handlers that have to be
+ called when the chart needs to be updated: the application has to fetch the most recent data, show an icon to the user that the event is being updated, and rebuild
+ the chart. To manage this, the content author can choose to create a custom <q>updateChart</q> event, which is fired whenever one of the trigger conditions is
+ met:</p>
+ <pre><code>
+var chartData = ...;
+var evt = document.createEvent("CustomEvent");
+evt.initCustomEvent( "updateChart", true, false, { data: chartData });
+document.documentElement.dispatchEvent(evt);
+</code></pre>
+ </div>
+ </div>
+
+ <div id="extending_events-Impl_Extensions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_extending_events-Impl_Extensions"><span class="secno">6.7.3 </span>Implementation-Specific Extensions</h4>
+ <p>While a new event is being designed and prototyped, or when an event is intended for implementation-specific functionality, it is desirable to distinguish it from
+ standardized events. Implementors <em class="rfc2119" title="SHOULD">SHOULD</em> prefix event types specific to their implementations with a short string to distinguish it from the same event in other
+ implementations and from standardized events. This is similar to the <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords" title="CSS 2.1: Syntax and basic data types">
+ vendor-specific keyword prefixes</a> in CSS, though without the dashes (<code>"-"</code>) used in CSS, since that can cause problems when used as an attribute
+ name in Javascript.</p>
+
+ <div class="example">
+ <div class="example-title"></div>
+ <p>A particular browser vendor, <q>FooCorp</q>, might wish to introduce a new event, <code>jump</code>. This vendor implements
+ <code>fooJump</code> in their browser, using their vendor-specific prefix, <code>'foo'</code>. Early adopters start experimenting with the event,
+ using <code>someElement.addEventListener("fooJump", doJump, false )</code>, and provide feedback to FooCorp, who change the behavior of <code>fooJump</code>
+ accordingly.</p>
+
+ <p>After some time, another vendor, <q>BarOrg</q>, decides they also want the functionality, but implement it slightly differently, so they use their own vendor-specific
+ prefix, <code>"bar"</code> in their event type name, <code>barJump</code>. Content authors experimenting with this version of the
+ <code>jump</code> event type register events with BarOrg's event type name. Content authors who wish to write code that accounts for both browsers
+ can either register each event type separately with specific handlers, or use the same handler and switch on the name of the event type. Thus, early experiments in different
+ codebases do not conflict, and the early adopter is able to write easily-maintained code for multiple implementations.</p>
+
+ <p>Eventually, as the feature matures, the behavior of both browsers stabilize and might converge due to content author and user feedback or through formal standardization.
+ As this stabilization occurs, and risk of conflicts decrease, content authors can remove the forked code, and use the <code>jump</code> event type name (even
+ before it is formally standardized) using the same event handler and the more generic registration method <code>someElement.addEventListener( "jump", doJump, false)</code>.</p>
+ </div>
+
+ <div id="extending_events-prefixes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_extending_events-prefixes">Known Implementation-Specific Prefixes</h5>
+ <p>At the time of writing, the following event-type name prefixes are known to exist:</p>
+ <table border="1" cellpadding="2" cellspacing="0" summary="Known event-type name prefixes">
+ <thead>
+ <tr>
+ <th>Prefix</th>
+ <th>Web Engine (Organization)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>moz</code>, <code>Moz</code></td>
+ <td>Gecko (Mozilla)</td>
+ </tr>
+ <tr>
+ <td><code>ms</code>, <code>MS</code></td>
+ <td>Trident (Microsoft)</td>
+ </tr>
+ <tr>
+ <td><code>o</code>, <code>O</code></td>
+ <td>Presto (Opera Software)</td>
+ </tr>
+ <tr>
+ <td><code>webkit</code></td>
+ <td>WebKit (Apple, Google, others)</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+
+
+<!-- Appendix E: Security Considerations ========================================================-->
+
+ <div id="security-considerations-Security" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_security-considerations-Security"><span class="secno">6.8 </span>Security Considerations</h3>
+
+ <p>This appendix discusses security considerations for DOM Level 3 Events implementations. The discussion is limited to security issues that arise directly
+ from implementation of the event model, APIs and events defined in this specification. Implementations typically support other features like scripting languages,
+ other APIs and additional events not defined in this document. These features constitute an unknown factor and are out of scope of this document. Implementers <em class="rfc2119" title="SHOULD">SHOULD</em>
+ consult the specifications of such features for their respective security considerations.</p>
+
+ <p>Many of the event types defined in this specification are dispatched in response to user actions. This allows malicious event listeners to gain access to information
+ users would typically consider confidential, e.g., typos they might have made when filling out a form, if they reconsider their answer to a multiple choice question
+ shortly before submitting a form, their typing rate or primary input mechanism. In the worst case, malicious event listeners are able to capture all user interactions
+ and submit them to a third party through means, while not defined in DOM Level 3 Events, generally available in DOM implementations, such as the XMLHttpRequest
+ interface.</p>
+
+ <p>In DOM implementations that support facilities to load external data, events like the <a class="eventtype internalDFN" href="#dfn-error"><code>error</code></a> event can provide access to sensitive information about
+ the environment of the computer system or network. An example would be a malicious HTML document that attempts to embed a resource on the local network or the localhost
+ on different ports. An embedded <a class="def" href="#glossary-DOM-application">DOM application</a> could then listen for <a class="eventtype internalDFN" href="#dfn-error"><code>error</code></a>
+ and <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a> events to determine which other computers in a network are accessible from the local system or which ports are open on the
+ system to prepare further attacks.</p>
+
+ <p>An implementation of DOM Level 3 Events alone is generally insufficient to perform attacks of this kind and the security considerations of the facilities that possibly
+ support such attacks apply. For conformance with this specification, DOM implementations <em class="rfc2119" title="MAY">MAY</em> take reasonable steps to ensure that <a class="def" href="#glossary-DOM-application">
+ DOM applications</a> do not get access to confidential or sensitive information, for example, they might choose to dispatch no <a class="eventtype internalDFN" href="#dfn-load"><code>load</code></a>
+ events to nodes that attempt to embed resources on the local network.</p>
+ </div>
+
+
+<!-- Appendix F: Changes ========================================================-->
+
+ <div id="changes-Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_changes-Changes"><span class="secno">6.9 </span>Changes</h3>
+
+ <div id="changes-DOMEvents2to3Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_changes-DOMEvents2to3Changes"><span class="secno">6.9.1 </span>Changes between DOM Level 2 Events and DOM Level 3 Events</h4>
+
+ <p>Numerous clarifications to the interfaces and event types have been made. The <code>HTMLEvents</code> module is no longer defined in this document. The event types
+ <a class="eventtype internalDFN" href="#dfn-focus-1"><code>focus</code></a> and <a class="eventtype internalDFN" href="#dfn-blur"><code>blur</code></a> have been added to the <a href="#interface-UIEvent"><code>UIEvent</code></a>
+ module, the event type <a class="eventtype internalDFN" href="#dfn-dblclick"><code>dblclick</code></a> has been added to the <a href="#interface-MouseEvent"><code>MouseEvent</code></a> module. This new
+ specification provides a better separation between the DOM event flow, the event types, and the DOM interfaces.</p>
+
+ <div id="changes-DOMEvents2to3Changes-flow" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_changes-DOMEvents2to3Changes-flow">Changes to DOM Level 2 event flow</h5>
+
+ <p>This new specification introduced the following new concepts in the event flow:</p>
+
+ <ul>
+ <li>ordering of event listeners: event listeners are now ordered while ordering was unspecified in DOM Level 2 Events.</li>
+ <li>the event flow now includes the <a class="def" href="#glossary-defaultView">defaultView</a> (or <code>window</code>), to reflect existing implementations.</li>
+ </ul>
+ </div>
+
+ <div id="changes-DOMEvents2to3Changes-event-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_changes-DOMEvents2to3Changes-event-types">Changes to DOM Level 2 event types</h5>
+
+ <p>Many clarifications have been made on the event types. The conformance is now explicitly defined against the event types, and not only in terms of interfaces used
+ by the event types.</p>
+
+ <p><code>"MutationEvents"</code> have been deprecated. Support for namespaced events, present in early drafts of this specification, has also been removed.</p>
+
+ <p>For user agents which support the <a class="eventtype" href="#event-type-DOMNodeInserted"><code>DOMNodeInserted</code></a> and <a class="eventtype" href="#event-type-DOMNodeRemoved">
+ <code>DOMNodeRemoved</code></a> event types, this specification no longer requires that the event type be fired for <code>Attr</code> nodes.</p>
+
+ <p>The <a class="eventtype internalDFN" href="#dfn-resize"><code>resize</code></a> event type no longer bubbles, reflecting existing implementations.</p>
+ </div>
+
+ <div id="changes-DOMLevel2to3Changes" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_changes-DOMLevel2to3Changes">Changes to DOM Level 2 Events interfaces</h5>
+
+ <dl>
+ <dt>Interface <a href="#interface-Event"><code>Event</code></a></dt>
+ <dd>The <a href="#interface-Event"><code>Event</code></a> interface has one new attribute, <a href="#widl-Event-defaultPrevented"><code>Event.defaultPrevented</code></a>,
+ and one new method, <a href="#widl-Event-stopImmediatePropagation"><code>Event.stopImmediatePropagation()</code></a>.<br />
+ <a href="#widl-Event-timeStamp"><code>Event.timeStamp</code></a> is now a <code>Number</code> in the ECMAScript binding. A proposed correction to make the
+ same change in [<cite><a class="normative" href="#references-DOMCore">DOM3 Core</a></cite>] is forthcoming.<br />
+ DOM Level 3 Events considers the <a href="#widl-Event-type"><code>Event.type</code></a> attribute to be case-sensitive, while DOM Level 2 Events considers
+ <a href="#widl-Event-type#widl-Event-type"><code>Event.type</code></a> to be case-insensitive.</dd>
+
+ <dt>Interface <a href="#widl-EventTarget"><code>EventTarget</code></a></dt>
+ <dd>The method <a href="#widl-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> was modified.</dd>
+
+ <dt>Interface <a href="#interface-MouseEvent"><code>MouseEvent</code></a></dt>
+ <dd>The <a href="#interface-MouseEvent"><code>MouseEvent</code></a> interface has one new method <a href="#widl-MouseEvent-getModifierState"><code>MouseEvent.getModifierState()</code></a>.</dd>
+
+ <dt>Exception <code>EventException</code></dt>
+ <dd>The exception <code>EventException</code> <a href="#note-eventexcpetion-removed">is removed in this specification</a>. The prior <code>DISPATCH_REQUEST_ERR</code>
+ code is re-mapped to a <code>DOMException</code> of type <code>InvalidStateError</code>.</dd>
+ </dl>
+ </div>
+
+ <div id="changes-DOMLevel3Addons" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h5 id="h5_changes-DOMLevel3Addons">New Interfaces</h5>
+
+ <p>The interfaces
+ <a href="#interface-CustomEvent"><code>CustomEvent</code></a>,
+ <a href="#interface-FocusEvent"><code>FocusEvent</code></a>,
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>,
+ <a href="#interface-CompositionEvent"><code>CompositionEvent</code></a>,
+ and <a href="#interface-WheelEvent"><code>WheelEvent</code></a>
+ were added to the Events module.</p>
+ </div>
+ </div>
+
+ <div id="changes-drafts" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_changes-drafts"><span class="secno">6.9.2 </span>Changes between different drafts of DOM Level 3 Events</h4>
+
+ <p>The DOM Level 3 Events document was previously developed between 2000 and 2003, and and published as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, pending further feedback and interest from implementers.
+ In 2006, it was picked up for revision and progress on the Recommendation Track, and is now being revised to reflect the current state of implementation and the
+ needs of script authors.</p>
+
+ <p>Despite its status only as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, rather than an official Recommendation, DOM 3 Events saw some implementation, and reference by other specifications, so care
+ is being taken to cause minimal disruption, while still adapting the specification to the current environment.</p>
+
+ <p>This specification has been reordered significantly from the earlier <abbr title="World Wide Web Consortium">W3C</abbr> Note form, and from the structure of DOM2 Events, in order to clarify the material. New
+ diagrams have been put in place to represent hierarchies and events flows more clearly. Here are some of the more important changes between drafts:</p>
+
+ <ul>
+ <li>The <q>key identifier</q> feature has been renamed <q>key value</q> to disambiguate them from unique identifiers for keys.</li>
+ <li>The
+ <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a>
+ was briefly (from 2003-2010) defined to have <code>keyIdentifier</code> and <code>keyLocation</code> attributes, but these
+ were removed in favor of the current
+ <a href="#widl-KeyboardEvent-key"><code>key</code></a>
+ and <a href="#widl-KeyboardEvent-location"><code>location</code></a>
+ attributes. These attributes were not widely implemented.</li>
+ <li>The <a href="#interface-KeyboardEvent"><code>KeyboardEvent</code></a> also had a <code>char</code> attribute that was only used by the
+ <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>
+ event. Since the keypress event has been deprecated, this attribute was no longer useful and was removed.</li>
+ <li>The <code>change</code>, <code>submit</code>, and <code>reset</code> events were removed, since they were specific to HTML forms, and are specified in [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>].</li>
+ <li>The <code>textInput</code> event, originally proposed as a replacement for <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a>, was
+ removed in favor of the current <a class="eventtype" href="#event-type-beforeinput"><code>beforeinput</code></a>
+ and <a class="eventtype" href="#event-type-input"><code>input</code></a> events.</li>
+ <li>Namespaced events have been removed.</li>
+ <li>Updated to use <a href="#references-WebIDL">Web IDL</a>.</li>
+ <li>EventException has been removed.</li>
+ </ul>
+ </div>
+ </div>
+
+
+<!-- Appendix G: Acknowledgements ========================================================-->
+
+ <div id="acknowledgements-contributors" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_acknowledgements-contributors"><span class="secno">6.10 </span>Acknowledgements</h3>
+
+ <p class="1st">Many people contributed to the DOM specifications (Level 1, 2 or 3), including participants of the DOM Working Group, the DOM Interest Group,the WebAPI
+ Working Group, and the WebApps Working Group. We especially thank the following:</p>
+
+ <p>Andrew Watson (Object Management Group), Andy Heninger (IBM), Angel Diaz (IBM), Arnaud Le Hors (<abbr title="World Wide Web Consortium">W3C</abbr> and IBM), Ashok Malhotra (IBM and Microsoft), Ben Chang (Oracle),
+ Bill Smith (Sun), Bill Shea (Merrill Lynch), Bob Sutor (IBM), Chris Lovett (Microsoft), Chris Wilson (Microsoft), David Brownell (Sun), David Ezell (Hewlett-Packard
+ Company), David Singer (IBM), Dimitris Dimitriadis (Improve AB and invited expert), Don Park (invited), Elena Litani (IBM), Eric Vasilik (Microsoft), Gavin Nicol
+ (INSO), Ian Jacobs (<abbr title="World Wide Web Consortium">W3C</abbr>), James Clark (invited), James Davidson (Sun), Jared Sorensen (Novell), Jeroen van Rotterdam (X-Hive Corporation), Joe Kesselman (IBM),
+ Joe Lapp (webMethods), Joe Marini (Macromedia), Johnny Stenback (Netscape/AOL), Jon Ferraiolo (Adobe), Jonathan Marsh (Microsoft), Jonathan Robie (Texcel Research
+ and Software AG), Kim Adamson-Sharpe (SoftQuad Software Inc.), Lauren Wood (SoftQuad Software Inc., <em>former Chair</em>), Laurence Cable (Sun), Mark Davis (IBM),
+ Mark Scardina (Oracle), Martin Dürst (<abbr title="World Wide Web Consortium">W3C</abbr>), Mary Brady (NIST), Mick Goulish (Software AG), Mike Champion (Arbortext and Software AG), Miles Sabin (Cromwell
+ Media), Patti Lutsky (Arbortext), Paul Grosso (Arbortext), Peter Sharpe (SoftQuad Software Inc.), Phil Karlton (Netscape), Philippe Le Hégaret (<abbr title="World Wide Web Consortium">W3C</abbr>, <em><abbr title="World Wide Web Consortium">W3C</abbr> Team
+ Contact and former Chair</em>), Ramesh Lekshmynarayanan (Merrill Lynch), Ray Whitmer (iMall, Excite@Home, and Netscape/AOL, <em>Chair</em>), Rezaur Rahman (Intel),
+ Rich Rollman (Microsoft), Rick Gessner (Netscape), Rick Jelliffe (invited), Rob Relyea (Microsoft), Scott Isaacs (Microsoft), Sharon Adler (INSO), Steve Byrne (JavaSoft),
+ Tim Bray (invited), Tim Yu (Oracle), Tom Pixley (Netscape/AOL), Vidur Apparao (Netscape), Vinod Anupam (Lucent), Anne van Kesteren (Opera Software), Arun Ranganathan
+ (AOL), Björn Höhrmann, Charles McCathieNevile (Opera Software, <em>Co-Chair</em>), Christophe Jolif (ILOG), Dean Jackson (<abbr title="World Wide Web Consortium">W3C</abbr>, <em><abbr title="World Wide Web Consortium">W3C</abbr> Team Contact</em>),
+ Doug Schepers (Vectoreal), Gorm Haug Eriksen (Opera Software), Ian Davis (Talis Information Limited), Ian Hickson (Google), John Robinson (AOL), Jonas Sicking (Mozilla
+ Foundation), Luca Mascaro (HTML Writers Guild), Maciej Stachowiak (Apple Computer), Marc Hadley (Sun Microsystems), Michael Shenfield (Research In Motion), Robin
+ Berjon, (Expway, <em>Co-Chair</em>) , Scott Hayman (Research In Motion), Stéphane Sire (IntuiLab), and T.V. Raman (Google).</p>
+
+ <p><strong>Contributors:</strong> In the WebApps Working Group, the following people made substantial material contributions in the process of refining and revising
+ this specification: Olli Pettay (Mozilla), Hallvord R. M. Steen (Opera), Travis Leithead (Microsoft), Hironori Bono (Google), Daniel Danilatos (Google), Glenn
+ Adams (Samsung), Mark Vickers (Comcast), Bob Lund (Cable Laboratories) and Cameron McCormack (Invited Expert / Mozilla), .</p>
+
+ <p><strong>Glossary contributors:</strong> Arnaud Le Hors (<abbr title="World Wide Web Consortium">W3C</abbr>) and Robert S. Sutor (IBM Research).</p>
+
+ <p><strong>Test suite contributors:</strong> Fred Drake, Mary Brady (NIST), Carmelo Montanez (NIST), Rick Rivello (NIST), Robert Clary (Netscape), Neil Delima (IBM),
+ with a special mention to Curt Arnold.</p>
+
+ <p>Thanks to all those who have helped to improve this specification by sending suggestions and corrections (please, keep bugging us with your issues!), or writing
+ informative books or Web sites: Brad Pettit, Dylan Schiemann, David Flanagan, Steven Pemberton, Curt Arnold, Al Gilman, Misha Wolf, Sigurd Lerstad, Michael B.
+ Allen, Alexander J. Vincent, Martin Dürst, Ken Rehor, NAKANO Masayuki, Garrett Smith, Sergey Ilinsky, Martijn Wargers, Sean Hogan, Magnus Kristiansen, Alex
+ Russell, Jorge Chamorro, Peter-Paul Koch, William Edney, Erik Arvidsson, Cameron McCormack, Kazuyuki Ashimura, Øistein E. Andersen, James Su, Tony Chang, Ojan Vafai,
+ Richard Ishida, Paul Irish, Mike Taylor, Oliver Hunt, Alexey Proskuryakov, Giuseppe Pascale, and Jan Goyvaerts (regular-expressions.info).</p>
+
+ <div id="acknowledgements-Productions" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_acknowledgements-Productions"><span class="secno">6.10.1 </span>Production Systems</h4>
+
+ <p>The current drafts of this specification are lovingly hand-crafted in HTML and SVG, using ReSpec to format the document according to <abbr title="World Wide Web Consortium">W3C</abbr> requirements.</p>
+
+ <p>Earlier versions of this specification were written in XML — the HTML, OMG IDL, Java and ECMAScript bindings were all produced automatically. Thanks to Joe English,
+ author of <a class="normative" href="http://www.flightlab.com/cost/">cost</a>, which was used as the basis for producing DOM Level 1. Thanks also to Gavin Nicol,
+ who wrote the scripts which run on top of cost. Arnaud Le Hors and Philippe Le Hégaret maintained the scripts.</p>
+
+ <p>After DOM Level 1, we used <a class="normative" href="http://xerces.apache.org/xerces-j/">Xerces</a> as the basis DOM implementation and wish to thank the authors.
+ Philippe Le Hégaret and Arnaud Le Hors wrote the <a class="normative" href="http://dev.w3.org/cvsweb/java/classes/org/w3c/tools/specgenerator/">Java programs</a>
+ which are the <a class="def" href="#glossary-DOM-application">DOM application</a>.</p>
+
+ <p>Thanks also to Jan Kärrman, author of <a class="normative" href="http://user.it.uu.se/~jan/html2ps.html">html2ps</a>, which we use in creating the PostScript
+ version of the specification.</p>
+ </div>
+ </div>
+
+
+<!-- Appendix H: References ========================================================-->
+
+ <div id="references-role-references" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h3 id="h3_references-role-references"><span class="secno">6.11 </span>References</h3>
+
+ <p>For the latest version of any <abbr title="World Wide Web Consortium">W3C</abbr> specification please consult the list of <a class="normative" href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> Technical Reports</a>
+ available at http://www.w3.org/TR/. </p>
+
+ <div id="references-References-Normative" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_references-References-Normative"><span class="secno">6.11.1 </span>Normative References</h4>
+
+ <dl>
+ <dt><strong>[BCP-47]</strong> Best Current Practice 47: Tags for Identifying Languages</dt>
+ <dd>A. Phillips, M. Davis, Editors, September 2009. The specification for describing the structure, content, construction, and semantics of language tags to indicate
+ the human language used. Available at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a></dd>
+
+ <dt><strong>[CharMod]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2005/REC-charmod-20050215/">Character Model for the World Wide Web 1.0: Fundamentals</a></cite>, M. Dürst, F. Yergeau,
+ R. Ishida, M. Wolf, T. Texin, Editors. World Wide Web Consortium, 15 February 2005. This version of the Character Model for the World Wide Web 1.0: Fundamentals
+ specification is http://www.w3.org/TR/2005/REC-charmod-20050215/. The <a class="normative" href="http://www.w3.org/TR/charmod/">latest version of Character Model for
+ the World Wide Web 1.0: Fundamentals</a> is available at http://www.w3.org/TR/charmod/. </dd>
+
+ <dt><strong>[DOM3 Core]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/">Document Object Model Level 3 Core Specification</a></cite>, A. Le Hors, et al., Editors.
+ World Wide Web Consortium, April 2004. This version of the Document Object Model Level 3 Core Specification is http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/.
+ The <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/">latest version of DOM Level 3 Core</a> is available at http://www.w3.org/TR/DOM-Level-3-Core/. </dd>
+
+ <dt><strong>[DOM2 Events]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/">Document Object Model Level 2 Events Specification</a></cite>, T. Pixley, Editor. World
+ Wide Web Consortium, November 2000. This version of the Document Object Model Level 2 Events Specification is http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113.
+ The <a class="normative" href="http://www.w3.org/TR/DOM-Level-2-Events/">latest version of Document Object Model Level 2 Events</a> is available
+ at http://www.w3.org/TR/DOM-Level-2-Events/. </dd>
+
+ <dt><strong>[ECMAScript]</strong></dt>
+ <dd><cite><a href="http://ecma-international.org/ecma-262/5.1/">ECMAScript Language Specification</a></cite>, 5.1 Edition. European Computer Manufacturers Association,
+ Standard ECMA-262, June 2011. This version of the ECMAScript Language is available from http://ecma-international.org/ecma-262/5.1/. </dd>
+
+ <dt><strong>[HTML5]</strong></dt>
+ <dd><cite class="w3cwd"><a href="http://www.w3.org/TR/2012/WD-html5-20120329/">HTML 5</a></cite>, I. Hickson, editor. World Wide Web Consortium, <span class="wip">work
+ in progress</span>, 29 March 2012. This edition of HTML 5 is http://www.w3.org/TR/2012/WD-html5-20120329/. The <a href="http://www.w3.org/TR/html5/">latest edition of
+ HTML 5</a> is available at http://www.w3.org/TR/html5/. </dd>
+
+ <dt><strong>[Java]</strong></dt>
+ <dd><cite><a href="http://www.oracle.com/technetwork/java/index.html">The Java Language Specification</a></cite>, J. Gosling, B. Joy, and G. Steele, Authors. Addison-Wesley, September
+ 1996. Available at http://java.sun.com/docs/books/jls </dd>
+
+ <dt id="ref-rfc2119"><strong>[RFC2119]</strong> Key words for use in RFCs to indicate Requirement Levels</dt>
+ <dd>S Bradner, 1997. The specification for how to use English to specify normativity, as if it were a technical language. Available at <a href="http://www.ietf.org/rfc/rfc2119.txt">
+ http://www.ietf.org/rfc/rfc2119.txt </a></dd>
+
+ <dt><strong>[UAX #15]</strong></dt>
+ <dd><cite><a href="http://www.unicode.org/reports/tr15/">Unicode Normalization Forms</a></cite>, The Unicode Standard Annex #15. The Unicode Consortium, 2006. The
+ latest version of this annex is available at http://www.unicode.org/reports/tr15/.</dd>
+
+ <dt><strong>[UIEvents]</strong></dt>
+ <dd><cite><a href="https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm">UI Events</a></cite>,
+ T. Leithead, G. Kacmarcik, eds. World Wide Web Consortium,
+ <span class="wip">Editor's Draft</span>, 5 May 2013.
+ </dd>
+
+ <dt><strong>[Unicode]</strong></dt>
+ <dd><cite>The Unicode Standard, Version 5.0</cite>, ISBN 0-321-48091-0, as updated periodically by the publication of new versions. See also <a class="normative" href="http://www.unicode.org/standard/versions/">Versions of the Unicode Standard</a>, available at http://www.unicode.org/standard/versions/ for
+ latest version and additional information on versions of the standard and of the Unicode Character Database.</dd>
+
+ <dt><strong>[WEB IDL]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/WebIDL/">Web IDL</a></cite>, C. McCormack. 19 April 2012. This version of the Web IDL Candidate Recommendation is:
+ http://www.w3.org/TR/2012/CR-WebIDL-20120419/. The <a href="http://dev.w3.org/2006/webapi/WebIDL/">latest version of Web IDL</a> is available at
+ http://dev.w3.org/2006/webapi/WebIDL/. </dd>
+
+ <dt><strong>[XML Namespaces 1.0]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-names-20060816/">Namespaces in XML 1.0</a></cite>, T. Bray, D. Hollander, A. Layman, and R. Tobin, Editors. World
+ Wide Web Consortium, 16 August 2006. This version of the Namespaces in XML 1.0 Specification is http://www.w3.org/TR/2006/REC-xml-names-20060816. The <a class="normative" href="http://www.w3.org/TR/xml-names/">latest version of Namespaces in XML 1.0</a> is available at http://www.w3.org/TR/xml-names/.</dd>
+ </dl>
+ </div>
+
+ <div id="references-References-Informative" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter" class="section">
+ <h4 id="h4_references-References-Informative"><span class="secno">6.11.2 </span>Informative References</h4>
+ <dl>
+ <dt><strong>[ARIA]</strong></dt>
+ <dd><cite class="w3cwd"><a href="http://www.w3.org/TR/2009/WD-wai-aria-20091215/">Accessible Rich Internet Applications (WAI-ARIA) Version 1.0</a></cite>, J. Craig, M. Cooper,
+ R. Schwerdtfeger, L. Seeman, L. Pappas, eds. World Wide Web Consortium, 18 January 2011. This version of the WAI-ARIA Candidate Recommendation is
+ http://www.w3.org/TR/2011/CR-wai-aria-20110118/. The <a href="http://www.w3.org/TR/wai-aria/">latest edition of WAI-ARIA</a> is available at http://www.w3.org/TR/wai-aria/. </dd>
+
+ <dt><strong>[XFORMS]</strong></dt>
+ <dd><cite class="w3crec"><a href="http://www.w3.org/TR/2009/REC-xforms-20091020/">XForms 1.1</a></cite>, J. Boyer, ed. World Wide Web Consortium, <span class="wip">work
+ in progress</span>, 20 October 2009. This edition of XForms 1.1 is http://www.w3.org/TR/2009/REC-xforms-20091020/. The <a href="http://www.w3.org/TR/xforms/">latest
+ edition of XForms</a> is available at http://www.w3.org/TR/xforms/. </dd>
+
+ <dt><strong>[CSS2.1]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a></cite>, B. Bos, T. Çelik,
+ I. Hickson, H.W. Lie, Editors. World Wide Web Consortium, 07 June 2011, This version of the CSS 2.1 Recommendation is http://www.w3.org/TR/2011/REC-CSS2-20110607/.
+ The <a class="normative" href="http://www.w3.org/TR/CSS2/">latest version of CSS 2.1</a> is available at http://www.w3.org/TR/CSS2/. </dd>
+
+ <dt><strong>[DASE]</strong></dt>
+ <dd><cite><a href="http://www.atsc.org/cms/standards/a100/a_100_2.pdf">ATSC A/100-2, DTV Application Software Environment Level 1 (DASE-1) Part 2: Declarative Applications
+ and Environment</a></cite>. Advanced Television Systems Committee, 09 March 2003. Available at <a href="http://www.atsc.org/cms/standards/a100/a_100_2.pdf">
+ http://www.atsc.org/cms/standards/a100/a_100_2.pdf </a>.</dd>
+
+ <dt><strong>[DOM3 Load and Save]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/">Document Object Model Level 3 Load and Save Specification</a></cite>, J. Stenback, A. Heninger,
+ Editors. World Wide Web Consortium, April 2004. This version of the DOM Level 3 Load and Save Specification is http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/.
+ The <a class="normative" href="http://www.w3.org/TR/DOM-Level-3-LS/">latest version of DOM Level 3 Load and Save</a> is available at http://www.w3.org/TR/DOM-Level-3-LS/. </dd>
+
+ <dt><strong>[DOM2 Range]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/">Document Object Model (DOM) Level 2 Traversal and Range Specification</a></cite>, J. Kesselman,
+ J. Robie, M. Champion, P. Sharpe, V. Apparao, L. Wood, Editors. World Wide Web Consortium, November 2000.</dd>
+
+ <dt><strong>[DOM4]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/dom/">DOM4</a></cite>, A. van Kesteren, A. Gregor, Ms2ger, Editors. World Wide Web Consortium, <span class="wip">Working Draft</span>,
+ 5 April 2012. </dd>
+
+ <dt><strong>[DWW95]</strong></dt>
+ <dd><cite>Developing International Software for Windows 95 and Windows NT: A Handbook for International Software Design</cite>, N. Kano, Author. Microsoft Press, 1995.
+ ISBN 1-55615-840-8.</dd>
+
+ <dt><strong>[HTML 4.01]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/1999/REC-html401-19991224/">HTML 4.01 Specification</a></cite>, D. Raggett, A. Le Hors, and I. Jacobs, Editors. World Wide
+ Web Consortium, December 1999. This version of the HTML 4.01 Recommendation is http://www.w3.org/TR/1999/REC-html401-19991224. The <a class="normative" href="http://www.w3.org/TR/html4/">
+ latest version of HTML 4</a> is available at http://www.w3.org/TR/html4/. </dd>
+
+ <dt><strong>[HTML Editing]</strong></dt>
+ <dd><cite><a href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html">HTML Editing APIs</a></cite>, A. Gregor, Editor. World Wide Web Consortium, <span class="wip">
+ work in progress</span>, 12 March 2012. </dd>
+
+ <dt><strong>[ISO9995-2/3]</strong></dt>
+ <dd><cite><a href="http://www.iso.org/iso/search.htm?qt=9995&published=on">ISO/IEC 9995, Information technology -- Keyboard layouts for text and office systems -- Part 2:
+ Alphanumeric Section and Part 3: Complementary layouts of the alphanumeric zone of the alphanumeric section.</a></cite></dd>
+
+ <dt><strong>[ISO9995-8]</strong></dt>
+ <dd><cite><a href="http://www.iso.org/iso/search.htm?qt=9995&published=on">ISO/IEC 9995-8:2006, Information technology -- Keyboard layouts for text and office systems --
+ Part 8: Allocation of letters to the keys of a numeric keypad.</a></cite></dd>
+
+ <dt><strong>[KeyEvent for Java]</strong></dt>
+ <dd><cite><a href="http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html">Java™ Platform, Standard Edition 6 API Specification, Class java.awt.events.KeyEvent</a></cite>.
+ Oracle. Available at http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html. </dd>
+
+ <dt><strong>[Keys enumeration for .Net]</strong></dt>
+ <dd><cite><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx">.NET Framework 4.5 Class Library, Keys Enumeration</a></cite>.
+ Microsoft. Available at http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx.</dd>
+
+ <dt><strong>[KeyProps]</strong></dt>
+ <dd><cite class="w3cwd"><a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html">Legacy Keyboard Event Properties</a></cite>, D. Schepers, editor.
+ World Wide Web Consortium, <span class="wip">work in progress</span>, 04 August 2010. This edition of Legacy Keyboard Event Properties is
+ https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html.
+ The <a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html">latest edition
+ of Legacy Keyboard Event Properties</a> is available at https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html. </dd>
+
+ <dt><strong>[OCAP]</strong></dt>
+ <dd><cite><a href="http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf">Open Cable Application Platform 1.1.3</a></cite>. Cable Television Laboratories,
+ Inc., 03 June 2010. Available at <a href="http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf">http://www.cablelabs.com/specifications/OC-SP-OCAP1.1.3-100603.pdf</a>.</dd>
+
+ <dt><strong>[PCRE]</strong></dt>
+ <dd><cite><a href="http://www.pcre.org/">Perl Compatible Regular Expressions library</a></cite>. Available at http://www.pcre.org/. </dd>
+
+ <dt><strong>[RFC20]</strong> <acronym title="American Standard Code for Information Interchange">ASCII</acronym> format for Network Interchange</dt>
+ <dd>V. Cerf, 1969. Available at <a href="http://tools.ietf.org/rfc/rfc20.txt">http://tools.ietf.org/rfc/rfc20.txt</a></dd>
+
+ <dt><strong>[US-<acronym title="American Standard Code for Information Interchange">ASCII</acronym>]</strong> Coded Character Set - 7-Bit American Standard Code for Information Interchange</dt>
+ <dd>Standard ANSI X3.4-1986, ANSI, 1986.</dd>
+
+ <dt><strong>[UAAG 2.0]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/">User Agent Accessibility Guidelines (UAAG) 2.0</a></cite>, J. Allan, K. Ford, J. Richards, J. Spellman, editors.
+ World Wide Web Consortium, <span class="wip">work in progress</span>, 8 March 2010. This version of the UAAG 2.0 specfication is http://www.w3.org/WAI/UA/2010/ED-UAAG20-20100308/.
+ The <a class="normative" href="http://www.w3.org/TR/UAAG20/">latest version of UAAG 2.0</a> is available at http://www.w3.org/TR/UAAG20/. </dd>
+
+ <dt><strong>[WEB4CE]</strong></dt>
+ <dd><cite><a href="http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI%29.aspx">ANSI/CEA-2014-B, Web-based Protocol and Framework for Remote User Interface on UPnPTM Networks
+ and the Internet (Web4CE)</a></cite>. Consumer Electronics Association, January 2011. Available at <a href="http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI).aspx">
+ http://www.ce.org/Standards/Standard-Listings/R7-Home-Network-Committee/CEA-2014-B-(ANSI%29.aspx </a>.</dd>
+
+ <dt><strong>[WIN1252]</strong></dt>
+ <dd><a href="http://www.microsoft.com/globaldev/reference/sbcs/1252.htm">Windows 1252</a> a Coded Character Set - 8-Bit. Microsoft Corporation.</dd>
+
+ <dt><strong>[XML 1.0]</strong></dt>
+ <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816/">Extensible Markup Language (XML) 1.0</a></cite>, T. Bray, J. Paoli, C. M. Sperberg-McQueen, et. al,
+ Editors. World Wide Web Consortium, August 2006. This version of the XML 1.0 Recommendation is http://www.w3.org/TR/2006/REC-xml-20060816/. The <a class="normative" href="http://www.w3.org/TR/xml/">latest version of XML 1.0</a> is available at http://www.w3.org/TR/xml/. </dd>
+ </dl>
+ </div>
+ </div>
+
+
+
+</div><form action="http://www.w3.org/Bugs/Public/enter_bug.cgi" target="_blank" style="position: fixed; padding: 5px; top: 1em; right: 2em; font-family: sans-serif; font-size: 0.8em; background-color: rgb(255, 255, 255); border: 1px solid rgb(255, 0, 0);">Select text and <input type="submit" accesskey="f" value="file a bug" style="display: block;" /><input type="hidden" name="comment" value="" /><input type="hidden" name="product" value="WebAppsWG" /><input type="hidden" name="component" value="DOM3 Events" /></form></body></html>
\ No newline at end of file