richard pushed to branch tor-browser-115.7.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
e42f5004
by Pier Angelo Vendrame at 2024-02-07T12:18:39+00:00
-
9af28502
by Pier Angelo Vendrame at 2024-02-07T12:18:39+00:00
2 changed files:
Changes:
... | ... | @@ -52,11 +52,7 @@ nsresult NumericInputTypeBase::GetRangeOverflowMessage(nsAString& aMessage) { |
52 | 52 | MOZ_ASSERT(!maximum.isNaN());
|
53 | 53 | |
54 | 54 | nsAutoString maxStr;
|
55 | - char buf[32];
|
|
56 | - DebugOnly<bool> ok = maximum.toString(buf, ArrayLength(buf));
|
|
57 | - maxStr.AssignASCII(buf);
|
|
58 | - MOZ_ASSERT(ok, "buf not big enough");
|
|
59 | - |
|
55 | + ConvertNumberToString(maximum, maxStr);
|
|
60 | 56 | return nsContentUtils::FormatMaybeLocalizedString(
|
61 | 57 | aMessage, nsContentUtils::eDOM_PROPERTIES,
|
62 | 58 | "FormValidationNumberRangeOverflow", mInputElement->OwnerDoc(), maxStr);
|
... | ... | @@ -67,11 +63,7 @@ nsresult NumericInputTypeBase::GetRangeUnderflowMessage(nsAString& aMessage) { |
67 | 63 | MOZ_ASSERT(!minimum.isNaN());
|
68 | 64 | |
69 | 65 | nsAutoString minStr;
|
70 | - char buf[32];
|
|
71 | - DebugOnly<bool> ok = minimum.toString(buf, ArrayLength(buf));
|
|
72 | - minStr.AssignASCII(buf);
|
|
73 | - MOZ_ASSERT(ok, "buf not big enough");
|
|
74 | - |
|
66 | + ConvertNumberToString(minimum, minStr);
|
|
75 | 67 | return nsContentUtils::FormatMaybeLocalizedString(
|
76 | 68 | aMessage, nsContentUtils::eDOM_PROPERTIES,
|
77 | 69 | "FormValidationNumberRangeUnderflow", mInputElement->OwnerDoc(), minStr);
|
... | ... | @@ -47,8 +47,13 @@ void ICUUtils::LanguageTagIterForContent::GetNext(nsACString& aBCP47LangTag) { |
47 | 47 | |
48 | 48 | if (mCurrentFallbackIndex < 2) {
|
49 | 49 | mCurrentFallbackIndex = 2;
|
50 | - // Else take the app's locale:
|
|
51 | - |
|
50 | + // Else take the app's locale (or en-US, if spoof English applies):
|
|
51 | + const bool spoofLocale = nsContentUtils::SpoofLocaleEnglish() &&
|
|
52 | + !mContent->OwnerDoc()->AllowsL10n();
|
|
53 | + if (spoofLocale) {
|
|
54 | + aBCP47LangTag.AssignLiteral("en-US");
|
|
55 | + return;
|
|
56 | + }
|
|
52 | 57 | nsAutoCString appLocale;
|
53 | 58 | LocaleService::GetInstance()->GetAppLocaleAsBCP47(aBCP47LangTag);
|
54 | 59 | return;
|