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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
<!doctype html>
<meta charset="utf-8">
<title>CSS Logical Properties: {max-,min-}block-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/style-check.js"></script>
<style>
div {
border: 1px solid #000;
writing-mode: vertical-lr;
}
#div1 {
block-size: 40px;
min-block-size: 50px;
max-block-size: 100px;
}
#div2 {
block-size: 100px;
min-block-size: 50px;
max-block-size: 100px;
}
#div3 {
block-size: 120px;
min-block-size: 50px;
max-block-size: 100px;
}
#ref_div1 {
width: 40px;
min-width: 50px;
max-width: 100px;
}
#ref_div2 {
width: 100px;
min-width: 50px;
max-width: 100px;
}
#ref_div3 {
width: 120px;
min-width: 50px;
max-width: 100px;
}
p {
border: 1px solid #000;
writing-mode: vertical-lr;
}
#p1 {
block-size: 100px;
width: 50px;
}
#p2 {
width: 50px;
block-size: 100px;
}
#ref_p1 {
width: 50px;
}
#ref_p2 {
width: 100px;
}
.table {
border: 1px solid #000;
display: table;
writing-mode: vertical-lr;
}
.tablecell {
display: table-cell;
writing-mode: vertical-lr;
}
#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;
}
#ref_table1_cell {
width: 40px;
min-width: 50px;
max-width: 100px;
height: 100px;
background-color: red;
}
#ref_table2_cell {
width: 100px;
min-width: 50px;
max-width: 100px;
height: 100px;
background-color: blue;
}
#ref_table3_cell {
width: 120px;
min-width: 50px;
max-width: 100px;
height: 100px;
background-color: green;
}
</style>
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
<div id="ref_div1"></div>
<div id="ref_div2"></div>
<div id="ref_div3"></div>
<p id="p1"></div>
<p id="p2"></div>
<p id="ref_p1"></div>
<p id="ref_p2"></div>
<div class="table">
<div class="tablecell" id="table1_cell"></div>
</div>
<div class="table">
<div class="tablecell" id="table2_cell"></div>
</div>
<div class="table">
<div class="tablecell" id="table3_cell"></div>
</div>
<div class="table">
<div class="tablecell" id="ref_table1_cell"></div>
</div>
<div class="table">
<div class="tablecell" id="ref_table2_cell"></div>
</div>
<div class="table">
<div class="tablecell" id="ref_table3_cell"></div>
</div>
<script>
test(function () {
assert_true(compareWidthHeight("div1", "ref_div1"));
assert_true(compareWidthHeight("div2", "ref_div2"));
assert_true(compareWidthHeight("div3", "ref_div3"));
}, "Check that block-size < min-block-size or min-block-size < block-size <= max-block-size or block-size > max-block-size in vertical-lr");
test(function () {
assert_true(compareWidthHeight("p1", "ref_p1"));
assert_true(compareWidthHeight("p2", "ref_p2"));
}, "Check that width override block-size and vice versa in vertical-lr");
test(function () {
assert_true(compareWidthHeight("table1_cell", "ref_table1_cell"));
assert_true(compareWidthHeight("table2_cell", "ref_table2_cell"));
assert_true(compareWidthHeight("table3_cell", "ref_table3_cell"));
}, "Check that block-size < min-block-size or min-block-size < block-size <= max-block-size or block-size > max-block-size in table vertical-lr");
</script>
|