summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/vertical-box-form-controls.html
blob: 0a0ef6e5fe155aa736d66936e2f12ca3f1e74f52 (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
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
<html>
<head>
<script src="../../resources/js-test.js"></script>
<style>
div.box {
  display: -moz-box;
  display: -webkit-box;
  display: box;
}

div.outer {
  width: 100px;
  height: 100px;
  background-color: red;
  box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-box-orient: vertical;
}

.inner {
  display: -webkit-box;
  display: -moz-box;
  display: box;
  box-align: stretch;
  -moz-box-align: stretch;
  -webkit-box-align: stretch;
  margin: 0;
  border: 0;
  padding: 0;
  height: 100px;
  background-color: green;
}
</style>
</head>
<body>
<div class="box outer">
<button class="inner" type="submit" id="button"></button>
</div>
<div class="box outer">
<input class="inner" type="text" value="" id="inputText">
</div>
<div class="box outer">
<textarea class="inner" id="textarea"></textarea>
</div>
<div class="box outer">
<input class="inner" type="submit" value="" id="submit">
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("Check if form controls in vertical flex box will stretch horizontally when rendered as box as opposed to inline-box.  If you see any red, then the test has failed.");

var element = null;

debug("Button");
element = document.getElementById("button");
shouldBe("element.offsetHeight", "100");
shouldBe("element.offsetWidth", "100");

debug("Text input");
element = document.getElementById("inputText");
shouldBe("element.offsetHeight", "100");
shouldBe("element.offsetWidth", "100");

debug("Textarea");
element = document.getElementById("textarea");
shouldBe("element.offsetHeight", "100");
shouldBe("element.offsetWidth", "100");

debug("Submit");
element = document.getElementById("submit");
shouldBe("element.offsetHeight", "100");
shouldBe("element.offsetWidth", "100");
</script>
</body>
</html>