Backed out changeset f1ae02c8d697 (bug 1347798) for eslint failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Thu, 21 Sep 2017 12:07:00 -0700
changeset 382238 c065007b752b62c5af0e82176f4c8183cfb0fa56
parent 382237 a69946757ded48de0b47d7b11b6268a636255502
child 382239 e46cfa3b45ff01b1144199e31a1bd31fe5bffc3c
push id32551
push userkwierso@gmail.com
push dateThu, 21 Sep 2017 23:29:53 +0000
treeherdermozilla-central@d6d6fd889f7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1347798
milestone58.0a1
backs outf1ae02c8d697c6ca0c1a24cdadcca304b8a30638
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
Backed out changeset f1ae02c8d697 (bug 1347798) for eslint failures a=backout MozReview-Commit-ID: FfrPYVOjyji
browser/components/nsBrowserGlue.js
intl/l10n/Localization.jsm
intl/l10n/jar.mn
intl/l10n/l10n.js
intl/l10n/moz.build
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -32,20 +32,18 @@ XPCOMUtils.defineLazyModuleGetters(this,
   BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
   ContentClick: "resource:///modules/ContentClick.jsm",
   ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
   DateTimePickerHelper: "resource://gre/modules/DateTimePickerHelper.jsm",
   DirectoryLinksProvider: "resource:///modules/DirectoryLinksProvider.jsm",
   ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
   Feeds: "resource:///modules/Feeds.jsm",
   FileUtils: "resource://gre/modules/FileUtils.jsm",
-  FileSource: "resource://gre/modules/L10nRegistry.jsm",
   FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
   Integration: "resource://gre/modules/Integration.jsm",
-  L10nRegistry: "resource://gre/modules/L10nRegistry.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
   LoginHelper: "resource://gre/modules/LoginHelper.jsm",
   LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
   NetUtil: "resource://gre/modules/NetUtil.jsm",
   NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   PageActions: "resource:///modules/PageActions.jsm",
   PageThumbs: "resource://gre/modules/PageThumbs.jsm",
@@ -627,24 +625,16 @@ BrowserGlue.prototype = {
         headerURL: "resource:///chrome/browser/content/browser/defaultthemes/compact.header.png",
         iconURL: "resource:///chrome/browser/content/browser/defaultthemes/dark.icon.svg",
         textcolor: "white",
         accentcolor: "black",
         author: vendorShortName,
       });
     }
 
-
-    // Initialize the default l10n resource sources for L10nRegistry.
-    const locales = [AppConstants.INSTALL_LOCALE];
-    const toolkitSource = new FileSource('toolkit', locales, 'resource://gre/localization/{locale}/');
-    L10nRegistry.registerSource(toolkitSource);
-    const appSource = new FileSource('app', locales, 'resource://app/localization/{locale}/');
-    L10nRegistry.registerSource(appSource);
-
     Services.obs.notifyObservers(null, "browser-ui-startup-complete");
   },
 
   _checkForOldBuildUpdates() {
     // check for update if our build is old
     if (AppConstants.MOZ_UPDATER &&
         Services.prefs.getBoolPref("app.update.enabled") &&
         Services.prefs.getBoolPref("app.update.checkInstallTime")) {
--- a/intl/l10n/Localization.jsm
+++ b/intl/l10n/Localization.jsm
@@ -52,27 +52,16 @@ class CachedIterable {
       async next() {
         if (seen.length <= cur) {
           seen.push(await iterator.next());
         }
         return seen[cur++];
       }
     };
   }
-
-  /**
-   * This method allows user to consume the next element from the iterator
-   * into the cache.
-   */
-  touchNext() {
-    const { seen, iterator } = this;
-    if (seen.length === 0 || seen[seen.length - 1].done === false) {
-      seen.push(iterator.next());
-    }
-  }
 }
 
 /**
  * Specialized version of an Error used to indicate errors that are result
  * of a problem during the localization process.
  *
  * We use them to identify the class of errors the require a fallback
  * mechanism to be triggered vs errors that should be reported, but
deleted file mode 100644
--- a/intl/l10n/jar.mn
+++ /dev/null
@@ -1,2 +0,0 @@
-toolkit.jar:
-  content/global/l10n.js
deleted file mode 100644
--- a/intl/l10n/l10n.js
+++ /dev/null
@@ -1,51 +0,0 @@
-{
-  const { DOMLocalization } =
-    Components.utils.import("resource://gre/modules/DOMLocalization.jsm");
-
-  /**
-   * Polyfill for document.ready polyfill.
-   * See: https://github.com/whatwg/html/issues/127 for details.
-   *
-   * @returns {Promise}
-   */
-  function documentReady() {
-    const rs = document.readyState;
-    if (rs === 'interactive' || rs === 'completed') {
-      return Promise.resolve();
-    }
-
-    return new Promise(
-      resolve => document.addEventListener(
-        'readystatechange', resolve, { once: true }
-      )
-    );
-  }
-
-  /**
-   * Scans the `elem` for links with localization resources.
-   *
-   * @param {Element} elem
-   * @returns {Array<string>}
-   */
-  function getResourceLinks(elem) {
-    return Array.from(elem.querySelectorAll('link[rel="localization"]')).map(
-      el => el.getAttribute('href')
-    );
-  }
-
-  const resourceIds = getResourceLinks(document.head || document);
-
-  document.l10n = new DOMLocalization(window, resourceIds);
-
-  // trigger first context to be fetched eagerly
-  document.l10n.ctxs.touchNext();
-
-  document.l10n.ready = documentReady().then(() => {
-    document.l10n.registerObservers();
-    window.addEventListener('unload', () => {
-      document.l10n.unregisterObservers();
-    });
-    document.l10n.connectRoot(document.documentElement);
-    return document.l10n.translateRoots();
-  });
-}
--- a/intl/l10n/moz.build
+++ b/intl/l10n/moz.build
@@ -10,11 +10,9 @@ EXTRA_JS_MODULES += [
     'Localization.jsm',
     'MessageContext.jsm',
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
 
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
-JAR_MANIFESTS += ['jar.mn']
-
 FINAL_LIBRARY = 'xul'