Bug 1581537 - Avoid several browser language leaks r=smaug

Spoof dom/dom.properties, layout/xmlparser.properties,
layout/MediaDocument.properties to en-US if needed.

Differential Revision: https://phabricator.services.mozilla.com/D46034
This commit is contained in:
Alex Catarineu
2019-11-04 11:27:59 +00:00
parent d8c9ea3437
commit 884665353f
25 changed files with 290 additions and 149 deletions

View File

@@ -1047,9 +1047,9 @@ nsresult HTMLTextAreaElement::GetValidationMessage(
strMaxLength.AppendInt(maxLength);
strTextLength.AppendInt(textLength);
rv = nsContentUtils::FormatLocalizedString(
rv = nsContentUtils::FormatMaybeLocalizedString(
message, nsContentUtils::eDOM_PROPERTIES, "FormValidationTextTooLong",
strMaxLength, strTextLength);
OwnerDoc(), strMaxLength, strTextLength);
aValidationMessage = message;
} break;
case VALIDITY_STATE_TOO_SHORT: {
@@ -1062,16 +1062,17 @@ nsresult HTMLTextAreaElement::GetValidationMessage(
strMinLength.AppendInt(minLength);
strTextLength.AppendInt(textLength);
rv = nsContentUtils::FormatLocalizedString(
rv = nsContentUtils::FormatMaybeLocalizedString(
message, nsContentUtils::eDOM_PROPERTIES,
"FormValidationTextTooShort", strMinLength, strTextLength);
"FormValidationTextTooShort", OwnerDoc(), strMinLength,
strTextLength);
aValidationMessage = message;
} break;
case VALIDITY_STATE_VALUE_MISSING: {
nsAutoString message;
rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
"FormValidationValueMissing",
message);
rv = nsContentUtils::GetMaybeLocalizedString(
nsContentUtils::eDOM_PROPERTIES, "FormValidationValueMissing",
OwnerDoc(), message);
aValidationMessage = message;
} break;
default: