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

Side by Side Diff: LayoutTests/fast/forms/validationMessage.html

Issue 1100273002: input[type=number] UI should reject invalid characters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description("Test for validationMessage DOM property."); 10 description("Test for validationMessage DOM property.");
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage); 72 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage);
73 emailInput.value = "foo@example.com,"; 73 emailInput.value = "foo@example.com,";
74 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage); 74 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage);
75 emailInput.value = "foo@example.com,bar@..example.com"; 75 emailInput.value = "foo@example.com,bar@..example.com";
76 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage); 76 debug("input typeMismatch for " + emailInput.value + ": " + emailInput.validatio nMessage);
77 77
78 var numberInput = document.createElement("input"); 78 var numberInput = document.createElement("input");
79 numberInput.type = "number"; 79 numberInput.type = "number";
80 form.appendChild(numberInput); 80 form.appendChild(numberInput);
81 numberInput.focus(); 81 numberInput.focus();
82 document.execCommand("InsertText", false, "abc"); 82 document.execCommand("InsertText", false, "+++");
83 debug("input badInput: " + numberInput.validationMessage); 83 debug("input badInput: " + numberInput.validationMessage);
84 var nonRequiredBadInputMessage = numberInput.validationMessage; 84 var nonRequiredBadInputMessage = numberInput.validationMessage;
85 85
86 debug("badInput and valueMissing:"); 86 debug("badInput and valueMissing:");
87 numberInput.required = true; 87 numberInput.required = true;
88 shouldBe("numberInput.validationMessage", "nonRequiredBadInputMessage"); 88 shouldBe("numberInput.validationMessage", "nonRequiredBadInputMessage");
89 89
90 debug("stepMismatch:"); 90 debug("stepMismatch:");
91 numberInput.min = "0"; 91 numberInput.min = "0";
92 numberInput.step = "0.1"; 92 numberInput.step = "0.1";
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Keygen controls can't be validated 196 // Keygen controls can't be validated
197 var happyKeygen = document.createElement("keygen"); 197 var happyKeygen = document.createElement("keygen");
198 happySelect.name = "keygen"; 198 happySelect.name = "keygen";
199 form.appendChild(happyKeygen); 199 form.appendChild(happyKeygen);
200 shouldBe("happyKeygen.validationMessage", "''"); 200 shouldBe("happyKeygen.validationMessage", "''");
201 201
202 form.remove(); 202 form.remove();
203 </script> 203 </script>
204 </body> 204 </body>
205 </html> 205 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/number/number-validity-badinput-expected.txt ('k') | Source/core/html/forms/NumberInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698