1
+ <h1>DOM Event Architecture</h1>
2
+
3
+ <pre class="metadata">
4
+ Shortname : uievents-algo
5
+ Level :
6
+ Group :
7
+ Status : DREAM
8
+ Editor : No One
9
+ Abstract :
10
+ This document provides a non-normative description of the DOM Event architecture.
11
+ It was previously part of the UI Events spec.
12
+ </pre>
13
+
1
14
<section>
2
15
<h2 id="dom-event-architecture">DOM Event Architecture</h2>
3
16
4
17
5
18
<em> This section is non-normative. Refer to [[DOM]] for a normative description
6
19
of the DOM event architecture</em>
7
20
21
+ This information in this document was previously included in the UIEvents spec, but
22
+ has been removed to this document so avoid confusion. As noted above, the proper
23
+ definitions are part of the [[DOM]] specification.
24
+
8
25
<h3 id="event-flow">Event dispatch and DOM event flow</h3>
9
26
10
27
This section gives a brief overview of the event <a>dispatch</a> mechanism
@@ -203,8 +220,7 @@ of the DOM event architecture</em>
203
220
object derived from these objects using the algorithm below, all
204
221
{{KeyboardEvent}} , {{MouseEvent}} , and derived objects have
205
222
<dfn id="internal-key-modifier-state">internal key modifier state</dfn> which can be set and
206
- retrieved using the <a href="#keys-modifiers">key modifier names</a>
207
- described in the
223
+ retrieved using the key modifier names described in the
208
224
<a href="http://www.w3.org/TR/uievents-key/#keys-modifier">Modifier Keys table</a>
209
225
in [[UIEvents-Key]] .
210
226
@@ -226,3 +242,176 @@ of the DOM event architecture</em>
226
242
to the corresponding value.
227
243
228
244
</section>
245
+
246
+ <section>
247
+ <h2 id="glossary">Glossary</h2>
248
+
249
+ Some of the following term definitions have been borrowed or modified from
250
+ similar definitions in other W3C or standards documents. See the links within
251
+ the definitions for more information.
252
+
253
+ : <dfn>activation behavior</dfn>
254
+ :: The action taken when an <a>event</a> , typically initiated by users through
255
+ an input device, causes an element to fulfill a defined task. The task MAY
256
+ be defined for that element by the <a>host language</a> , or by
257
+ author-defined variables, or both. The default task for any given element
258
+ MAY be a generic action, or MAY be unique to that element. For example, the
259
+ activation behavior of an HTML or SVG <code> <a></code> element is to
260
+ cause the <a>user agent</a> to traverse the link specified in the
261
+ <code> href</code> attribute, with the further optional parameter of
262
+ specifying the browsing context for the traversal (such as the current
263
+ window or tab, a named window, or a new window). The activation behavior of
264
+ an HTML <code> <input></code> element with the <code> type</code>
265
+ attribute value <code> submit</code> is be to send the values of the form
266
+ elements to an author-defined IRI by the author-defined HTTP method.
267
+
268
+ : <dfn>activation trigger</dfn>
269
+ :: An event which is defined to initiate an <a>activation behavior</a> .
270
+
271
+ : <dfn lt="bubble phase|bubbling phase">bubbling phase</dfn>
272
+ :: The process by which an <a>event</a> can be handled by one of the target's
273
+ ancestors <em> after</em> being handled by the <a>event target</a> . See the
274
+ description of the <a>bubble phase</a> in the context of event flow for more
275
+ details.
276
+
277
+ : <dfn>capture phase</dfn>
278
+ :: The process by which an <a>event</a> can be handled by one of the target's
279
+ ancestors <em> before</em> being handled by the <a>event target</a> . See the
280
+ description of the <a href="#capture-phase">capture phase</a> in the context
281
+ of event flow for more details.
282
+
283
+ : <dfn>current event target</dfn>
284
+ :: In an event flow, the current event target is the object associated with the
285
+ <a>event handler</a> that is currently being dispatched. This object MAY be
286
+ the <a>event target</a> itself or one of its ancestors. The current event
287
+ target changes as the <a>event</a> propagates from object to object through
288
+ the various <a>phases</a> of the event flow. The current event target is the
289
+ value of the {{Event/currentTarget}} attribute.
290
+
291
+ : <dfn>default action</dfn>
292
+ :: A <a>default action</a> is an OPTIONAL supplementary behavior that an
293
+ implementation MUST perform in combination with the dispatch of the event
294
+ object. Each event type definition, and each specification, defines the
295
+ <a>default action</a> for that event type, if it has one. An instance of an
296
+ event MAY have more than one <a>default action</a> under some circumstances,
297
+ such as when associated with an <a>activation trigger</a> . A <a>default
298
+ action</a> MAY be cancelled through the invocation of the
299
+ {{Event/preventDefault()}} method.
300
+
301
+ : <dfn>dispatch</dfn>
302
+ :: To create an event with attributes and methods appropriate to its type and
303
+ context, and propagate it through the DOM tree in the specified manner.
304
+ Interchangeable with the term <q> <a>fire</a> </q> , e.g., <q> fire a
305
+ EVENT{click} event</q> or <q> dispatch a EVENT{load} event</q> .
306
+
307
+ : <dfn>document</dfn>
308
+ :: An object instantiating the {{Document}} interface [[DOM-Level-3-Core]] ,
309
+ representing the entire HTML or XML text document. Conceptually, it is the
310
+ root of the document tree, and provides the primary access to the document's
311
+ data.
312
+
313
+ : <dfn>DOM application</dfn>
314
+ :: A DOM application is script or code, written by a content author or
315
+ automatically generated, which takes advantage of the interfaces, methods,
316
+ attributes, events, and other features described in this specification in
317
+ order to make dynamic or interactive content, such as Web applications,
318
+ exposed to users in a <a>user agent</a> .
319
+
320
+ : <dfn>event</dfn>
321
+ :: An event is the representation of some occurrence (such as a mouse click on
322
+ the presentation of an element, the removal of child node from an element,
323
+ or any number of other possibilities) which is associated with its <a>event
324
+ target</a> . Each event is an instantiation of one specific <a>event
325
+ type</a> .
326
+
327
+ : <dfn>event handler</dfn>
328
+ : <dfn>event listener</dfn>
329
+ :: An object that implements the {{EventListener}} interface and provides an
330
+ {{EventListener/handleEvent()}} callback method. Event handlers are
331
+ language-specific. Event handlers are invoked in the context of a particular
332
+ object (the <a>current event target</a> ) and are provided with the event
333
+ object itself.
334
+
335
+ <p class="note">
336
+ In JavaScript, user-defined functions are considered to implement the
337
+ {{EventListener}} interface. Thus the event object will be provided as the
338
+ first parameter to the user-defined function when it is invoked.
339
+ Additionally, JavaScript objects can also implement the {{EventListener}}
340
+ interface when they define a {{EventListener/handleEvent()}} method.
341
+ </p>
342
+
343
+ : <dfn>event order</dfn>
344
+ :: The sequence in which events from the same event source or process occur,
345
+ using the same or related event interfaces. For example, in an environment
346
+ with a mouse, a track pad, and a keyboard, each of those input devices would
347
+ constitute a separate event source, and each would follow its own event
348
+ order. A EVENT{mousedown} event from the trackpad followed by a
349
+ EVENT{mouseup} event from the mouse would not result in a EVENT{click} event.
350
+
351
+ <p class="note">
352
+ There can be interactions between different event orders. For example, a
353
+ EVENT{click} event might be modified by a concurrent EVENT{keydown} event
354
+ (e.g., via KEYCAP{Shift}<code> +</code> EVENT{click}). However, the event
355
+ orders of these different event sources would be distinct.
356
+
357
+ The event order of some interfaces are device-independent. For example, a
358
+ user might change focus using the KEYCAP{Tab} key, or by clicking the new
359
+ focused element with the mouse. The event order in such cases depends on
360
+ the state of the process, not on the state of the device that initiates the
361
+ state change.
362
+
363
+ : <dfn>event phase</dfn>
364
+ :: See <a>phase</a> .
365
+
366
+ : <dfn>event target</dfn>
367
+ :: The object to which an <a>event</a> is targeted using the event flow.
368
+ The event target is the value of the {{Event/target}} attribute.
369
+
370
+ : <dfn>fire</dfn>
371
+ :: A synonym for <a>dispatch</a> .
372
+
373
+ : <dfn>host language</dfn>
374
+ :: Any language which integrates the features of another language or API
375
+ specification, while normatively referencing the origin specification rather
376
+ than redefining those features, and extending those features only in ways
377
+ defined by the origin specification. An origin specification typically is
378
+ only intended to be implemented in the context of one or more host
379
+ languages, not as a standalone language. For example, XHTML, HTML, and SVG
380
+ are host languages for UI Events, and they integrate and extend the objects
381
+ and models defined in this specification.
382
+
383
+ : <dfn>phase</dfn>
384
+ :: In the context of <a>events</a> , a phase is set of logical traversals from
385
+ node to node along the DOM tree, from the <a>Window</a> to the {{Document}}
386
+ object, <a>root element</a> , and down to the <a>event target</a> (<a>capture
387
+ phase</a> ), at the <a>event target</a> itself (<a>target phase</a> ), and
388
+ back up the same chain (<a>bubbling phase</a> ).
389
+
390
+ : <dfn>propagation path</dfn>
391
+ :: The ordered set of <a>current event targets</a> though which an <a>event</a>
392
+ object will pass sequentially on the way to and back from the <a>event
393
+ target</a> . As the event propagates, each <a>current event target</a> in
394
+ the propagation path is in turn set as the {{Event/currentTarget}} . The
395
+ propagation path is initially composed of one or more <a>event phases</a> as
396
+ defined by the <a>event type</a> , but MAY be interrupted. Also known as an
397
+ <em> event target chain</em> .
398
+
399
+ : <dfn>target phase</dfn>
400
+ :: The process by which an <a>event</a> can be handled by the <a>event
401
+ target</a> . See the description of the <a>target phase</a> in the context of
402
+ event flow for more details.
403
+
404
+ : <dfn>user agent</dfn>
405
+ :: A program, such as a browser or content authoring tool, normally running on
406
+ a client machine, which acts on a user's behalf in retrieving, interpreting,
407
+ executing, presenting, or creating content. Users MAY act on the content
408
+ using different user agents at different times, for different purposes.
409
+
410
+ : <dfn>Window</dfn>
411
+ :: The <code> Window</code> is the object referred to by the current <a>document</a> 's
412
+ browsing context's Window Proxy object as defined in
413
+ <a href="http://dev.w3.org/html5/spec/single-page.html#windowproxy" title="HTML5 WindowProxy description">HTML5</a>
414
+ [[HTML5]] .
415
+
416
+ </section>
417
+
0 commit comments