Commit fd8ea798 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by richard
Browse files

Revert "Bug 42374: Check for spoof English in number conversions"

This reverts commit a7932fac.

We are instead backporting the uplifted commits.
parent cc050dd9
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -52,7 +52,11 @@ nsresult NumericInputTypeBase::GetRangeOverflowMessage(nsAString& aMessage) {
  MOZ_ASSERT(!maximum.isNaN());

  nsAutoString maxStr;
  ConvertNumberToString(maximum, maxStr);
  char buf[32];
  DebugOnly<bool> ok = maximum.toString(buf, ArrayLength(buf));
  maxStr.AssignASCII(buf);
  MOZ_ASSERT(ok, "buf not big enough");

  return nsContentUtils::FormatMaybeLocalizedString(
      aMessage, nsContentUtils::eDOM_PROPERTIES,
      "FormValidationNumberRangeOverflow", mInputElement->OwnerDoc(), maxStr);
@@ -63,7 +67,11 @@ nsresult NumericInputTypeBase::GetRangeUnderflowMessage(nsAString& aMessage) {
  MOZ_ASSERT(!minimum.isNaN());

  nsAutoString minStr;
  ConvertNumberToString(minimum, minStr);
  char buf[32];
  DebugOnly<bool> ok = minimum.toString(buf, ArrayLength(buf));
  minStr.AssignASCII(buf);
  MOZ_ASSERT(ok, "buf not big enough");

  return nsContentUtils::FormatMaybeLocalizedString(
      aMessage, nsContentUtils::eDOM_PROPERTIES,
      "FormValidationNumberRangeUnderflow", mInputElement->OwnerDoc(), minStr);
+0 −7
Original line number Diff line number Diff line
@@ -49,13 +49,6 @@ void ICUUtils::LanguageTagIterForContent::GetNext(nsACString& aBCP47LangTag) {
    mCurrentFallbackIndex = 2;
    // Else take the app's locale:

    const bool spoofLocale = nsContentUtils::SpoofLocaleEnglish() &&
                             !mContent->OwnerDoc()->AllowsL10n();
    if (spoofLocale) {
      aBCP47LangTag.AssignLiteral("en-US");
      return;
    }

    nsAutoCString appLocale;
    LocaleService::GetInstance()->GetAppLocaleAsBCP47(aBCP47LangTag);
    return;