Backed out changeset e46cfa3b45ff (bug 1347798) because it will fail browser-chrome's browser_all_files_referenced.js. r=backout

This commit is contained in:
Sebastian Hengst 2017-09-21 22:28:55 +02:00
Родитель f7dd6d2d6d
Коммит 6bba3e6d42
5 изменённых файлов: 0 добавлений и 76 удалений

Просмотреть файл

@ -37,10 +37,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
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",
@ -632,14 +630,6 @@ BrowserGlue.prototype = {
});
}
// 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");
},

Просмотреть файл

@ -57,17 +57,6 @@ class CachedIterable {
}
};
}
/**
* 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());
}
}
}
/**

Просмотреть файл

@ -1,2 +0,0 @@
toolkit.jar:
content/global/l10n.js

Просмотреть файл

@ -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();
});
}

Просмотреть файл

@ -15,6 +15,4 @@ XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
JAR_MANIFESTS += ['jar.mn']
FINAL_LIBRARY = 'xul'