Bug 1478637 - Avoid sync style flushes when cancelling the shield animation in the identity block. r=mconley

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Johann Hofmann 2018-08-16 18:30:53 +00:00
parent 043ffca9de
commit f1bd968c5c

View File

@ -379,11 +379,18 @@ var ContentBlocking = {
},
cancelAnimation() {
let iconAnimation = this.animatedIcon.getAnimations()[0];
if (iconAnimation && iconAnimation.currentTime) {
iconAnimation.cancel();
if (!this.iconBox.hasAttribute("animate")) {
return;
}
this.iconBox.removeAttribute("animate");
window.promiseDocumentFlushed(() => {
return this.animatedIcon.getAnimations()[0];
}).then(iconAnimation => {
if (iconAnimation && iconAnimation.currentTime) {
iconAnimation.cancel();
}
this.iconBox.removeAttribute("animate");
});
},
onSecurityChange(state, webProgress, isSimulated) {