Skip to content

getTime issue #11634

Closed
Closed
@thisboyiscrazy

Description

@thisboyiscrazy

Version

2.6.12

Reproduction link

https://jsfiddle.net/chrisvfritz/50wL7mdz/

Steps to reproduce

Run in on a browser without hi-res timers.

Minimal reproduction does not work because I can not test on my browser or at least I do not know how to turn off Hi Res timers in chrome.

What is expected?

Events to propogate. e.g. an outter div will fire v-on:click for child elements.

What is actually happening?

It's not


in file vue.runtime.esm.js:

change lines 4259 to 4281 to fix:

// Async edge case fix requires storing an event listener's attach timestamp.
var getNow = Date.now;
var baseNow = Date.now();

// Determine what event timestamp the browser is using. Annoyingly, the
// timestamp can either be hi-res (relative to page load) or low-res
// (relative to UNIX epoch), so in order to compare time we have to use the
// same timestamp type when saving the flush timestamp.
// All IE versions use low-res event timestamps, and have problematic clock
// implementations (#9632)
if (inBrowser && !isIE) {
var performance = window.performance;
if (
performance &&
typeof performance.now === 'function' &&
getNow() > document.createEvent('Event').timeStamp
) {
// if the event timestamp, although evaluated AFTER the Date.now(), is
// smaller than it, it means the event is using a hi-res timestamp,
// and we need to use the hi-res version for event listener timestamps as
// well.
getNow = function () { return performance.now(); };
} else {
getNow = function () { return Date.now() - baseNow; };
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions