Source code

Revision control

Other Tools

Test Info:

<!doctype html>
<meta charset=utf-8>
<title>Test for bug 1292001</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script src="animation_utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
#target {
height: 100px;
width: 100px;
background: green;
transition: transform 100s linear;
<div id="target"></div>
'use strict';
const OMTAPrefKey = 'layers.offmainthreadcomposition.async-animations';
const omtaEnabled =
SpecialPowers.DOMWindowUtils.layerManagerRemote &&
window.addEventListener('load', async function() {
if (!omtaEnabled) {
ok(true, 'Skipping the test since OMTA is disabled');
const div = document.getElementById('target');
// Start first transition = 'translateX(300px)';
const firstTransition = div.getAnimations()[0];
// But then change its keyframes to something completely different.
firstTransition.effect.setKeyframes({ 'opacity': ['0', '1'] });
// Wait for the transition to start running on the main thread and
// compositor.
await firstTransition.ready;
await waitForPaints();
await new Promise(resolve => requestAnimationFrame(resolve));
// Start second transition = 'translateX(600px)';
const secondTransition = div.getAnimations()[0];
const previousKeyframeValue = secondTransition.effect.getKeyframes()[0]
// Tie up main thread for 300ms. In the meantime, the first transition
// will continue running on the compositor. If we don't update the start
// point of the second transition, it will appear to jump when it starts.
const startTime =;
while ( - startTime < 300);
// Ensure that our paint process has been done.
// (See explanation in test_transitions_replacement_on_busy_frame.html for
// why we don't use requestAnimationFrame here.)
await waitForPaints();
// Now check that the keyframes are NOT updated.
'Keyframe value of transition is NOT updated since the moment when ' +
'it was generated'