tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 574d358f3cbc2352c09260cdb53d973000fcc0d4
parent c51780e72b37a486284885e59cd7b2741978a483
Author: Eemeli Aro <eemeli@mozilla.com>
Date:   Fri, 19 Dec 2025 17:23:12 +0000

Bug 2006843 - Remove window.getRegionalPrefsLocales() as unused r=webidl,frontend-codestyle-reviewers,platform-i18n-reviewers,dminor

Differential Revision: https://phabricator.services.mozilla.com/D276971

Diffstat:
M.prettierignore | 1-
Mdom/base/nsGlobalWindowInner.cpp | 13-------------
Mdom/base/nsGlobalWindowInner.h | 2--
Mdom/tests/mochitest/chrome/chrome.toml | 2--
Ddom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html | 28----------------------------
Mdom/webidl/Window.webidl | 18------------------
6 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/.prettierignore b/.prettierignore @@ -689,7 +689,6 @@ dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html dom/tests/mochitest/chrome/test_nodesFromRect.html dom/tests/mochitest/chrome/test_queryCaretRect.html dom/tests/mochitest/chrome/test_selectAtPoint.html -dom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html dom/tests/mochitest/chrome/window_focus.xhtml dom/tests/mochitest/general/file_clonewrapper.html dom/tests/mochitest/general/file_focusrings.html diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp @@ -7517,19 +7517,6 @@ Worklet* nsGlobalWindowInner::GetPaintWorklet(ErrorResult& aRv) { return mPaintWorklet; } -void nsGlobalWindowInner::GetRegionalPrefsLocales( - nsTArray<nsString>& aLocales) { - MOZ_ASSERT(mozilla::intl::LocaleService::GetInstance()); - - AutoTArray<nsCString, 10> rpLocales; - mozilla::intl::LocaleService::GetInstance()->GetRegionalPrefsLocales( - rpLocales); - - for (const auto& loc : rpLocales) { - aLocales.AppendElement(NS_ConvertUTF8toUTF16(loc)); - } -} - void nsGlobalWindowInner::GetWebExposedLocales(nsTArray<nsString>& aLocales) { MOZ_ASSERT(mozilla::intl::LocaleService::GetInstance()); diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h @@ -683,8 +683,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, mozilla::dom::Worklet* GetPaintWorklet(mozilla::ErrorResult& aRv); - void GetRegionalPrefsLocales(nsTArray<nsString>& aLocales); - void GetWebExposedLocales(nsTArray<nsString>& aLocales); mozilla::dom::IntlUtils* GetIntlUtils(mozilla::ErrorResult& aRv); diff --git a/dom/tests/mochitest/chrome/chrome.toml b/dom/tests/mochitest/chrome/chrome.toml @@ -136,6 +136,4 @@ tags = "fullscreen" ["test_subscript_bindings.xhtml"] -["test_window_getRegionalPrefsLocales.html"] - ["test_xray_event_constructor.xhtml"] diff --git a/dom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html b/dom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html @@ -1,28 +0,0 @@ -<!DOCTYPE HTML> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=1337234 ---> -<head> - <title>Test for Bug 1337234</title> - <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1337234">Mozilla Bug 1337234</a> -<p id="display"></p> -<div id="content" style="display: none"> -<script> - -const localeService = - Cc["@mozilla.org/intl/localeservice;1"].getService(Ci.mozILocaleService); - -let rpLocales = localeService.negotiateLanguages(window.getRegionalPrefsLocales(), - localeService.availableLocales); - -ok(rpLocales.length, "getRegionalPrefsLocales returns at least one locale."); -is(rpLocales[0], "en-US", "The first regional prefs locale should resolve to en-US."); - -</script> -</body> -</html> diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl @@ -845,24 +845,6 @@ callback IdleRequestCallback = undefined (IdleDeadline deadline); partial interface Window { /** - * Returns a list of locales that the internationalization components - * should be localized to. - * - * The function name refers to Regional Preferences which can be either - * fetched from the internal internationalization database (CLDR), or - * from the host environment. - * - * The result is a sorted list of valid locale IDs and it should be - * used for all APIs that accept list of locales, like ECMA402 and L10n APIs. - * - * This API always returns at least one locale. - * - * Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"] - */ - [Func="IsChromeOrUAWidget"] - sequence<DOMString> getRegionalPrefsLocales(); - - /** * Returns a list of locales that the web content would know from the user. * * One of the fingerprinting technique is to recognize users from their locales