Pier Angelo Vendrame pushed to branch base-browser-115.7.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
-
248a7e5f
by Pier Angelo Vendrame at 2024-01-18T14:21:21+01: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);
|
| ... | ... | @@ -49,6 +49,13 @@ void ICUUtils::LanguageTagIterForContent::GetNext(nsACString& aBCP47LangTag) { |
| 49 | 49 | mCurrentFallbackIndex = 2;
|
| 50 | 50 | // Else take the app's locale:
|
| 51 | 51 | |
| 52 | + const bool spoofLocale = nsContentUtils::SpoofLocaleEnglish() &&
|
|
| 53 | + !mContent->OwnerDoc()->AllowsL10n();
|
|
| 54 | + if (spoofLocale) {
|
|
| 55 | + aBCP47LangTag.AssignLiteral("en-US");
|
|
| 56 | + return;
|
|
| 57 | + }
|
|
| 58 | + |
|
| 52 | 59 | nsAutoCString appLocale;
|
| 53 | 60 | LocaleService::GetInstance()->GetAppLocaleAsBCP47(aBCP47LangTag);
|
| 54 | 61 | return;
|