Bug 1379030 - Only set calculated size to controlbar for audio element since audio-only video has already had given size from layout. r=jaws draft
authorRay Lin <ralin@mozilla.com>
Mon, 10 Jul 2017 11:25:01 +0800
changeset 605922 3c4556c7d027bdaf12282964feeb7700145b9761
parent 605863 a418121d46250f91728b86d9eea331029c264c30
child 636628 6159f8a8fda7da626f7c604c6258038327e8dfe4
push id67553
push userbmo:ralin@mozilla.com
push dateMon, 10 Jul 2017 03:30:38 +0000
reviewersjaws
bugs1379030
milestone56.0a1
Bug 1379030 - Only set calculated size to controlbar for audio element since audio-only video has already had given size from layout. r=jaws MozReview-Commit-ID: 5H5U18DMVxO
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -1673,17 +1673,17 @@
 
         // Use flexible spacer to separate controls when scrubber is hidden.
         // As long as muteButton hidden, which means only play button presents,
         // hide spacer and make playButton centered.
         this.controlBarSpacer.hidden = !this.scrubberStack.hidden || this.muteButton.hidden;
 
         // Since the size of videocontrols is expanded with controlBar in <audio>, we
         // should fix the dimensions in order not to recursively trigger reflow afterwards.
-        if (this.isAudioOnly) {
+        if (this.video instanceof HTMLAudioElement) {
           if (givenHeight) {
             this.controlBar.style.height = `${Math.max(givenHeight, this.controlBarMinVisibleHeight)}px`;
           }
           this.controlBar.style.width = `${videoWidth - minControlBarPaddingWidth}px`;
           return;
         }
 
         if (videoHeight < this.controlBarMinHeight ||