зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1532205 - Intermittent TEST-UNEXPECTED-TIMEOUT in Event-dispatch-on-disabled-elements.html r=birtles
try to extend the animation time. I tested this locally on repeat 50 times. Differential Revision: https://phabricator.services.mozilla.com/D23498 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
26bd1e060c
Коммит
a37ef3224e
|
@ -164,19 +164,30 @@ promise_test(async () => {
|
||||||
const elem = document.createElement(localName);
|
const elem = document.createElement(localName);
|
||||||
document.body.appendChild(elem);
|
document.body.appendChild(elem);
|
||||||
elem.disabled = true;
|
elem.disabled = true;
|
||||||
const eventPromises = [
|
const animationStartPromise = new Promise(r => {
|
||||||
"animationstart",
|
elem.addEventListener("animationstart", () => {
|
||||||
"animationiteration",
|
// Seek to the second iteration to trigger the animationiteration event
|
||||||
"animationend",
|
elem.style.animationDelay = "-100s"
|
||||||
].map(eventType => {
|
r();
|
||||||
return new Promise(r => {
|
|
||||||
elem.addEventListener(eventType, r, { once: true });
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
elem.style.animation = "fade .1s 2";
|
const animationIterationPromise = new Promise(r => {
|
||||||
|
elem.addEventListener("animationiteration", ()=>{
|
||||||
|
elem.style.animationDelay = "-200s"
|
||||||
|
r();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const animationEndPromise = new Promise(r => {
|
||||||
|
elem.addEventListener("animationend", r);
|
||||||
|
});
|
||||||
|
elem.style.animation = "fade 100s 2";
|
||||||
elem.classList.add("animate");
|
elem.classList.add("animate");
|
||||||
// All the events fire...
|
// All the events fire...
|
||||||
await Promise.all(eventPromises);
|
await Promise.all([
|
||||||
|
animationStartPromise,
|
||||||
|
animationIterationPromise,
|
||||||
|
animationEndPromise,
|
||||||
|
]);
|
||||||
elem.remove();
|
elem.remove();
|
||||||
}
|
}
|
||||||
}, "CSS Animation animationstart, animationiteration, animationend fire on disabled form elements");
|
}, "CSS Animation animationstart, animationiteration, animationend fire on disabled form elements");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче