an ancient unfinished article that has been sitting in my draft folder
since last November
Mozilla's onblur/onfocus events are fired inconsistantly. Sometimes
onblur/onfocus events are fired multiple times. Tab switching interferes
with the events. Task switcing also interferes with the events. Tabbing
interferes with the events. Type Ahead Find interferes with the events.
Alert() interferes with the events. In short, Mozilla is very screwed
when it comes to determining when and whether to call an focus/blur
event handler.
see http://devsupport.mozdev.org/QA/test_focus.html
Results from testing with Mozilla 2002110708 on Windows 98
58441 134293 112294
Test 1:
Procedure:
Press `P' to suppress all event messages
Set the test case to track onChange event for any input
with `Prompt with event text' setting
Press `P' to turn on event tracking
Focus the input element being tracked (by tabbing or by
clicking on the element)
Switch focus away from the input element
Result:
onChange event is fired every time focus is shifted away
from the input element even if the input value is left
at its default
Test 2:
Procedure:
Shift+Reload the page
Press `P' to suppress all event messages
Press `P' to turn on event tracking
Result:
Mozilla 2002110708 win98,
Use the testcase in the URL
If you set the browser to track onfocus events for an input, the
document object, and the window object,
If browser is already in the foreground, every time you click on
the document space, you will see
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
If browser is already in the foreground, every time you click on
a form input or button that has no onfocus event handler, you will
see
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
If browser is already in the foreground, every time you click on
a form input or button that has an onfocus event handler, you will
see
Element '<INPUT>' onFocus event has fired
If browser is already in the foreground, every time you use tab to
focus a form input or link, you will see
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
If browser is active, every time you switch from another tab to the
test case tab, you will see
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
Element 'window' onFocus event has fired
Element '<INPUT>' onFocus event has fired
(you'll see last item only if INPUT has default focus)
If browser is inactive, and if no form input has default focus,
every time you activates the window (by clicking on the document
space or by task switching), you will see
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
Element 'window' onFocus event has fired
Element 'document' onFocus event has fired
Element 'window' onFocus event has fired
If browser is inactive, and if a form input has default focus,
every time you activates the window, you will see
- dwx is gone Daniel Wang
- my Wishlist FAQ to-do list: Daniel Wang
- Re: my Wishlist FAQ to-do list: Daniel Wang
- Daniel Wang
