-
Notifications
You must be signed in to change notification settings - Fork 87
/
test.html
137 lines (118 loc) · 2.45 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stretchy Tests</title>
<link rel="icon" href="logo.svg">
<link rel="stylesheet" href="https://test.mavo.io/style.css" />
<style>
input, textarea, select {
/* Force custom rendering */
font: inherit;
background: transparent;
border: 1px solid rgba(0,0,0,.5);
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blissfuljs/1.0.4/bliss.min.js"></script>
</head>
<body>
<h1>Stretchy Tests</h1>
<section>
<h1>Input</h1>
<table class="reftest" data-test="testHorizontalScroll">
<tr title="With placeholder">
<td>
<input placeholder="Type some text" />
</td>
</tr>
<tr title="No placeholder, intial value">
<td>
<input value="Some text" />
</td>
</tr>
<tr title="No placeholder, no initial value">
<td>
<input />
</td>
</tr>
<tr title="With autocomplete">
<td>
<input list="datalist" value="Ja" />
<datalist id="datalist">
<option>Java</option>
<option>JavaScript</option>
<option>J++</option>
<option>C++</option>
<option>Python</option>
</datalist>
</td>
</tr>
<tr title="Number input">
<td>
<input type="number" value="100">
</td>
</tr>
</table>
</section>
<script>
function testHorizontalScroll(td) {
var input = $("input", td);
var previous = input.scrollLeft;
if (!previous) {
input.scrollLeft = 1;
}
var pass = input.scrollLeft == 0;
input.scrollLeft = previous;
return pass;
}
function testVerticalScroll(td) {
var input = $("textarea", td);
var previous = input.scrollTop;
if (!previous) {
input.scrollTop = 1;
}
var pass = input.scrollTop == 0;
input.scrollTop = previous;
return pass;
}
</script>
<section>
<h1>Textarea</h1>
<table class="reftest" data-test="testVerticalScroll">
<tr title="Initial value">
<td>
<textarea>Hello there</textarea>
</td>
</tr>
<tr title="Placeholder">
<td>
<textarea placeholder="Type here too"></textarea>
</td>
</tr>
<tr>
<td title="No placeholder, no initial value">
<textarea></textarea>
</td>
</tr>
</table>
</section>
<section>
<h1>Select</h1>
<div>
<select>
<option>CSS</option>
<option>JavaScript</option>
<option>HTML</option>
<option>SVG</option>
<option>WAI-ARIA</option>
</select>
</div>
<div>
<select>
</select>
</div>
</section>
<script src="https://test.mavo.io/test.js"></script>
<script src="dist/stretchy.iife.js"></script>
</body>
</html>