Bug 1496851 part 1: Enable videocontrols to use Fluent. r=fluent-reviewers,Gijs
authorJames Teh <jteh@mozilla.com>
Wed, 19 Aug 2020 21:56:17 +0000
changeset 545399 0aa1e618b7a397b45f1bea5c30ad410f367d8072
parent 545398 16d99d92c1203075f921a68c08557931b5863f2a
child 545400 c109733bb0890051a635794a923ba414edeb9aa4
push id37713
push userabutkovits@mozilla.com
push dateThu, 20 Aug 2020 09:32:09 +0000
treeherdermozilla-central@8cb700c12bd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfluent-reviewers, Gijs
bugs1496851
milestone81.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 1496851 part 1: Enable videocontrols to use Fluent. r=fluent-reviewers,Gijs Differential Revision: https://phabricator.services.mozilla.com/D87399
toolkit/content/widgets/videocontrols.js
toolkit/locales/en-US/toolkit/global/videocontrols.ftl
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -2769,32 +2769,38 @@ this.VideoControlsImplWidget = class {
             <div id="textTrackListContainer" class="textTrackListContainer" hidden="true">
               <div id="textTrackList" class="textTrackList" offlabel="&closedCaption.off;"></div>
             </div>
           </div>
         </div>
       </div>`,
       "application/xml"
     );
+    this.l10n = new this.window.DOMLocalization([
+      "toolkit/global/videocontrols.ftl",
+    ]);
+    this.l10n.connectRoot(this.shadowRoot);
     this.shadowRoot.importNodeAndAppendChildAt(
       this.shadowRoot,
       parserDoc.documentElement,
       true
     );
   }
 
   elementStateMatches(element) {
     let elementInPiP = VideoControlsWidget.isPictureInPictureVideo(element);
     return this.isShowingPictureInPictureMessage == elementInPiP;
   }
 
   destructor() {
     this.Utils.terminate();
     this.TouchUtils.terminate();
     this.Utils.updateOrientationState(false);
+    this.l10n.disconnectRoot(this.shadowRoot);
+    this.l10n = null;
   }
 
   onPrefChange(prefName, prefValue) {
     this.prefs[prefName] = prefValue;
     this.Utils.updatePictureInPictureToggleDisplay();
   }
 
   _setupEventListeners() {
new file mode 100644
--- /dev/null
+++ b/toolkit/locales/en-US/toolkit/global/videocontrols.ftl
@@ -0,0 +1,3 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.