OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <meta charset="utf-8"> |
| 3 <title>CSS Logical Properties: {max-,min-}block-size vertical-lr</title> |
| 4 <link rel="author" title="Xu Xing" href="mailto:openxu@gmail.com"> |
| 5 <link rel="help" href="https://drafts.csswg.org/css-logical-props-1/#logical-dim
ension-properties"> |
| 6 <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#logical-to-
physical"> |
| 7 <script src="../../resources/testharness.js"></script> |
| 8 <script src="../../resources/testharnessreport.js"></script> |
| 9 <script src="resources/style-check.js"></script> |
| 10 |
| 11 <style> |
| 12 div { |
| 13 border: 1px solid #000; |
| 14 writing-mode: vertical-lr; |
| 15 } |
| 16 #div1 { |
| 17 block-size: 40px; |
| 18 min-block-size: 50px; |
| 19 max-block-size: 100px; |
| 20 } |
| 21 #div2 { |
| 22 block-size: 100px; |
| 23 min-block-size: 50px; |
| 24 max-block-size: 100px; |
| 25 } |
| 26 #div3 { |
| 27 block-size: 120px; |
| 28 min-block-size: 50px; |
| 29 max-block-size: 100px; |
| 30 } |
| 31 #ref_div1 { |
| 32 width: 40px; |
| 33 min-width: 50px; |
| 34 max-width: 100px; |
| 35 } |
| 36 #ref_div2 { |
| 37 width: 100px; |
| 38 min-width: 50px; |
| 39 max-width: 100px; |
| 40 } |
| 41 #ref_div3 { |
| 42 width: 120px; |
| 43 min-width: 50px; |
| 44 max-width: 100px; |
| 45 } |
| 46 |
| 47 p { |
| 48 border: 1px solid #000; |
| 49 writing-mode: vertical-lr; |
| 50 } |
| 51 #p1 { |
| 52 block-size: 100px; |
| 53 width: 50px; |
| 54 } |
| 55 #p2 { |
| 56 width: 50px; |
| 57 block-size: 100px; |
| 58 } |
| 59 #ref_p1 { |
| 60 width: 50px; |
| 61 } |
| 62 #ref_p2 { |
| 63 width: 100px; |
| 64 } |
| 65 |
| 66 .table { |
| 67 border: 1px solid #000; |
| 68 display: table; |
| 69 writing-mode: vertical-lr; |
| 70 } |
| 71 .tablecell { |
| 72 display: table-cell; |
| 73 writing-mode: vertical-lr; |
| 74 } |
| 75 #table1_cell { |
| 76 block-size: 40px; |
| 77 min-block-size: 50px; |
| 78 max-block-size: 100px; |
| 79 inline-size: 100px; |
| 80 background-color: red; |
| 81 } |
| 82 #table2_cell { |
| 83 block-size: 100px; |
| 84 min-block-size: 50px; |
| 85 max-block-size: 100px; |
| 86 inline-size: 100px; |
| 87 background-color: blue; |
| 88 } |
| 89 #table3_cell { |
| 90 block-size: 120px; |
| 91 min-block-size: 50px; |
| 92 max-block-size: 100px; |
| 93 inline-size: 100px; |
| 94 background-color: green; |
| 95 } |
| 96 #ref_table1_cell { |
| 97 width: 40px; |
| 98 min-width: 50px; |
| 99 max-width: 100px; |
| 100 height: 100px; |
| 101 background-color: red; |
| 102 } |
| 103 #ref_table2_cell { |
| 104 width: 100px; |
| 105 min-width: 50px; |
| 106 max-width: 100px; |
| 107 height: 100px; |
| 108 background-color: blue; |
| 109 } |
| 110 #ref_table3_cell { |
| 111 width: 120px; |
| 112 min-width: 50px; |
| 113 max-width: 100px; |
| 114 height: 100px; |
| 115 background-color: green; |
| 116 } |
| 117 </style> |
| 118 |
| 119 <div id="div1"></div> |
| 120 <div id="div2"></div> |
| 121 <div id="div3"></div> |
| 122 <div id="ref_div1"></div> |
| 123 <div id="ref_div2"></div> |
| 124 <div id="ref_div3"></div> |
| 125 |
| 126 <p id="p1"></div> |
| 127 <p id="p2"></div> |
| 128 <p id="ref_p1"></div> |
| 129 <p id="ref_p2"></div> |
| 130 |
| 131 <div class="table"> |
| 132 <div class="tablecell" id="table1_cell"></div> |
| 133 </div> |
| 134 <div class="table"> |
| 135 <div class="tablecell" id="table2_cell"></div> |
| 136 </div> |
| 137 <div class="table"> |
| 138 <div class="tablecell" id="table3_cell"></div> |
| 139 </div> |
| 140 <div class="table"> |
| 141 <div class="tablecell" id="ref_table1_cell"></div> |
| 142 </div> |
| 143 <div class="table"> |
| 144 <div class="tablecell" id="ref_table2_cell"></div> |
| 145 </div> |
| 146 <div class="table"> |
| 147 <div class="tablecell" id="ref_table3_cell"></div> |
| 148 </div> |
| 149 |
| 150 <script> |
| 151 test(function () { |
| 152 assert_true(compareWidthHeight("div1", "ref_div1")); |
| 153 assert_true(compareWidthHeight("div2", "ref_div2")); |
| 154 assert_true(compareWidthHeight("div3", "ref_div3")); |
| 155 }, "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"); |
| 156 |
| 157 test(function () { |
| 158 assert_true(compareWidthHeight("p1", "ref_p1")); |
| 159 assert_true(compareWidthHeight("p2", "ref_p2")); |
| 160 }, "Check that width override block-size and vice versa in vertical-lr"); |
| 161 |
| 162 test(function () { |
| 163 assert_true(compareWidthHeight("table1_cell", "ref_table1_cell")); |
| 164 assert_true(compareWidthHeight("table2_cell", "ref_table2_cell")); |
| 165 assert_true(compareWidthHeight("table3_cell", "ref_table3_cell")); |
| 166 }, "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"); |
| 167 </script> |
OLD | NEW |