madrobby/zepto — pull request #597 by elgerlambert (2012-09-25 20:56:31+00:00)
Title: Fix namespaced blur & focus delegate bug

Related issue: #552

Fixed a bug that prevented namespaced focus and blur events, attached through delegate(), from being triggered.

Besides the bug fix, this commit also cleans up some dead code - `if($.iswebkit)` will never evaluate to `true`.

On a side note, this fix brings Zepto a step closer to being a drop-in-replacement for jQuery in combination with Backbone. Backbone namespaces its events and uses `delegate()` for performance reasons. Most/a lot/some people will have binds to `blur` and `focus` as opposed to `focusin` and `focusout`.

**Another bug**
When writing tests for this fix I came across a different, but related bug (already present in Zepto). Calling `undelegate()` won't have any effect on `focus` and `blur` events attached through delegate() - or in other words events that have been attached using `capture` equals `true` ( `addEventListener(handler.e, proxyfn, capture)`) since events are always removed with `capture` equals `false` (`removeEventListener(handler.e, handler.proxy, false)`). I'll try to create a (seperate?) PR to fix this this week - but might not have the time - in which case I'll get it done start of next week.