Very good point. I added some additional tests to the delegation suite
and I've come to the same conclusion as you: implementing
focusin/focusout across all browsers gives us much better parity.

I've landed the new code here:
http://github.com/jquery/jquery/commit/03481a52c72e417b01cfeb499f26738cf5ed5839

Thanks for your recommendation - it's really appreciated!

--John



On Mon, Dec 21, 2009 at 5:13 AM, alexander farkas
<a.farkas...@googlemail.com> wrote:
> The bubbling focus and blur events seems to be implemented incorrect
> and in a very strange way.
>
> 1. support.focusBubbles is true in all browsers (only testet in IE8
> and FF3.5), but should be false in all browsers
> 2. If support.focusbubbles would be false, wich never is the case,
> focusin/focusout are bound, wich are only supported by IE.
>
> Following the W3C specification focus/blur are not bubbling events and
> therefore doesn´t need to be fixed / overwritten with a not working /
> not standard compilant implementation. Instead you should provide new
> events, like jQuery already did with mouseenter/mouseleave.
>
> The W3C has its DOMfocusin/DOMfocusout events (only implemented in
> Opera and very verbose) and Microsoft has its own focusin/focusout
> events (already used in a lot of jQuery Plugins, because of Jörns
> implementation (http://view.jquery.com/trunk/plugins/delegate/
> jquery.delegate.js)). In all W3C compilant Browsers you can simply
> emulate bubbling focus/blur, by using event capturing instead of event
> bubbling.
>
> An implementation doesn´t need a support flag. The only check is,
> wether the browser supports event capturing.
>
> //original by jörn zaefferer
> // if event capturing is supported use this, else try the native MS
> events
> if (document.addEventListener) {
>        $.each({
>                focus: 'focusin',
>                blur: 'focusout'
>        }, function(original, fix){
>                $.event.special[fix] = {
>                        setup: function(){
>                                this.addEventListener(original, 
> $.event.special[fix].handler,
> true);
>                        },
>                        teardown: function(){
>                                this.removeEventListener(original, 
> $.event.special[fix].handler,
> true);
>                        },
>                        handler: function(e){
>                                arguments[0] = $.event.fix(e);
>                                arguments[0].type = fix;
>                                return $.event.handle.apply(this, arguments);
>                        }
>                };
>        });
> }
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "jQuery Development" group.
> To post to this group, send email to jquery-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> jquery-dev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/jquery-dev?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to