[dojo-contributors] issue with last stopImmediatePropagation patch (#14728)

Patrick Ruzand pruzand at gmail.com
Thu Jun 21 12:09:41 EDT 2012


Bryan,

Arrg.. I just committed the fix and then noticed your answer after... :-/
Since it seems you have a better solution, I let you (or maybe kzyp,
ticket owner) handle it, ok ?

Thanks
Patrick

> This patch needs some revision. First, we shouldn't be using `window` in
> the first place:
>
> has.add("event-stopimmediatepropogation", window.Event &&
> !!window.Event.prototype.stopImmediatePropagation);
>
> should be
>
> has.add("event-stopimmediatepropogation", typeof Event === "function" &&
> !!Event.prototype.stopImmediatePropagation);
>
>
> Second, we shouldn't be using an inference. We should be testing actual
> event objects:
>
> has.add("event-stopimmediatepropogation", function(global, document){
>        var e;
>        if(document.createEvent){
>                e = document.createEvent("HTMLEvents");
>        }else if(document.createEventObject){
>                e = document.createEventObject();
>        }
>        return e && !!e.stopImmediatePropagation;
> });
>
> This approach avoids the case where libraries create objects that they
> shouldn't be creating.
>
> Third, the name of the original has test is typo'ed: "propogation"
> should be "propagation".
>
>> On Thu, Jun 21, 2012 at 11:14 PM, Patrick Ruzand <pruzand at gmail.com> wrote:
>>> Hello,
>>>
>>> just to let you know that I have marked the #14728  as blocker for
>>> 1.8. The reason is since this patch, the dojox/geo/openlayer module
>>> doesn't work anymore with IE7/8 (see comment 5 in ticket for details).
>>>
>>> If someone could take a look (fix seems very simple btw)
>>>
>>> thanks
>>> --
>>> Patrick
>>> _______________________________________________
>>> dojo-contributors mailing list
>>> dojo-contributors at mail.dojotoolkit.org
>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>> _______________________________________________
>> dojo-contributors mailing list
>> dojo-contributors at mail.dojotoolkit.org
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>
> --
> Bryan Forbes
> http://www.reigndropsfall.net
>
> GPG Fingerprint
> 3D7D B728 713A BB7B B8B1  5B61 3888 17E0 70CA 0F3D
>
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>



-- 
--
Patrick


More information about the dojo-contributors mailing list