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

Side by Side Diff: LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html

Issue 235273003: parsing input type=number should skip spaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 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
OLDNEW
(Empty)
1 <html>
tkent 2014/04/16 01:52:51 The test name is confusing. We have HTMLInputElem
gnana 2014/04/16 14:13:56 Done.
2 <body>
3 <script src="../../../resources/js-test.js"></script>
4 <input type="number" id="input" style="width:300px; height:50px; padding-left: 1 0px; margin-bottom: 10px; border:1px solid green;"></input>
tkent 2014/04/16 01:52:51 The style attribute looks unnecessary.
gnana 2014/04/16 14:13:56 Done.
5 <div>Printed Value: <span id="print">&nbsp;</span></div>
6 <script>
7 description('should print the input number removing space characters.');
8 jsTestIsAsync = true;
9 var input = document.getElementById('input');
10 input.onblur = function() {
11 var inputValue = document.getElementById('input').valueAsNumber;
12 document.getElementById('print').innerHTML = inputValue;
tkent 2014/04/16 01:52:51 Wrong indentation.
gnana 2014/04/16 14:13:56 Done.
13 if (!isNaN(inputValue))
tkent 2014/04/16 01:52:51 We should check the specific value. shouldBeEqua
gnana 2014/04/16 14:13:56 Done.
14 testPassed('spaces skipped');
15 }
16
17 window.onload = function()
18 {
19 var input = document.getElementById('input');
tkent 2014/04/16 01:52:51 This variable is redundant.
gnana 2014/04/16 14:13:56 Done.
20 if (!window.eventSender)
21 debug('Edit number input field with numbers & space. The test passes if "space are skipped" when printed.');
22 else {
23 input.focus();
24 eventSender.keyDown(" ");
tkent 2014/04/16 01:52:51 We don't need to use eventSender. document.execCo
gnana 2014/04/16 14:13:56 Done.
25 eventSender.keyDown("1");
26 eventSender.keyDown("2");
27 eventSender.keyDown("3");
28 eventSender.keyDown(" ");
29 eventSender.keyDown("4");
30 eventSender.keyDown("5");
31 eventSender.keyDown("6");
32 eventSender.keyDown(" ");
33 input.blur();
34 finishJSTest();
35 }
36 }
37 </script>
38 </body>
39 </html>
40
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698