From ff09f6fedba84b4487497a488c80d4ce6e5571f0 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 2 Feb 2015 15:42:40 -0500 Subject: [PATCH] Bug 1128153. When a number input contains a non-number (possibly empty) value, the validation message should be about the value not being a number, not about there being no value. r=jwatt --- dom/html/HTMLInputElement.cpp | 3 ++ .../forms/test_input_number_validation.html | 37 +++++++++++++++++-- .../test/forms/test_required_attribute.html | 6 +++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index f6ee411e19e3..cb18f3975858 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -6894,6 +6894,9 @@ HTMLInputElement::GetValidationMessage(nsAString& aValidationMessage, case NS_FORM_INPUT_RADIO: key.AssignLiteral("FormValidationRadioMissing"); break; + case NS_FORM_INPUT_NUMBER: + key.AssignLiteral("FormValidationBadInputNumber"); + break; default: key.AssignLiteral("FormValidationValueMissing"); } diff --git a/dom/html/test/forms/test_input_number_validation.html b/dom/html/test/forms/test_input_number_validation.html index 365cf228568f..8b8af2b7f278 100644 --- a/dom/html/test/forms/test_input_number_validation.html +++ b/dom/html/test/forms/test_input_number_validation.html @@ -16,6 +16,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=827161

+