Discussion:
Is 'DOMFocusIn' supported?
Stanimir Stamenkov
2010-07-18 15:48:18 UTC
Permalink
I see the 'DOMFocusIn' event type listed on two pages on DMO:

https://developer.mozilla.org/en/DOM_Events#DOMFocusIn
https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference/DOM_Events

I see it also listed in the event list of the Event Spy [1] extension.

I bascially have an HTML page with some focusable elements (form
controls, hyper-links) and register an event handler on the
#document node like:

document.addEventListener("DOMFocusIn", myHandler, false);

My event handler gets never invoked. The same thing appears to work
in Opera and Safari. Is 'DOMFocusIn' supported and specifically in
web pages?

[1] https://addons.mozilla.org/addon/1100/
--
Stanimir
Martin Honnen
2010-07-18 17:05:05 UTC
Permalink
Post by Stanimir Stamenkov
https://developer.mozilla.org/en/DOM_Events#DOMFocusIn
https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference/DOM_Events
I see it also listed in the event list of the Event Spy [1] extension.
I bascially have an HTML page with some focusable elements (form
controls, hyper-links) and register an event handler on the #document
document.addEventListener("DOMFocusIn", myHandler, false);
My event handler gets never invoked. The same thing appears to work in
Opera and Safari. Is 'DOMFocusIn' supported and specifically in web pages?
It doesn't seem to be implemented in Mozilla, as
https://bugzilla.mozilla.org/show_bug.cgi?id=396927 suggests. The
comments there conclude that you could instead use a capturing event
listener for the focus event.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
Stanimir Stamenkov
2010-07-18 17:15:48 UTC
Permalink
Post by Martin Honnen
Post by Stanimir Stamenkov
Is 'DOMFocusIn' supported and specifically in web pages?
It doesn't seem to be implemented in Mozilla, as
https://bugzilla.mozilla.org/show_bug.cgi?id=396927 suggests. The
comments there conclude that you could instead use a capturing event
listener for the focus event.
Thanks for pointing it out and yes, for my purposes (tracking last
focused element) I've used capturing 'focus' handler and I generally
think it is better this way. For IE support I've used the bubbling
'focusin' ('onfocusin') event I've just experimented with the
'DOMFocusIn' which appears specified by DOM Level 2 Events (and
still appears in the latest DOM Level 3 Events draft, although
deprecated in favor of 'focusin').
--
Stanimir
Boris Zbarsky
2010-07-19 03:00:23 UTC
Permalink
Post by Stanimir Stamenkov
https://developer.mozilla.org/en/DOM_Events#DOMFocusIn
https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference/DOM_Events
Sounds like we need a docs update... File a bug? I'd just remove
those, but I have no idea why they're there to start with, so maybe I'm
missing some documentation policy somewhere.....

-Boris
Stanimir Stamenkov
2010-07-19 20:16:59 UTC
Permalink
Post by Stanimir Stamenkov
https://developer.mozilla.org/en/DOM_Events#DOMFocusIn
https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference/DOM_Events
Sounds like we need a docs update... File a bug? I'd just remove those,
but I have no idea why they're there to start with, so maybe I'm missing
some documentation policy somewhere.....
Not sure whether I've got the right component, but here it is:

https://bugzilla.mozilla.org/show_bug.cgi?id=580008
--
Stanimir
Loading...