Backed out changeset e46cfa3b45ff (bug 1347798) because it will fail browser-chrome's browser_all_files_referenced.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 21 Sep 2017 22:28:55 +0200
changeset 382246 45a8457d012e1a51531981e88adae9b1cdc7cba1
parent 382245 3fadde636965fed90676c91088a9d81e2d38a078
child 382247 587c58121d4502556ff25d674820bd523ab313f8
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 oute46cfa3b45ff01b1144199e31a1bd31fe5bffc3c
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 e46cfa3b45ff (bug 1347798) because it will fail browser-chrome's browser_all_files_referenced.js. r=backout
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'