зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to inbound. a=merge
--HG-- extra : rebase_source : 64a13c827cc6189327fcf3fd99cf8ee9504d9182
This commit is contained in:
Коммит
922fdc6852
|
@ -650,11 +650,6 @@ nsChromeRegistry::MustLoadURLRemotely(nsIURI *aURI, bool *aResult)
|
|||
bool
|
||||
nsChromeRegistry::GetDirectionForLocale(const nsACString& aLocale)
|
||||
{
|
||||
#ifdef ENABLE_INTL_API
|
||||
nsAutoCString locale(aLocale);
|
||||
SanitizeForBCP47(locale);
|
||||
return uloc_isRightToLeft(locale.get());
|
||||
#else
|
||||
// first check the intl.uidirection.<locale> preference, and if that is not
|
||||
// set, check the same preference but with just the first two characters of
|
||||
// the locale. If that isn't set, default to left-to-right.
|
||||
|
@ -675,7 +670,6 @@ nsChromeRegistry::GetDirectionForLocale(const nsACString& aLocale)
|
|||
}
|
||||
|
||||
return dir.EqualsLiteral("rtl");
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
|
|
|
@ -2045,14 +2045,12 @@ pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false)
|
|||
// ideographic space will be ignored (i.e., commits with empty string).
|
||||
pref("intl.ime.remove_placeholder_character_at_commit", false);
|
||||
|
||||
#ifndef ENABLE_INTL_API
|
||||
// these locales have right-to-left UI
|
||||
pref("intl.uidirection.ar", "rtl");
|
||||
pref("intl.uidirection.he", "rtl");
|
||||
pref("intl.uidirection.fa", "rtl");
|
||||
pref("intl.uidirection.ug", "rtl");
|
||||
pref("intl.uidirection.ur", "rtl");
|
||||
#endif
|
||||
|
||||
// use en-US hyphenation by default for content tagged with plain lang="en"
|
||||
pref("intl.hyphenation-alias.en", "en-us");
|
||||
|
|
|
@ -39,7 +39,7 @@ add_task(function* test_i18n_css() {
|
|||
},
|
||||
|
||||
manifest: {
|
||||
"web_accessible_resources": ["foo.css", "foo.txt"],
|
||||
"web_accessible_resources": ["foo.css", "foo.txt", "locale.css"],
|
||||
|
||||
"content_scripts": [{
|
||||
"matches": ["http://mochi.test/*/file_sample.html"],
|
||||
|
@ -60,6 +60,7 @@ add_task(function* test_i18n_css() {
|
|||
"foo.css": "body { __MSG_foo__; }",
|
||||
"bar.CsS": "body { __MSG_foo__; }",
|
||||
"foo.txt": "body { __MSG_foo__; }",
|
||||
"locale.css": '* { content: "__MSG_@@ui_locale__ __MSG_@@bidi_dir__ __MSG_@@bidi_reversed_dir__ __MSG_@@bidi_start_edge__ __MSG_@@bidi_end_edge__" }',
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -87,6 +88,25 @@ add_task(function* test_i18n_css() {
|
|||
is(style.maxWidth, "42px", "stylesheet correctly applied");
|
||||
win.close();
|
||||
|
||||
cssURL = cssURL.replace(/foo.css$/, "locale.css");
|
||||
|
||||
css = yield fetch(cssURL);
|
||||
is(css, '* { content: "en_US ltr rtl left right" }', "CSS file localized in mochitest scope");
|
||||
|
||||
const LOCALE = "general.useragent.locale";
|
||||
const DIR = "intl.uidirection.en";
|
||||
|
||||
// We don't wind up actually switching the chrome registry locale, since we
|
||||
// don't have a chrome package for Hebrew. So just override it.
|
||||
SpecialPowers.setCharPref(LOCALE, "he");
|
||||
SpecialPowers.setCharPref(DIR, "rtl");
|
||||
|
||||
css = yield fetch(cssURL);
|
||||
is(css, '* { content: "he rtl ltr right left" }', "CSS file localized in mochitest scope");
|
||||
|
||||
SpecialPowers.clearUserPref(LOCALE);
|
||||
SpecialPowers.clearUserPref(DIR);
|
||||
|
||||
yield extension.awaitFinish("i18n-css");
|
||||
yield extension.unload();
|
||||
});
|
||||
|
|
|
@ -79,7 +79,6 @@ skip-if = os == 'linux' # Bug 1264604
|
|||
[test_bug418874.xul]
|
||||
[test_bug429723.xul]
|
||||
[test_bug437844.xul]
|
||||
disabled = # bug 1312049 prevents this test working in its current form
|
||||
[test_bug457632.xul]
|
||||
[test_bug460942.xul]
|
||||
[test_bug471776.xul]
|
||||
|
@ -163,7 +162,6 @@ support-files = window_preferences_onsyncfrompreference.xul
|
|||
[test_radio.xul]
|
||||
[test_richlist_direction.xul]
|
||||
[test_righttoleft.xul]
|
||||
disabled = # bug 1312049 prevents this test working in its current form
|
||||
[test_scale.xul]
|
||||
[test_scaledrag.xul]
|
||||
skip-if = buildapp == 'mulet'
|
||||
|
|
Загрузка…
Ссылка в новой задаче