Bug 1181965. Remove uses of mozRequestAnimationFrame from dom and parser tests. r=bkelly

This commit is contained in:
Boris Zbarsky 2015-07-14 15:28:57 -04:00
Родитель 76bfe95e04
Коммит f9793d505e
11 изменённых файлов: 37 добавлений и 37 удалений

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE html>
<script>
window.mozRequestAnimationFrame(null);
window.requestAnimationFrame(null);
</script>

Просмотреть файл

@ -1,5 +1,5 @@
<!DOCTYPE html>
<script>
mozCancelRequestAnimationFrame(mozRequestAnimationFrame(function() {}));
mozRequestAnimationFrame(function() {});
cancelRequestAnimationFrame(requestAnimationFrame(function() {}));
requestAnimationFrame(function() {});
</script>

Просмотреть файл

@ -1761,10 +1761,10 @@ private:
void EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
bool aUpdateCSSLoader);
// Revoke any pending notifications due to mozRequestAnimationFrame calls
// Revoke any pending notifications due to requestAnimationFrame calls
void RevokeAnimationFrameNotifications();
// Reschedule any notifications we need to handle
// mozRequestAnimationFrame, if it's OK to do so.
// requestAnimationFrame, if it's OK to do so.
void MaybeRescheduleAnimationFrameNotifications();
// These are not implemented and not supported.

Просмотреть файл

@ -22,7 +22,7 @@ SimpleTest.waitForExplicitFinish();
var counter = 3;
var called = false;
var handle1 = window.mozRequestAnimationFrame(function() {
var handle1 = window.requestAnimationFrame(function() {
called = true;
});
ok(handle1 > 0, "Should get back a nonzero handle");
@ -33,11 +33,11 @@ function checker() {
is(called, false, "Canceled callback should not have been called");
SimpleTest.finish();
} else {
window.mozRequestAnimationFrame(checker);
window.requestAnimationFrame(checker);
}
}
window.mozRequestAnimationFrame(checker);
window.mozCancelAnimationFrame(handle1);
window.requestAnimationFrame(checker);
window.cancelAnimationFrame(handle1);
</script>
</pre>

Просмотреть файл

@ -27,7 +27,7 @@ function f() {
}
}
window.mozRequestAnimationFrame(f);
window.requestAnimationFrame(f);
var xhr = new XMLHttpRequest();
xhr.open("GET", "file_bug675121.sjs", false);
xhrInProgress = true;

Просмотреть файл

@ -12,34 +12,34 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=
/** Test for Bug **/
SimpleTest.waitForExplicitFinish();
var unprefixedRan = false;
var prefixedRan = false;
function unprefixed(time) {
is(prefixedRan, true, "We were called second");
unprefixedRan = true;
var firstRan = false;
var secondRan = false;
function second(time) {
is(firstRan, true, "We were called second");
secondRan = true;
ok(Math.abs(time - performance.now()) < 3600000,
"An hour really shouldn't have passed here");
ok(Math.abs(time - Date.now()) > 3600000,
"More than an hour should have passed since 1970");
}
function prefixed(time) {
is(unprefixedRan, false, "Prefixed was called first");
prefixedRan = true;
ok(Math.abs(time - Date.now()) < 3600000,
"Our time should be comparable to Date.now()");
ok(Math.abs(time - performance.now()) > 3600000,
"Our time should not be comparable to performance.now()");
function first(time) {
is(secondRan, false, "second() was called first");
firstRan = true;
ok(Math.abs(time - performance.now()) < 3600000,
"An hour really shouldn't have passed here either");
ok(Math.abs(time - Date.now()) > 3600000,
"More than an hour should have passed since 1970 here either");
}
function prefixed2() {
ok(prefixedRan, "We should be after the other prefixed call");
ok(unprefixedRan, "We should be after the unprefixed call");
function third() {
ok(firstRan, "We should be after the first call");
ok(secondRan, "We should be after the second call");
SimpleTest.finish();
}
window.onload = function() {
window.mozRequestAnimationFrame(prefixed);
window.requestAnimationFrame(unprefixed);
window.mozRequestAnimationFrame(prefixed2);
window.requestAnimationFrame(first);
window.requestAnimationFrame(second);
window.requestAnimationFrame(third);
}
</script>

Просмотреть файл

@ -622,7 +622,7 @@ const KineticPanning = {
v.y * Math.exp(-t / c) * -c + a.y * t * t + v.y * c);
}
let startTime = content.mozAnimationStartTime;
let startTime = content.performance.now();
let elapsedTime = 0, targetedTime = 0, averageTime = 0;
let velocity = this._velocity;
@ -667,9 +667,9 @@ const KineticPanning = {
return;
}
content.mozRequestAnimationFrame(callback);
content.requestAnimationFrame(callback);
}).bind(this);
content.mozRequestAnimationFrame(callback);
content.requestAnimationFrame(callback);
}
};

Просмотреть файл

@ -62,7 +62,7 @@ function initGL(canvas) {
}
function rAF(func) {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame;
var raf = window.requestAnimationFrame;
raf(func);
}

Просмотреть файл

@ -55,10 +55,10 @@ function runTest() {
scrollDown15PxWithPixelScrolling(scrollbox);
// wait for the next refresh driver run
win.mozRequestAnimationFrame(function() {
win.requestAnimationFrame(function() {
// actually, wait for the next one before checking results, since
// scrolling might not be flushed until after this code has run
win.mozRequestAnimationFrame(function() {
win.requestAnimationFrame(function() {
is(scrollbox.scrollTop, scrollTopBefore + 15,
"Pixel scrolling should have finished after one refresh driver iteration. " +
"We shouldn't be scrolling smoothly, even though the pref is set.");

Просмотреть файл

@ -35,7 +35,7 @@ function start() {
canvas = document.getElementById("two");
paintCanvas();
mozRequestAnimationFrame(moveSomething);
requestAnimationFrame(moveSomething);
}
function paintCanvas() {
@ -52,7 +52,7 @@ function moveSomething() {
return finish();
}
mozRequestAnimationFrame(moveSomething);
requestAnimationFrame(moveSomething);
}
function finish() {

Просмотреть файл

@ -1082,7 +1082,7 @@
<p>Euro sign: €</p>
<script>
window.onload = function() {
window.mozRequestAnimationFrame(function() {
window.requestAnimationFrame(function() {
parent.document.documentElement.removeAttribute("class");
});
}