blob: 6c8da68dced65ecab32a72e704a8840a26aa0164 (
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
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
138
139
140
141
142
|
<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;
-moz-box-align: top;
-webkit-box-align: top;
position: relative;
overflow: auto;
}
div.vertical {
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
box-orient: vertical;
}
div.horizontal {
-moz-box-orient: horizontal;
-webkit-box-orient: horizontal;
box-orient: horizontal;
}
div.verticalMiddle {
width: 100px;
height: 90px;
background-color: black;
}
div.expandVerticalBottom {
width: 10px;
height: 5px;
background-color: black;
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;
border-left: 60px solid olive;
border-top: 2px solid blue;
padding-right: 30px;
padding-bottom: 2px;
}
div.shrinkVerticalBottom {
width: 10px;
height: 20px;
background-color: black;
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;
border-left: 60px solid olive;
border-top: 2px solid blue;
padding-right: 30px;
padding-bottom: 2px;
}
div.horizontalMiddle {
width: 90px;
height: 100px;
background-color: black;
}
div.expandHorizontalRight {
width: 5px;
height: 10px;
background-color: black;
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;
border-left: 2px solid olive;
border-top: 60px solid blue;
padding-right: 2px;
padding-bottom: 30px;
}
div.shrinkHorizontalRight {
width: 20px;
height: 10px;
background-color: black;
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;
border-left: 2px solid olive;
border-top: 60px solid blue;
padding-right: 2px;
padding-bottom: 30px;
}
</style>
</head>
<body>
<div class="box vertical outer" id="expandVertical">
<div class="verticalMiddle"></div>
<div class="expandVerticalBottom"></div>
</div>
<div class="box vertical outer" id="shrinkVertical">
<div class="verticalMiddle"></div>
<div class="shrinkVerticalBottom"></div>
</div>
<div class="box horizontal outer" id="expandHorizontal">
<div class="horizontalMiddle"></div>
<div class="expandHorizontalRight"></div>
</div>
<div class="box horizontal outer" id="shrinkHorizontal">
<div class="horizontalMiddle"></div>
<div class="shrinkHorizontalRight"></div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("Check if box-flex specified flexboxes expand or shrink correctly. If you see any scrollbars, then the test has failed.");
var element = null;
debug("vertically expanding");
element = document.getElementById("expandVertical");
shouldBe("element.scrollHeight", "100");
shouldBe("element.scrollWidth", "100");
debug("vertically shrinking");
element = document.getElementById("shrinkVertical");
shouldBe("element.scrollHeight", "100");
shouldBe("element.scrollWidth", "100");
debug("horizontally expanding");
element = document.getElementById("expandHorizontal");
shouldBe("element.scrollHeight", "100");
shouldBe("element.scrollWidth", "100");
debug("horizontally shrinking");
element = document.getElementById("shrinkHorizontal");
shouldBe("element.scrollHeight", "100");
shouldBe("element.scrollWidth", "100");
</script>
</body>
|