[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / forms / input-minmax.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description('Tests the behavior of .min and .max of HTMLInputElement.');
11
12 var input = document.createElement('input');
13
14 // .min and .max just reflect the corresponding attributes.
15 input.type = 'text';
16 shouldBe('input.min', '""');
17 shouldBe('input.max', '""');
18 input.setAttribute('min', '0');
19 input.setAttribute('max', '100');
20 shouldBe('input.min', '"0"');
21 shouldBe('input.max', '"100"');
22 input.setAttribute('min', 'abc');
23 input.setAttribute('max', 'qwerty');
24 shouldBe('input.min', '"abc"');
25 shouldBe('input.max', '"qwerty"');
26
27 input.min = 'foo';
28 input.max = 'bar';
29 shouldBe('input.getAttribute("min")', '"foo"');
30 shouldBe('input.getAttribute("max")', '"bar"');
31 input.min = '';
32 input.max = '';
33 shouldBe('input.getAttribute("min")', '""');
34 shouldBe('input.getAttribute("max")', '""');
35
36 // Null.
37 debug('Setting null to min:');
38 input.min = null;
39 shouldBe('input.min', '""');
40 shouldBe('input.getAttribute("min")', 'null');
41 input.setAttribute('min', null);
42 shouldBe('input.min', '"null"');
43
44 debug('Setting null to max:');
45 input.max = null;
46 shouldBe('input.max', '""');
47 shouldBe('input.getAttribute("max")', 'null');
48 input.setAttribute('max', null);
49 shouldBe('input.max', '"null"');
50
51 // Undefined.
52 debug('Setting undefined to min:');
53 input.min = undefined;
54 shouldBe('input.min', '"undefined"');
55 shouldBe('input.getAttribute("min")', '"undefined"');
56 input.setAttribute('min', undefined);
57 shouldBe('input.min', '"undefined"');
58
59 debug('Setting undefined to max:');
60 input.max = undefined;
61 shouldBe('input.max', '"undefined"');
62 shouldBe('input.getAttribute("max")', '"undefined"');
63 input.setAttribute('max', undefined);
64 shouldBe('input.max', '"undefined"');
65
66 // Non-string.
67 debug('Setting non-string to min:');
68 input.min = 256;
69 shouldBe('input.min', '"256"');
70 shouldBe('input.getAttribute("min")', '"256"');
71 input.setAttribute('min', 256);
72 shouldBe('input.min', '"256"');
73
74 debug('Setting non-string to max:');
75 input.max = 256;
76 shouldBe('input.max', '"256"');
77 shouldBe('input.getAttribute("max")', '"256"');
78 input.setAttribute('max', 256);
79 shouldBe('input.max', '"256"');
80
81 // The range type has the default minimum and the default maximum.
82 // But they aren't exposed by .min .max IDL attributes.
83 debug('Check implicit min/max of type=range:');
84 input.type = 'range';
85 input.setAttribute('min', '');
86 input.setAttribute('max', '');
87 shouldBe('input.min', '""');
88 shouldBe('input.max', '""');
89 </script>
90 <script src="../../fast/js/resources/js-test-post.js"></script>
91 </body>
92 </html>