Bug 1352694 - Flush style on the tab when audio playback is started to restart the transitions. r?gijs
MozReview-Commit-ID: 62b6hhnC9jg
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -5514,20 +5514,23 @@
let modifiedAttrs = [];
if (tab.hasAttribute("soundplaying-scheduledremoval")) {
tab.removeAttribute("soundplaying-scheduledremoval");
modifiedAttrs.push("soundplaying-scheduledremoval");
}
if (!tab.hasAttribute("soundplaying")) {
tab.setAttribute("soundplaying", true);
+ modifiedAttrs.push("soundplaying");
+ }
+
+ if (modifiedAttrs.length) {
// Flush style so that the opacity takes effect immediately, in
// case the media is stopped before the style flushes naturally.
getComputedStyle(tab).opacity;
- modifiedAttrs.push("soundplaying");
}
this._tabAttrModified(tab, modifiedAttrs);
]]>
</handler>
<handler event="DOMAudioPlaybackStopped">
<![CDATA[
var tab = getTabFromAudioEvent(event)