summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-logical/logicalprops-inline-size-vlr.html
blob: 0a53dbbc5cf5c1df72883b6a5cd39ccea46a1284 (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
<!doctype html>
<meta charset="utf-8">
<title>CSS Logical Properties: {max-,min-}inline-size vertical-lr</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>
.block {
  border: 1px solid #000;
  writing-mode: vertical-lr;
}
#block1 {
  inline-size: 40px;
  min-inline-size: 50px;
  max-inline-size: 100px;
}
#block2 {
  inline-size: 100px;
  min-inline-size: 50px;
  max-inline-size: 100px;
}
#block3 {
  inline-size: 120px;
  min-inline-size: 50px;
  max-inline-size: 100px;
}

.override {
  border: 1px solid #000;
  writing-mode: vertical-lr;
}
#override1 {
  inline-size: 100px;
  height: 50px;
}
#override2 {
  height: 50px;
  inline-size: 100px;
}

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

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

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

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

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

<h3>Overridance of <code>height</code> and <code>inline-size</code> in vertical-lr</h3>
<div>
  <p>Check that <code>height</code> overrides <code>inline-size</code></p>
  <div class="override" id="override1" data-expected-client-width="0" data-expected-client-height="50"></div>

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

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

  <p><code>min-inline-size</code> &lt; <code>inline-size</code> &le; <code>max-inline-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>inline-size</code> &gt; <code>max-inline-size</code></p>
  <div class="table">
    <div class="tablecell" id="table3_cell" data-expected-client-width="100" data-expected-client-height="100"></div>
  </div>
</div>

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