OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <meta charset="utf-8"> |
| 3 <title>CSS Logical Properties: {max-,min-}inline-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 inline-size: 40px; |
| 18 min-inline-size: 50px; |
| 19 max-inline-size: 100px; |
| 20 } |
| 21 #div2 { |
| 22 inline-size: 100px; |
| 23 min-inline-size: 50px; |
| 24 max-inline-size: 100px; |
| 25 } |
| 26 #div3 { |
| 27 inline-size: 120px; |
| 28 min-inline-size: 50px; |
| 29 max-inline-size: 100px; |
| 30 } |
| 31 #ref_div1 { |
| 32 height: 40px; |
| 33 min-height: 50px; |
| 34 max-height: 100px; |
| 35 } |
| 36 #ref_div2 { |
| 37 height: 100px; |
| 38 min-height: 50px; |
| 39 max-height: 100px; |
| 40 } |
| 41 #ref_div3 { |
| 42 height: 120px; |
| 43 min-height: 50px; |
| 44 max-height: 100px; |
| 45 } |
| 46 |
| 47 p { |
| 48 border: 1px solid #000; |
| 49 writing-mode: vertical-lr; |
| 50 } |
| 51 #p1 { |
| 52 inline-size: 100px; |
| 53 height: 50px; |
| 54 } |
| 55 #p2 { |
| 56 height: 50px; |
| 57 inline-size: 100px; |
| 58 } |
| 59 #ref_p1 { |
| 60 height: 50px; |
| 61 } |
| 62 #ref_p2 { |
| 63 height: 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 inline-size: 40px; |
| 77 min-inline-size: 50px; |
| 78 max-inline-size: 100px; |
| 79 block-size: 100px; |
| 80 background-color: red; |
| 81 } |
| 82 #table2_cell { |
| 83 inline-size: 100px; |
| 84 min-inline-size: 50px; |
| 85 max-inline-size: 100px; |
| 86 block-size: 100px; |
| 87 background-color: blue; |
| 88 } |
| 89 #table3_cell { |
| 90 inline-size: 120px; |
| 91 min-inline-size: 50px; |
| 92 max-inline-size: 100px; |
| 93 block-size: 100px; |
| 94 background-color: green; |
| 95 } |
| 96 #ref_table1_cell { |
| 97 height: 40px; |
| 98 min-height: 50px; |
| 99 max-height: 100px; |
| 100 width: 100px; |
| 101 background-color: red; |
| 102 } |
| 103 #ref_table2_cell { |
| 104 height: 100px; |
| 105 min-height: 50px; |
| 106 max-height: 100px; |
| 107 width: 100px; |
| 108 background-color: blue; |
| 109 } |
| 110 #ref_table3_cell { |
| 111 height: 120px; |
| 112 min-height: 50px; |
| 113 max-height: 100px; |
| 114 width: 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 inline-size < min-inline-size or min-inline-size < inline-size <=
max-inline-size or inline-size > max-inline-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 height override inline-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 inline-size < min-inline-size or min-inline-size < inline-size <=
max-inline-size or inline-size > max-inline-size in table vertical-lr"); |
| 167 </script> |
OLD | NEW |