onfocus Event Handler Attached to SELECT
User agents often perform a task when an event occurs that is due to user interaction (e.g., document loading, mouse motion or a key press), a request from the operating environment, etc. Some markup languages allow authors to specify that a script, called an event handler, be executed when the event occurs. An event handler is "explicitly associated with an element" when the event handler is associated with that element through markup or the DOM. The term "event bubbling" describes a programming style where a single event handler dispatches events to more than one element. In this case, the event handlers are not explicitly associated with the elements receiving the events (except for the single element that dispatches the events).
This document is part of a suite of pages designed to test the implementation of the W3C's User Agent Accessibility Guidelines (UAAG). In particular, this page is designed to test implementation of UAAG checkpoints 5.4, 9.4, and 9.5:
An onfocus event occurs when an element receives focus either
by the pointing device or by tabbing navigation. In HTML4, the
onfocus attribute may be used with the following elements:
A,
AREA,
LABEL,
INPUT,
SELECT (the subject of this test page),
TEXTAREA, and
BUTTON
On this test page, the HTML4 event handler onfocus has been associated with a select option
(list box) in a simple, one-field form that lacks an explicit
Submit mechanism.
This page contains a simple, one-field form.
If your user agent supports the ACCESSKEY mechanism introduced in HTML4, you can
instantly establish focus on the list box using the
ACCESSKEY defined for the form, f.
If your user agent supports scripting, and if support for scripting is active, once the select option list box receives focus your user agent will automatically fetch the User Agent Accessibility Guidelines.
If you are using a user agent that does not support scripting, or if
you have support for scripting turned off, establishing focus by tabbing
to the SELECT OPTION field or by clicking on the list box
with a pointer, for example, should have no effect. Note that, since the
form lacks an explicit Submit
mechanism, it is therefore intrinsically dependent on scripting, you may
not be able to use it to fetch the selected Guidelines document.
In order to conform to checkpoint 9.5, your user agent must offer a configuration in
which you are able to establish focus on any element for which
an input device event handler has been explicitly associated
without automatically triggering that event.
As regards this test page, this would mean that you are able
to establish focus on the form control for which an
onfocus event has been defined without triggering
that event--in this case, fetching the document source for the
User Agent Accessibility Guidelines upon the receipt of focus.
In order to conform to checkpoint 9.4, your user agent must allow you to query the form control, once it receives focus, for a complete list of the input device event handlers which have been explicitly associated with it.
In order to conform to checkpoint 5.4, your user agent must offer a configuration that prompts you to confirm the submission of any form if submission of the form's content is initiated by anything other than an explicit user request. Conformance with this checkpoint would prevent the automatic submission of the form upon receipt of focus even if your user agent did not satisfy checkpoints 9.4 and 9.5.
Please send comments and observations about this test page to <w3c-wai-ua@w3.org>. Your comments will be archived in the User Agent mailing list's public hypertext archive. Please make your observations as specific and detailed as possible. Be sure to include the following information when you report your observations to the User Agent Accessibility Guidelines Working Group:
SUBMIT button (which
should contain the text label "Get Guidelines") to
obtain the Guidelines if you were able to establish focus on
the form without having it automatically fetch the Guidelines
document? Please be as specific as possible, listing all actions
taken, such as keystroke sequences, use of a pointing device,
etc.