|
|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
import { isDef, isUndef } from 'shared/util'
|
|
|
import { updateListeners } from 'core/vdom/helpers/index'
|
|
|
-import { isIE, supportsPassive, isUsingMicroTask } from 'core/util/index'
|
|
|
+import { isIE, isFF, supportsPassive, isUsingMicroTask } from 'core/util/index'
|
|
|
import { RANGE_TOKEN, CHECKBOX_RADIO_TOKEN } from 'web/compiler/directives/model'
|
|
|
import { currentFlushTimestamp } from 'core/observer/scheduler'
|
|
|
|
|
|
@@ -39,6 +39,11 @@ function createOnceHandler (event, handler, capture) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
|
|
|
+// implementation and does not fire microtasks in between event propagation, so
|
|
|
+// safe to exclude.
|
|
|
+const useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53)
|
|
|
+
|
|
|
function add (
|
|
|
name: string,
|
|
|
handler: Function,
|
|
|
@@ -51,7 +56,7 @@ function add (
|
|
|
// the solution is simple: we save the timestamp when a handler is attached,
|
|
|
// and the handler would only fire if the event passed to it was fired
|
|
|
// AFTER it was attached.
|
|
|
- if (isUsingMicroTask) {
|
|
|
+ if (useMicrotaskFix) {
|
|
|
const attachedTimestamp = currentFlushTimestamp
|
|
|
const original = handler
|
|
|
handler = original._wrapper = function (e) {
|