fix double redraw when events fire simultaneously
This commit is contained in:
parent
0354a4e251
commit
ccde633e92
5 changed files with 99 additions and 102 deletions
|
|
@ -71,17 +71,11 @@ mock.window = new function() {
|
|||
child.parentNode = null
|
||||
}
|
||||
window.scrollTo = function() {}
|
||||
window.performance = new function () {
|
||||
var timestamp = 50
|
||||
this.$elapse = function(amount) {timestamp += amount}
|
||||
this.now = function() {return timestamp}
|
||||
}
|
||||
window.cancelAnimationFrame = function() {}
|
||||
window.requestAnimationFrame = function(callback) {window.requestAnimationFrame.$callback = callback}
|
||||
window.requestAnimationFrame.$resolve = function() {
|
||||
if (window.requestAnimationFrame.$callback) window.requestAnimationFrame.$callback()
|
||||
window.requestAnimationFrame.$callback = null
|
||||
window.performance.$elapse(20)
|
||||
}
|
||||
window.XMLHttpRequest = new function() {
|
||||
var request = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue