Bug 1531101 - Update videocontrols error IDs to make it cleaner to introduce new message types. r=jaws
authorMike Conley <mconley@mozilla.com>
Wed, 13 Mar 2019 01:43:57 +0000
changeset 521638 7727f73edf0ed7d06747ca4617060bc36adb73d8
parent 521637 54b6941ad622a603f1f79330023a73829b90e062
child 521639 4854148dd5340d31aa4ea700c5d31d099d46d49b
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [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/tests/widgets/test_videocontrols_error.html
toolkit/content/widgets/videocontrols.js
toolkit/themes/shared/media/videocontrols.css
--- a/toolkit/content/tests/widgets/test_videocontrols_error.html
+++ b/toolkit/content/tests/widgets/test_videocontrols_error.html
@@ -32,30 +32,30 @@
       video.addEventListener("loadedmetadata", () => SimpleTest.executeSoon(resolve));
     });
 
     // Wait for the fade out transition to complete in case the throbber
     // shows up on slower platforms.
     await SimpleTest.promiseWaitForCondition(() => statusOverlay.hidden,
       "statusOverlay should not present without error");
 
-    ok(!statusOverlay.hasAttribute("error"), "statusOverlay should not in error state");
+    ok(!statusOverlay.hasAttribute("status"), "statusOverlay should not be showing a state message.");
     isnot(statusIcon.getAttribute("type"), "error", "should not show error icon");
   });
 
   add_task(async function invalid_source() {
     const errorType = "errorNoSource";
 
     await new Promise(resolve => {
       video.src = "invalid_source.ogg";
       video.addEventListener("error", () => SimpleTest.executeSoon(resolve));
     });
 
     ok(!statusOverlay.hidden, `statusOverlay should show when ${errorType}`);
-    is(statusOverlay.getAttribute("error"), errorType, `statusOverlay should have correct error state: ${errorType}`);
+    is(statusOverlay.getAttribute("status"), errorType, `statusOverlay should have correct error state: ${errorType}`);
     is(statusIcon.getAttribute("type"), "error", `should show error icon when ${errorType}`);
     isnot(statusLabelErrorNoSource.getBoundingClientRect().height, 0,
       "errorNoSource status label should be visible.");
   });
 </script>
 </pre>
 </body>
 </html>
--- 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");
@@ -794,17 +794,17 @@ this.VideoControlsImplWidget = class {
         } else if (v.networkState == v.NETWORK_NO_SOURCE) {
           error = "errorNoSource";
         } 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="errorAborted">&error.aborted;</span>
+            <span class="statusLabel" id="errorNetwork">&error.network;</span>
+            <span class="statusLabel" id="errorDecode">&error.decode;</span>
+            <span class="statusLabel" id="errorSrcNotSupported">&error.srcNotSupported;</span>
+            <span class="statusLabel" id="errorNoSource">&error.noSource2;</span>
+            <span class="statusLabel" id="errorGeneric">&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="errorAborted"],
+[status="errorNetwork"]         > [id="errorNetwork"],
+[status="errorDecode"]          > [id="errorDecode"],
+[status="errorSrcNotSupported"] > [id="errorSrcNotSupported"],
+[status="errorNoSource"]        > [id="errorNoSource"],
+[status="errorGeneric"]         > [id="errorGeneric"] {
   display: inline;
 }
 
 %ifdef XP_WIN
 @media (-moz-windows-default-theme: 0) {
   .controlsSpacer,
   .clickToPlay {
     background-color: transparent;