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

Bryan Forbes bryan at reigndropsfall.net
Thu Jun 21 11:46:33 EDT 2012


Bill Keese wrote:
> I'd say you can just check in that fix, it's trivial.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
Url : http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20120621/926f13c3/attachment.sig 


More information about the dojo-contributors mailing list