summaryrefslogtreecommitdiff
path: root/common/modules/dom.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'common/modules/dom.jsm')
-rw-r--r--common/modules/dom.jsm50
1 files changed, 19 insertions, 31 deletions
diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm
index 6831bd3e..42c3902b 100644
--- a/common/modules/dom.jsm
+++ b/common/modules/dom.jsm
@@ -1354,38 +1354,26 @@ var DOM = Class("DOM", {
* @param {Node} target The DOM node to which to dispatch the event.
* @param {Event} event The event to dispatch.
*/
- dispatch: Class.Memoize(function ()
- config.haveGecko("2b")
- ? function dispatch(target, event, extra) {
- try {
- this.feedingEvent = extra;
-
- if (target instanceof Ci.nsIDOMElement)
- // This causes a crash on Gecko<2.0, it seems.
- return (target.ownerDocument || target.document || target).defaultView
- .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
- .dispatchDOMEventViaPresShell(target, event, true);
- else {
- target.dispatchEvent(event);
- return !event.defaultPrevented;
- }
- }
- catch (e) {
- util.reportError(e);
- }
- finally {
- this.feedingEvent = null;
- }
+ dispatch: function dispatch(target, event, extra) {
+ try {
+ this.feedingEvent = extra;
+
+ if (target instanceof Ci.nsIDOMElement)
+ return (target.ownerDocument || target.document || target).defaultView
+ .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
+ .dispatchDOMEventViaPresShell(target, event, true);
+ else {
+ target.dispatchEvent(event);
+ return !event.defaultPrevented;
}
- : function dispatch(target, event, extra) {
- try {
- this.feedingEvent = extra;
- target.dispatchEvent(update(event, extra));
- }
- finally {
- this.feedingEvent = null;
- }
- })
+ }
+ catch (e) {
+ util.reportError(e);
+ }
+ finally {
+ this.feedingEvent = null;
+ }
+ }
}),
createContents: Class.Memoize(() => services.has("dactyl") && services.dactyl.createContents