Bug 1577243 - Backed out changeset cae99e27ccdd, restoring document.timeline and rAF timestamp comparisons r=birtles

Depends on D43788

Differential Revision: https://phabricator.services.mozilla.com/D43789

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Ritter 2019-08-28 23:44:14 +00:00
Родитель 7f0055c7a2
Коммит 821203b7b6
2 изменённых файлов: 2 добавлений и 10 удалений

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

@ -10,10 +10,6 @@
<script>
'use strict';
function matchUnconditionalClamping(timestamp) {
return parseFloat((Math.floor(timestamp / .02) * .02).toPrecision(8), 10);
}
test(function() {
assert_equals(document.timeline, document.timeline,
'document.timeline returns the same object every time');
@ -47,7 +43,7 @@ async_test(function(t) {
// window.performance.now() because currentTime is only updated on a sample
// so we use requestAnimationFrame instead.
window.requestAnimationFrame(t.step_func(function(rafTime) {
assert_equals(document.timeline.currentTime, matchUnconditionalClamping(rafTime),
assert_equals(document.timeline.currentTime, rafTime,
'document.timeline.currentTime matches' +
' requestAnimationFrame time');
t.done();

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

@ -9,10 +9,6 @@
<script>
'use strict';
function matchUnconditionalClamping(timestamp) {
return parseFloat((Math.floor(timestamp / .02) * .02).toPrecision(8), 10);
}
async_test(t => {
assert_greater_than_equal(document.timeline.currentTime, 0,
'The current time is initially is positive or zero');
@ -32,7 +28,7 @@ async_test(t => {
// so we use requestAnimationFrame instead.
window.requestAnimationFrame(rafTime => {
t.step(() => {
assert_equals(document.timeline.currentTime, matchUnconditionalClamping(rafTime),
assert_equals(document.timeline.currentTime, rafTime,
'The current time matches requestAnimationFrame time');
});
t.done();