Bug 1352694 - Flush style on the tab when audio playback is started to restart the transitions. r?gijs draft
authorJared Wein <jwein@mozilla.com>
Tue, 04 Apr 2017 00:06:31 -0400
changeset 555345 d6134b890cd76cf32d25708a5699766709876576
parent 555310 b5d8b27a753725c1de41ffae2e338798f3b5cacd
child 622588 2248862914f763f19854f0da0d00c4c50b0e497e
push id52217
push userbmo:jaws@mozilla.com
push dateTue, 04 Apr 2017 04:06:48 +0000
reviewersgijs
bugs1352694
milestone55.0a1
Bug 1352694 - Flush style on the tab when audio playback is started to restart the transitions. r?gijs MozReview-Commit-ID: 62b6hhnC9jg
browser/base/content/tabbrowser.xml
--- 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)