OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 #justifyItemsBaseline { |
| 6 justify-items: baseline; |
| 7 } |
| 8 |
| 9 #justifyItemsStretch { |
| 10 justify-items: stretch; |
| 11 } |
| 12 |
| 13 #justifyItemsStart { |
| 14 justify-items: start; |
| 15 } |
| 16 |
| 17 #justifyItemsEnd { |
| 18 justify-items: end; |
| 19 } |
| 20 |
| 21 #justifyItemsCenter { |
| 22 justify-items: center; |
| 23 } |
| 24 |
| 25 #justifyItemsItemsStart { |
| 26 justify-items: self-start; |
| 27 } |
| 28 |
| 29 #justifyItemsItemsEnd { |
| 30 justify-items: self-end; |
| 31 } |
| 32 |
| 33 #justifyItemsLeft { |
| 34 justify-items: left; |
| 35 } |
| 36 |
| 37 #justifyItemsRight { |
| 38 justify-items: right; |
| 39 } |
| 40 |
| 41 #justifyItemsEndTrue { |
| 42 justify-items: end true; |
| 43 } |
| 44 |
| 45 #justifyItemsCenterTrue { |
| 46 justify-items: center true; |
| 47 } |
| 48 |
| 49 #justifyItemsItemsEndSafe { |
| 50 justify-items: self-end safe; |
| 51 } |
| 52 |
| 53 #justifyItemsItemsStartSafe { |
| 54 justify-items: self-start safe; |
| 55 } |
| 56 |
| 57 #justifyItemsRightSafe { |
| 58 justify-items: right safe; |
| 59 } |
| 60 |
| 61 #justifyItemsLeftTrue { |
| 62 justify-items: left true; |
| 63 } |
| 64 </style> |
| 65 <script src="../../resources/js-test.js"></script> |
| 66 </head> |
| 67 <body> |
| 68 <div id="justifyItemsBaseline"></div> |
| 69 <div id="justifyItemsStretch"></div> |
| 70 <div id="justifyItemsStart"></div> |
| 71 <div id="justifyItemsEnd"></div> |
| 72 <div id="justifyItemsCenter"></div> |
| 73 <div id="justifyItemsItemsStart"></div> |
| 74 <div id="justifyItemsItemsEnd"></div> |
| 75 <div id="justifyItemsLeft"></div> |
| 76 <div id="justifyItemsRight"></div> |
| 77 |
| 78 <div id="justifyItemsEndTrue"></div> |
| 79 <div id="justifyItemsCenterTrue"></div> |
| 80 <div id="justifyItemsItemsEndSafe"></div> |
| 81 <div id="justifyItemsItemsStartSafe"></div> |
| 82 <div id="justifyItemsRightSafe"></div> |
| 83 <div id="justifyItemsLeftTrue"></div> |
| 84 <script> |
| 85 description('Test that setting and getting justify-items works as expected'); |
| 86 |
| 87 debug("Test getting justify-items set through CSS"); |
| 88 var justifyItemsBaseline = document.getElementById("justifyItemsBaseline"); |
| 89 shouldBe("getComputedStyle(justifyItemsBaseline, '').getPropertyValue('justify-i
tems')", "'baseline'"); |
| 90 |
| 91 var justifyItemsStretch = document.getElementById("justifyItemsStretch"); |
| 92 shouldBe("getComputedStyle(justifyItemsStretch, '').getPropertyValue('justify-it
ems')", "'stretch'"); |
| 93 |
| 94 var justifyItemsStart = document.getElementById("justifyItemsStart"); |
| 95 shouldBe("getComputedStyle(justifyItemsStart, '').getPropertyValue('justify-item
s')", "'start'"); |
| 96 |
| 97 var justifyItemsEnd = document.getElementById("justifyItemsEnd"); |
| 98 shouldBe("getComputedStyle(justifyItemsEnd, '').getPropertyValue('justify-items'
)", "'end'"); |
| 99 |
| 100 var justifyItemsCenter = document.getElementById("justifyItemsCenter"); |
| 101 shouldBe("getComputedStyle(justifyItemsCenter, '').getPropertyValue('justify-ite
ms')", "'center'"); |
| 102 |
| 103 var justifyItemsItemsEnd = document.getElementById("justifyItemsItemsEnd"); |
| 104 shouldBe("getComputedStyle(justifyItemsItemsEnd, '').getPropertyValue('justify-i
tems')", "'self-end'"); |
| 105 |
| 106 var justifyItemsItemsStart = document.getElementById("justifyItemsItemsStart"); |
| 107 shouldBe("getComputedStyle(justifyItemsItemsStart, '').getPropertyValue('justify
-items')", "'self-start'"); |
| 108 |
| 109 var justifyItemsLeft = document.getElementById("justifyItemsLeft"); |
| 110 shouldBe("getComputedStyle(justifyItemsLeft, '').getPropertyValue('justify-items
')", "'left'"); |
| 111 |
| 112 var justifyItemsRight = document.getElementById("justifyItemsRight"); |
| 113 shouldBe("getComputedStyle(justifyItemsRight, '').getPropertyValue('justify-item
s')", "'right'"); |
| 114 |
| 115 var justifyItemsEndTrue = document.getElementById("justifyItemsEndTrue"); |
| 116 shouldBe("getComputedStyle(justifyItemsEndTrue, '').getPropertyValue('justify-it
ems')", "'end true'"); |
| 117 |
| 118 var justifyItemsCenterTrue = document.getElementById("justifyItemsCenterTrue"); |
| 119 shouldBe("getComputedStyle(justifyItemsCenterTrue, '').getPropertyValue('justify
-items')", "'center true'"); |
| 120 |
| 121 var justifyItemsItemsEndSafe = document.getElementById("justifyItemsItemsEndSafe
"); |
| 122 shouldBe("getComputedStyle(justifyItemsItemsEndSafe, '').getPropertyValue('justi
fy-items')", "'self-end safe'"); |
| 123 |
| 124 var justifyItemsItemsStartSafe = document.getElementById("justifyItemsItemsStart
Safe"); |
| 125 shouldBe("getComputedStyle(justifyItemsItemsStartSafe, '').getPropertyValue('jus
tify-items')", "'self-start safe'"); |
| 126 |
| 127 var justifyItemsRightSafe = document.getElementById("justifyItemsRightSafe"); |
| 128 shouldBe("getComputedStyle(justifyItemsRightSafe, '').getPropertyValue('justify-
items')", "'right safe'"); |
| 129 |
| 130 var justifyItemsLeftTrue = document.getElementById("justifyItemsLeftTrue"); |
| 131 shouldBe("getComputedStyle(justifyItemsLeftTrue, '').getPropertyValue('justify-i
tems')", "'left true'"); |
| 132 |
| 133 debug(""); |
| 134 debug("Test initial value of justify-items through JS"); |
| 135 element = document.createElement("div"); |
| 136 document.body.appendChild(element); |
| 137 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 138 |
| 139 debug(""); |
| 140 debug("Test getting and setting justify-items through JS"); |
| 141 element = document.createElement("div"); |
| 142 document.body.appendChild(element); |
| 143 element.style.justifyItems = "center"; |
| 144 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'ce
nter'"); |
| 145 |
| 146 element = document.createElement("div"); |
| 147 document.body.appendChild(element); |
| 148 element.style.justifyItems = "true start"; |
| 149 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'st
art true'"); |
| 150 |
| 151 element.style.justifyItems = "auto"; |
| 152 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 153 |
| 154 debug(""); |
| 155 debug("Test bad combinaisons of justify-items"); |
| 156 element = document.createElement("div"); |
| 157 document.body.appendChild(element); |
| 158 element.style.justifyItems = "true auto"; |
| 159 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 160 |
| 161 element.style.justifyItems = "auto safe"; |
| 162 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 163 |
| 164 element.style.justifyItems = "auto left"; |
| 165 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 166 |
| 167 element.style.justifyItems = "baseline safe"; |
| 168 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 169 |
| 170 element.style.justifyItems = "baseline center"; |
| 171 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 172 |
| 173 element.style.justifyItems = "stretch true"; |
| 174 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 175 |
| 176 element.style.justifyItems = "stretch right"; |
| 177 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 178 |
| 179 element.style.justifyItems = "true true"; |
| 180 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 181 |
| 182 element.style.justifyItems = "true safe"; |
| 183 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 184 |
| 185 element.style.justifyItems = "center start"; |
| 186 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 187 |
| 188 element.style.justifyItems = "stretch true"; |
| 189 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 190 |
| 191 element.style.justifyItems = "safe stretch"; |
| 192 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 193 |
| 194 element.style.justifyItems = "baseline safe"; |
| 195 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 196 |
| 197 element.style.justifyItems = "true baseline"; |
| 198 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 199 |
| 200 element.style.justifyItems = "true safe"; |
| 201 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 202 |
| 203 element.style.justifyItems = "true safe left"; |
| 204 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 205 |
| 206 element.style.justifyItems = "true left safe"; |
| 207 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 208 |
| 209 element.style.justifyItems = "left safe true safe"; |
| 210 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 211 |
| 212 debug(""); |
| 213 debug("Test the value 'initial'"); |
| 214 element.style.justifyItems = "center"; |
| 215 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'ce
nter'"); |
| 216 element.style.justifyItems = "initial"; |
| 217 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'au
to'"); |
| 218 |
| 219 debug(""); |
| 220 debug("Test the value 'inherit'"); |
| 221 parentElement = document.createElement("div"); |
| 222 document.body.appendChild(parentElement); |
| 223 parentElement.style.justifyItems = "end"; |
| 224 shouldBe("getComputedStyle(parentElement, '').getPropertyValue('justify-items')"
, "'end'"); |
| 225 |
| 226 element = document.createElement("div"); |
| 227 parentElement.appendChild(element); |
| 228 element.style.justifyItems = "inherit"; |
| 229 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'en
d'"); |
| 230 </script> |
| 231 </body> |
| 232 </html> |
OLD | NEW |