summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-logical/logicalprops-block-size.html
blob: 8d90c07a983855fc8ed1a7b11fbe95deabfe7e00 (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
<!doctype html>
<meta charset="utf-8">
<title>CSS Logical Properties: {max-,min-}block-size</title>
<link rel="author" title="Xu Xing" href="mailto:openxu@gmail.com">
<link rel="help" href="https://drafts.csswg.org/css-logical-props-1/#logical-dimension-properties">
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>

<style>
.tests {
  width: 600px;
}

.block {
  border: 1px solid #000;
}
#block1 {
  block-size: 40px;
  min-block-size: 50px;
  max-block-size: 100px;
}
#block2 {
  block-size: 100px;
  min-block-size: 50px;
  max-block-size: 100px;
}
#block3 {
  block-size: 120px;
  min-block-size: 50px;
  max-block-size: 100px;
}

.override {
  border: 1px solid #000;
}
#override1 {
  block-size: 100px;
  height: 50px;
}
#override2 {
  height: 50px;
  block-size: 100px;
}

.table {
  border: 1px solid #000;
  display: table;
}
.tablecell {
  display: table-cell;
}
#table1_cell {
  block-size: 40px;
  min-block-size: 50px;
  max-block-size: 100px;
  inline-size: 100px;
  background-color: red;
}
#table2_cell {
  block-size: 100px;
  min-block-size: 50px;
  max-block-size: 100px;
  inline-size: 100px;
  background-color: blue;
}
#table3_cell {
  block-size: 120px;
  min-block-size: 50px;
  max-block-size: 100px;
  inline-size: 100px;
  background-color: green;
}
</style>

<div id="log"></div>

<h3>Maximum and minimim block sizes in blocks</h3>
<div class="tests">
  <p><code>block-size</code> &lt; <code>min-block-size</code></p>
  <div class="block" id="block1" data-expected-width="600" data-expected-client-height="50"></div>

  <p><code>min-block-size</code> &lt; <code>block-size</code> &le; <code>max-block-size</code></p>
  <div class="block" id="block2" data-expected-width="600" data-expected-client-height="100"></div>

  <p><code>block-size</code> &gt; <code>max-block-size</code></p>
  <div class="block" id="block3" data-expected-width="600" data-expected-client-height="100"></div>
</div>

<h3>Overridance of <code>height</code> and <code>block-size</code></h3>
<div class="tests">
  <p>Check that <code>height</code> overrides <code>block-size</code></p>
  <div class="override" id="override1" data-expected-width="600" data-expected-client-height="50"></div>

  <p>Check that <code>block-size</code> overrides <code>height</code></p>
  <div class="override" id="override2" data-expected-width="600" data-expected-client-height="100"></div>
</div>

<h3>Maximum and minimim block sizes in table cells</h3>
<div class="tests">
  <p><code>block-size</code> &lt; <code>min-block-size</code></p>
  <div class="table">
    <div class="tablecell" id="table1_cell" data-expected-client-width="100" data-expected-client-height="40"></div>
  </div>

  <p><code>min-block-size</code> &lt; <code>block-size</code> &le; <code>max-block-size</code></p>
  <div class="table">
    <div class="tablecell" id="table2_cell" data-expected-client-width="100" data-expected-client-height="100"></div>
  </div>

  <p><code>block-size</code> &gt; <code>max-block-size</code></p>
  <div class="table">
    <div class="tablecell" id="table3_cell" data-expected-client-width="100" data-expected-client-height="120"></div>
  </div>
</div>

<script>
checkLayout(".block", false);
checkLayout(".override", false);
checkLayout(".tablecell", false);
done();
</script>