summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/input-widths.html
blob: 7cc5e6cea33b5801e6556e2defbf9a0a1f7ee5f6 (plain)
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
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<p id="description">Text field types should have the same default widths.</p>
<div id="console"></div>

<div id=parent>
<input type=text id=text>

<input type=email id=email>
<input type=number id=number>
<input type=password id=password>
<input type=tel id=tel>
<input type=url id=url>
</div>

<script>
var baseWidth = document.getElementById('text').offsetWidth;

shouldBe('document.getElementById("email").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("number").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("password").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("tel").offsetWidth', 'baseWidth');
shouldBe('document.getElementById("url").offsetWidth', 'baseWidth');

// type=search is not tested intentionally.

document.getElementById('parent').innerHTML = '';
</script>
</body>
</html>