Bug 1531101 - Update videocontrols error IDs to make it cleaner to introduce new message types. r=jaws
☠☠ backed out by b9b0378c5e0b ☠ ☠
authorMike Conley <mconley@mozilla.com>
Fri, 08 Mar 2019 15:47:17 +0000
changeset 521445 4a4b44c3481a20676eaf16deabb8e32f18bc8bcf
parent 521444 12bcda2d76db12ba1a1f05b48d6f71484561c600
child 521446 44d96bcc51f75d7a1a8c44d60dd7dc2131348c56
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1531101
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531101 - Update videocontrols error IDs to make it cleaner to introduce new message types. r=jaws Differential Revision: https://phabricator.services.mozilla.com/D22163
toolkit/content/widgets/videocontrols.js
toolkit/themes/shared/media/videocontrols.css
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -512,17 +512,17 @@ this.VideoControlsImplWidget = class {
             break;
           case "loadeddata":
             this.firstFrameShown = true;
             this.setupStatusFader();
             break;
           case "loadstart":
             this.maxCurrentTimeSeen = 0;
             this.controlsSpacer.removeAttribute("aria-label");
-            this.statusOverlay.removeAttribute("error");
+            this.statusOverlay.removeAttribute("status");
             this.statusIcon.setAttribute("type", "throbber");
             this.isAudioOnly = this.video.localName == "audio";
             this.setPlayButtonState(true);
             this.setupNewLoadState();
             this.setupStatusFader();
             break;
           case "progress":
             this.statusIcon.removeAttribute("stalled");
@@ -769,42 +769,42 @@ this.VideoControlsImplWidget = class {
         let error;
         let v = this.video;
         // It is possible to have both v.networkState == NETWORK_NO_SOURCE
         // as well as v.error being non-null. In this case, we will show
         // the v.error.code instead of the v.networkState error.
         if (v.error) {
           switch (v.error.code) {
             case v.error.MEDIA_ERR_ABORTED:
-              error = "errorAborted";
+              error = "statusErrorAborted";
               break;
             case v.error.MEDIA_ERR_NETWORK:
-              error = "errorNetwork";
+              error = "statusErrorNetwork";
               break;
             case v.error.MEDIA_ERR_DECODE:
-              error = "errorDecode";
+              error = "statusErrorDecode";
               break;
             case v.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
               error = v.networkState == v.NETWORK_NO_SOURCE ?
-                "errorNoSource" :
-                "errorSrcNotSupported";
+                "statusErrorNoSource" :
+                "statusErrorSrcNotSupported";
               break;
             default:
-              error = "errorGeneric";
+              error = "statusErrorGeneric";
               break;
           }
         } else if (v.networkState == v.NETWORK_NO_SOURCE) {
-          error = "errorNoSource";
+          error = "statusErrorNoSource";
         } else {
           return; // No error found.
         }
 
         let label = this.shadowRoot.getElementById(error);
         this.controlsSpacer.setAttribute("aria-label", label.textContent);
-        this.statusOverlay.setAttribute("error", error);
+        this.statusOverlay.setAttribute("status", error);
       },
 
       formatTime(aTime, showHours = false) {
         // Format the duration as "h:mm:ss" or "m:ss"
         aTime = Math.round(aTime / 1000);
         let hours = Math.floor(aTime / 3600);
         let mins  = Math.floor((aTime % 3600) / 60);
         let secs  = Math.floor(aTime % 60);
@@ -2201,22 +2201,22 @@ this.VideoControlsImplWidget = class {
       <!ENTITY % videocontrolsDTD SYSTEM "chrome://global/locale/videocontrols.dtd">
       %videocontrolsDTD;
       ]>
       <div class="videocontrols" xmlns="http://www.w3.org/1999/xhtml" role="none">
         <link rel="stylesheet" type="text/css" href="chrome://global/skin/media/videocontrols.css" />
         <div id="controlsContainer" class="controlsContainer" role="none">
           <div id="statusOverlay" class="statusOverlay stackItem" hidden="true">
             <div id="statusIcon" class="statusIcon"></div>
-            <span class="errorLabel" id="errorAborted">&error.aborted;</span>
-            <span class="errorLabel" id="errorNetwork">&error.network;</span>
-            <span class="errorLabel" id="errorDecode">&error.decode;</span>
-            <span class="errorLabel" id="errorSrcNotSupported">&error.srcNotSupported;</span>
-            <span class="errorLabel" id="errorNoSource">&error.noSource2;</span>
-            <span class="errorLabel" id="errorGeneric">&error.generic;</span>
+            <span class="statusLabel" id="statusErrorAborted">&error.aborted;</span>
+            <span class="statusLabel" id="statusErrorNetwork">&error.network;</span>
+            <span class="statusLabel" id="statusErrorDecode">&error.decode;</span>
+            <span class="statusLabel" id="statusErrorSrcNotSupported">&error.srcNotSupported;</span>
+            <span class="statusLabel" id="statusErrorNoSource">&error.noSource2;</span>
+            <span class="statusLabel" id="statusErrorGeneric">&error.generic;</span>
           </div>
 
           <div id="controlsOverlay" class="controlsOverlay stackItem" role="none">
             <div class="controlsSpacerStack">
               <div id="controlsSpacer" class="controlsSpacer stackItem" role="none"></div>
               <div id="clickToPlay" class="clickToPlay" hidden="true"></div>
             </div>
 
--- a/toolkit/themes/shared/media/videocontrols.css
+++ b/toolkit/themes/shared/media/videocontrols.css
@@ -448,35 +448,35 @@
   display: none;
 }
 
 .statusOverlay[fadeout],
 .statusOverlay[error] + .controlsOverlay > .controlsSpacerStack {
   opacity: 0;
 }
 
-/* Error description formatting */
-.errorLabel {
+/* Status description formatting */
+.statusLabel {
   padding: 0 10px;
   text-align: center;
   font: message-box;
   font-size: 14px;
   color: #ffffff;
 }
 
-.errorLabel {
+.statusLabel {
   display: none;
 }
 
-[error="errorAborted"]         > [id="errorAborted"],
-[error="errorNetwork"]         > [id="errorNetwork"],
-[error="errorDecode"]          > [id="errorDecode"],
-[error="errorSrcNotSupported"] > [id="errorSrcNotSupported"],
-[error="errorNoSource"]        > [id="errorNoSource"],
-[error="errorGeneric"]         > [id="errorGeneric"] {
+[status="errorAborted"]         > [id="statusErrorAborted"],
+[status="errorNetwork"]         > [id="statusErrorNetwork"],
+[status="errorDecode"]          > [id="statusErrorDecode"],
+[status="errorSrcNotSupported"] > [id="statusErrorSrcNotSupported"],
+[status="errorNoSource"]        > [id="statusErrorNoSource"],
+[status="errorGeneric"]         > [id="statusErrorGeneric"] {
   display: inline;
 }
 
 %ifdef XP_WIN
 @media (-moz-windows-default-theme: 0) {
   .controlsSpacer,
   .clickToPlay {
     background-color: transparent;