Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(658)

Unified Diff: LayoutTests/fast/forms/validationMessage.html

Issue 435753003: Implement minlength for <input> and <textarea>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add layout tests for minlength & maxlength together; fix comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/validationMessage.html
diff --git a/LayoutTests/fast/forms/validationMessage.html b/LayoutTests/fast/forms/validationMessage.html
index 76ba3f0ad9d8fd3dd3a462bf82620c804da41ceb..11a312e4395fdad0f753cfbfbf9ff20bdfef9090 100644
--- a/LayoutTests/fast/forms/validationMessage.html
+++ b/LayoutTests/fast/forms/validationMessage.html
@@ -128,6 +128,36 @@ document.execCommand("inserttext", false, "a\nbc");
textarea.maxLength = 3;
debug("textarea tooLong: " + textarea.validationMessage);
+debug("tooShort:");
+var inputWithMin = document.createElement("input");
+inputWithMin.minLength = 3;
+inputWithMin.value = "ab";
+document.body.appendChild(inputWithMin);
+inputWithMin.focus();
+document.execCommand("delete");
+debug("input tooShort: " + inputWithMin.validationMessage);
+// fancyX should be treated as 3 characters.
+// U+0305 COMBINING OVERLINE
+// U+0332 COMBINING LOW LINE
+var fancyX = "x\u0305\u0332";
+inputWithMin.minLength = 4;
+inputWithMin.value = fancyX + "X";
+inputWithMin.focus();
+inputWithMin.setSelectionRange(4, 4);
+document.execCommand("delete");
+debug("input tooShort: " + inputWithMin.validationMessage);
+// The following test might show English text + Arabic digits. It's expected and
+// it never happens in products.
+inputWithMin.lang = "ar-eg";
+debug("input tooShort: " + inputWithMin.validationMessage);
+
+var textarea = document.createElement("textarea");
+document.body.appendChild(textarea);
+textarea.focus();
+document.execCommand("inserttext", false, "a\n");
+textarea.minLength = 4;
+debug("textarea tooShort: " + textarea.validationMessage);
+
// A button can't be valited and, thus, has a blank validationMessage
var but = document.createElement("button");
but.name = "button";

Powered by Google App Engine
This is Rietveld 408576698