W3CWeb Accessibility Initiative Home

No automatic activation of ONFOCUS and ONBLUR events

On this page: Test 1 | References | About these tests

Nearby: More HTML 4.01 Tests | UAAG 1.0 Test Suite

UAAG 1.0 Requirement

Checkpoint 9.5 No events on focus change (Priority 2 )
Provision 1 : Allow configuration so that moving the content focus to or from an enabled element does not automatically activate any explicitly associated event handlers of any event type.

Test 1 :

Procedure

  1. Configure the user agent so that moving content focus to an enabled element does not automatically activate any explicitly associated event handlers of any event type.
  2. Move content focus to the "Test Button".
  3. Move content focus off the "Test Button".

Run test

Event has been fired

Expected results

  1. When focus is moved to the "Test Button", the "Event Fired" image does not appear.
  2. When focus is moved off the "Test Button", the "Event Handler" image does not appear.

Source code

<table summary="layout table">
  <tbody>
    <tr>
      <td rowspan="1" colspan="1">
        <form action="../action/return.html" method="post" enctype="application/x-www-form-urlencoded">
          <button onblur="blurTest('../images/eventHandler.gif')" onfocus="focusTest('../images/eventFired.gif')" type="submit">Test Button</button>
        </form>
      </td>
      <td rowspan="1" colspan="1">
        <table border="1">
          <tbody>
            <tr>
              <td rowspan="1" colspan="1">
                <img id="test2" height="60" width="300" alt="Event has been fired" src="../images/clear.gif" border="0" name="test2"></img>
              </td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

Test Script Code

function focusTest (img) { document.test2.src = img } function blurTest (img) { document.test2.src = img }

References

  1. HTML 4.01 specification for ONFOCUS
  2. HTML 4.01 specification for ONBLUR

About this test suite

This test is part of a test suite for the User Agent Accessibility Guidelines (UAAG) 1.0 . This work is conducted by the User Agent Accessibility Guidelines Working Group , which is part of W3C's Web Accessibility Initiative (WAI) . Please send comments on this test to w3c-wai-ua@w3.org ( public archive ).


Test created by:

Last modified: $Date: 2003/04/02 23:46:46 $ by $Author: jongund $