Changeset 228319 in webkit
- Timestamp:
- Feb 9, 2018 6:57:12 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228300 r228319 1 2018-02-09 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-align] Implement the new behavior of 'legacy' for justify-items 4 https://bugs.webkit.org/show_bug.cgi?id=172712 5 6 Reviewed by Antti Koivisto. 7 8 Rebaselined Default Alignment related tests because of the new 'legacy' value. 9 10 * css3/parse-alignment-of-root-elements.html: 11 * css3/parse-place-items.html: 12 * fast/css/parse-justify-items.html: 13 1 14 2018-02-08 Matt Lewis <jlewis3@apple.com> 2 15 -
trunk/LayoutTests/css3/parse-alignment-of-root-elements-expected.txt
r227432 r228319 17 17 PASS Check out how the DOM's root element justify-items's value with 'legacy' keyword is used to resolve any descendant's justify-items 'auto' values. 18 18 PASS Check out how the DOM's root element recomputes its descendant's style when 'legacy' keyword is removed from its justify-items value. 19 FAIL Shadow Node inherits from ShadowHost to resolve the 'auto' values for align-self. assert_equals: alignItems specified value is not what it should. expected "right" but got "" 19 PASS Shadow Node inherits from ShadowHost to resolve the 'auto' values for align-self. 20 20 PASS Shadow Node inherits from ShadowHost to resolve the 'auto' values for justify-self. 21 21 PASS Check out how the 'legacy' keyword in justify-items propagates from the DOM Tree to the Shadow Node. 22 FAIL Check out how align-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned. assert_equals: alignItems specified value is not what it should. expected "left" but got ""23 FAIL Check out how justify-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned. assert_equals: justifyItems is not what is should. expected " normal" but got "left"24 FAIL Check out how the 'legacy' keyword in justify-items affects the 'slotted' elements while 'slot' is not assigned. assert_equals: justifyItems is not what is should. expected "normal" but got "left" 25 FAIL Check out how align-self uses the 'slot' element's parent (Shadow Node) as 'slotted' element' s parent after the 'slot' is assigned. assert_equals: alignItems specified value is not what it should. expected "left" but got "" 22 FAIL Check out how align-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned. assert_equals: alignItems is not what is should. expected "normal" but got "end" 23 FAIL Check out how justify-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned. assert_equals: justifyItems is not what is should. expected "left" but got "normal" 24 PASS Check out how the 'legacy' keyword in justify-items affects the 'slotted' elements while 'slot' is not assigned. 25 PASS Check out how align-self uses the 'slot' element's parent (Shadow Node) as 'slotted' element' s parent after the 'slot' is assigned. 26 26 PASS Check out how justify-self uses the 'slot' element's parent (Shadow Node) as 'slotted' element' s parent after the 'slot' is assigned. 27 FAIL Check out how the 'legacy' keyword affects the 'slotted' elements after the 'slot' is assigned. assert_equals: justifyItems is not what is should. expected "normal" but got "legacy center" 28 FAIL The 'slot' element should not use its parent inside the ShadowDOM tree to resolve the align-self 'auto' values because Blink does not support slots in the flat tree. assert_equals: alignItems specified value is not what it should. expected "left" but got "" 27 PASS Check out how the 'legacy' keyword affects the 'slotted' elements after the 'slot' is assigned. 28 PASS The 'slot' element should not use its parent inside the ShadowDOM tree to resolve the align-self 'auto' values because Blink does not support slots in the flat tree. 29 29 PASS The 'slot' element should not use its parent inside the ShadowDOM tree to resolve the justify-self 'auto' values because Blink does not support slots in the flat tree. 30 30 -
trunk/LayoutTests/css3/parse-alignment-of-root-elements.html
r219315 r228319 56 56 document.documentElement.style.justifyItems = "center"; 57 57 checkValues(document.documentElement, "justifyItems", "justify-items", "center", "center"); 58 document.body.style.justifyItems = " auto";58 document.body.style.justifyItems = "legacy"; 59 59 document.body.style.justifySelf = "auto"; 60 checkValues(document.body, "justifyItems", "justify-items", " auto", "normal");60 checkValues(document.body, "justifyItems", "justify-items", "legacy", "normal"); 61 61 checkValues(document.body, "justifySelf", "justify-self", "auto", "auto"); 62 block.style.justifyItems = " auto";62 block.style.justifyItems = "legacy"; 63 63 block.style.justifySelf = "auto"; 64 checkValues(block, "justifyItems", "justify-items", " auto", "normal");64 checkValues(block, "justifyItems", "justify-items", "legacy", "normal"); 65 65 checkValues(block, "justifySelf", "justify-self", "auto", "auto"); 66 66 }, "Check out how the DOM's root element justify-items's value is used to resolve its children's justify-self 'auto' values."); 67 67 68 68 test(function() { 69 document.documentElement.style.justifyItems = " auto";70 checkValues(document.documentElement, "justifyItems", "justify-items", " auto", "normal");69 document.documentElement.style.justifyItems = "legacy"; 70 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy", "normal"); 71 71 checkValues(document.body, "justifySelf", "justify-self", "auto", "auto"); 72 72 checkValues(block, "justifySelf", "justify-self", "auto", "auto"); … … 76 76 document.documentElement.style.justifyItems = "legacy center"; 77 77 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 78 document.body.style.justifyItems = " auto";78 document.body.style.justifyItems = "legacy"; 79 79 document.body.style.justifySelf = "auto"; 80 checkValues(document.body, "justifyItems", "justify-items", " auto", "legacy center");80 checkValues(document.body, "justifyItems", "justify-items", "legacy", "legacy center"); 81 81 checkValues(document.body, "justifySelf", "justify-self", "auto", "auto"); 82 block.style.justifyItems = " auto";82 block.style.justifyItems = "legacy"; 83 83 block.style.justifySelf = "auto"; 84 checkValues(block, "justifyItems", "justify-items", " auto", "legacy center");84 checkValues(block, "justifyItems", "justify-items", "legacy", "legacy center"); 85 85 checkValues(block, "justifySelf", "justify-self", "auto", "auto"); 86 86 }, "Check out how the DOM's root element justify-items's value with 'legacy' keyword is used to resolve any descendant's justify-items 'auto' values."); 87 87 88 88 test(function() { 89 document.documentElement.style.justifyItems = " auto";90 checkValues(document.body, "justifyItems", "justify-items", " auto", "normal");89 document.documentElement.style.justifyItems = "legacy"; 90 checkValues(document.body, "justifyItems", "justify-items", "legacy", "normal"); 91 91 checkValues(document.body, "justifySelf", "justify-self", "auto", "auto"); 92 checkValues(block, "justifyItems", "justify-items", " auto", "normal");92 checkValues(block, "justifyItems", "justify-items", "legacy", "normal"); 93 93 checkValues(block, "justifySelf", "justify-self", "auto", "auto"); 94 94 }, "Check out how the DOM's root element recomputes its descendant's style when 'legacy' keyword is removed from its justify-items value."); … … 107 107 test(function() { 108 108 shadowHost.style.alignItems = "center"; 109 shadowNode.style.alignItems = " right";109 shadowNode.style.alignItems = "end"; 110 110 checkValues(shadowHost, "alignItems", "align-items", "center", "center"); 111 checkValues(shadowNode, "alignItems", "align-items", " right", "right");111 checkValues(shadowNode, "alignItems", "align-items", "end", "end"); 112 112 shadowNode.style.alignItems = ""; 113 113 checkValues(shadowNode, "alignItems", "align-items", "", "normal"); … … 128 128 129 129 test(function() { 130 shadowHost.style.justifyItems = " auto";130 shadowHost.style.justifyItems = "legacy"; 131 131 shadowNode.style.justifyItems = "right"; 132 132 shadowNode.style.justifySelf = "auto"; 133 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "normal");133 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal"); 134 134 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 135 135 checkValues(shadowNode, "justifySelf", "justify-self", "auto", "auto"); 136 136 137 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "normal");138 document.documentElement.style.justifyItems = "legacy center"; 139 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 140 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "legacy center");137 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal"); 138 document.documentElement.style.justifyItems = "legacy center"; 139 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 140 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center"); 141 141 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 142 142 checkValues(shadowNode, "justifySelf", "justify-self", "auto", "auto"); 143 shadowNode.style.justifyItems = " auto";144 checkValues(shadowNode, "justifyItems", "justify-items", " auto", "legacy center");145 document.documentElement.style.justifyItems = " auto";143 shadowNode.style.justifyItems = "legacy"; 144 checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center"); 145 document.documentElement.style.justifyItems = "legacy"; 146 146 }, "Check out how the 'legacy' keyword in justify-items propagates from the DOM Tree to the Shadow Node."); 147 147 … … 154 154 test(function() { 155 155 shadowHost.style.alignItems = "center"; 156 shadowNode.style.alignItems = " right";157 slotted.style.alignItems = " left";158 checkValues(slotted, "alignItems", "align-items", " left", "left");159 slotted.style.alignItems = " normal";160 checkValues(slotted, "alignItems", "align-items", " normal", "normal");156 shadowNode.style.alignItems = "start"; 157 slotted.style.alignItems = "end"; 158 checkValues(slotted, "alignItems", "align-items", "end", "end"); 159 slotted.style.alignItems = ""; 160 checkValues(slotted, "alignItems", "align-items", "", "normal"); 161 161 slotted.style.alignSelf = "start"; 162 162 checkValues(slotted, "alignSelf", "align-self", "start", "start"); … … 179 179 180 180 test(function() { 181 shadowHost.style.justifyItems = " auto";182 shadowNode.style.justifyItems = "right"; 183 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "normal");184 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 185 document.documentElement.style.justifyItems = "legacy center"; 186 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 187 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "legacy center");188 slotted.style.justifyItems = " auto";189 checkValues(slotted, "justifyItems", "justify-items", " auto", "normal");181 shadowHost.style.justifyItems = "legacy"; 182 shadowNode.style.justifyItems = "right"; 183 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal"); 184 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 185 document.documentElement.style.justifyItems = "legacy center"; 186 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 187 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center"); 188 slotted.style.justifyItems = "legacy"; 189 checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal"); 190 190 slotted.style.justifySelf = "auto"; 191 191 checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); 192 shadowNode.style.justifyItems = " auto";193 checkValues(shadowNode, "justifyItems", "justify-items", " auto", "legacy center");194 checkValues(slotted, "justifyItems", "justify-items", " auto", "normal");192 shadowNode.style.justifyItems = "legacy"; 193 checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center"); 194 checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal"); 195 195 checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); 196 document.documentElement.style.justifyItems = " auto";196 document.documentElement.style.justifyItems = "legacy"; 197 197 }, "Check out how the 'legacy' keyword in justify-items affects the 'slotted' elements while 'slot' is not assigned."); 198 198 … … 204 204 test(function() { 205 205 shadowHost.style.alignItems = "center"; 206 shadowNode.style.alignItems = " right";207 slotted.style.alignItems = " left";208 checkValues(slotted, "alignItems", "align-items", " left", "left");206 shadowNode.style.alignItems = "end"; 207 slotted.style.alignItems = "start"; 208 checkValues(slotted, "alignItems", "align-items", "start", "start"); 209 209 slotted.style.alignItems = ""; 210 210 checkValues(slotted, "alignItems", "align-items", "", "normal"); … … 229 229 230 230 test(function() { 231 shadowHost.style.justifyItems = " auto";232 shadowNode.style.justifyItems = "right"; 233 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "normal");234 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 235 document.documentElement.style.justifyItems = "legacy center"; 236 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 237 checkValues(shadowHost, "justifyItems", "justify-items", " auto", "legacy center");238 slotted.style.justifyItems = " auto";239 checkValues(slotted, "justifyItems", "justify-items", " auto", "normal"); // Shadow host is not the parent now, but ShadowNode.231 shadowHost.style.justifyItems = "legacy"; 232 shadowNode.style.justifyItems = "right"; 233 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal"); 234 checkValues(shadowNode, "justifyItems", "justify-items", "right", "right"); 235 document.documentElement.style.justifyItems = "legacy center"; 236 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center"); 237 checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center"); 238 slotted.style.justifyItems = "legacy"; 239 checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal"); // Shadow host is not the parent now, but ShadowNode. 240 240 slotted.style.justifySelf = "auto"; 241 241 checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); // Shadow host is not the parent now, but ShadowNode. 242 shadowNode.style.justifyItems = " auto";243 checkValues(shadowNode, "justifyItems", "justify-items", " auto", "legacy center");244 checkValues(slotted, "justifyItems", "justify-items", " auto", "legacy center"); // Now that shadowNode is auto, 'legacy' applies.242 shadowNode.style.justifyItems = "legacy"; 243 checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center"); 244 checkValues(slotted, "justifyItems", "justify-items", "legacy", "legacy center"); // Now that shadowNode is auto, 'legacy' applies. 245 245 checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); // Now that shadowNode is auto, 'legacy' applies. 246 document.documentElement.style.justifyItems = " auto";246 document.documentElement.style.justifyItems = "legacy"; 247 247 }, "Check out how the 'legacy' keyword affects the 'slotted' elements after the 'slot' is assigned."); 248 248 249 249 test(function() { 250 250 shadowHost.style.alignItems = "center"; 251 shadowNode.style.alignItems = " right";252 slot.style.alignItems = " left";253 checkValues(slot, "alignItems", "align-items", " left", "left");251 shadowNode.style.alignItems = "end"; 252 slot.style.alignItems = "start"; 253 checkValues(slot, "alignItems", "align-items", "start", "start"); 254 254 slot.style.alignItems = ""; 255 255 checkValues(slot, "alignItems", "align-items", "", "normal"); 256 slot.style.alignSelf = " left";257 checkValues(slot, "alignSelf", "align-self", " left", "left");256 slot.style.alignSelf = "start"; 257 checkValues(slot, "alignSelf", "align-self", "start", "start"); 258 258 slot.style.alignSelf = "auto"; 259 259 checkValues(slot, "alignSelf", "align-self", "auto", "auto"); … … 266 266 slot.style.justifyItems = "left"; 267 267 checkValues(slot, "justifyItems", "justify-items", "left", "left"); 268 slot.style.justifyItems = " auto";269 checkValues(slot, "justifyItems", "justify-items", " auto", "normal");268 slot.style.justifyItems = "legacy"; 269 checkValues(slot, "justifyItems", "justify-items", "legacy", "normal"); 270 270 slot.style.justifySelf = "left"; 271 271 checkValues(slot, "justifySelf", "justify-self", "left", "left"); -
trunk/LayoutTests/css3/parse-place-items-expected.txt
r214966 r228319 3 3 4 4 PASS Test getting the Computed Value of place-items's longhand properties when setting 'normal' value through CSS. 5 PASS Test getting the Computed Value of place-items's longhand properties when setting 'center auto' value through CSS.6 5 PASS Test getting the Computed Value of place-items's longhand properties when setting 'baseline' value through CSS. 7 6 PASS Test getting the Computed Value of place-items's longhand properties when setting 'first baseline' value through CSS. … … 15 14 PASS Test getting the Computed Value of place-items's longhand properties when setting 'start self-end' value through CSS. 16 15 PASS Test getting the Computed Value of place-items's longhand properties when setting 'start baseline' value through CSS. 17 PASS Test setting '' as incorrect value through CSS.18 16 PASS Test setting 'auto' as incorrect value through CSS. 17 PASS Test setting 'center auto' as incorrect value through CSS. 19 18 PASS Test setting 'none' as incorrect value through CSS. 20 19 PASS Test setting 'safe' as incorrect value through CSS. -
trunk/LayoutTests/css3/parse-place-items.html
r219315 r228319 6 6 place-items: normal; 7 7 } 8 #placeItemsCenterAuto {9 place-items: center auto;10 }11 8 #placeItemsBaseline { 12 9 place-items: baseline; … … 49 46 #placeItemsAuto { 50 47 place-items: auto; 48 } 49 #placeItemsCenterAuto { 50 place-items: center auto; 51 51 } 52 52 #placeItemsNone { … … 75 75 76 76 <div id="placeItemsNormal"></div> 77 <div id="placeItemsCenterAuto"></div>78 77 <div id="placeItemsBaseline"></div> 79 78 <div id="placeItemsFirstBaseline"></div> … … 90 89 <div id="placeItemsEmpty"></div> 91 90 <div id="placeItemsAuto"></div> 91 <div id="placeItemsCenterAuto"></div> 92 92 <div id="placeItemsNone"></div> 93 93 <div id="placeItemsSafe"></div> … … 126 126 127 127 test(function() { 128 checkValues(placeItemsCenterAuto, "placeItems", "place-items", "", "center normal");129 checkPlaceItemsValues(placeItemsCenterAuto, "", "center", "normal");130 }, "Test getting the Computed Value of place-items's longhand properties when setting 'center auto' value through CSS.");131 132 test(function() {133 128 checkValues(placeItemsBaseline, "placeItems", "place-items", "", "baseline baseline"); 134 129 checkPlaceItemsValues(placeItemsBaseline, "", "baseline", "baseline"); … … 188 183 checkValues(placeItemsAuto, "placeItems", "place-items", "", "normal normal"); 189 184 checkPlaceItemsValues(placeItemsAuto, "", "normal", "normal"); 190 }, "Test setting '' as incorrect value through CSS.");191 192 test(function() {193 checkValues(placeItemsAuto, "placeItems", "place-items", "", "normal normal");194 checkPlaceItemsValues(placeItemsAuto, "", "normal", "normal");195 185 }, "Test setting 'auto' as incorrect value through CSS."); 186 187 test(function() { 188 checkValues(placeItemsCenterAuto, "placeItems", "place-items", "", "normal normal"); 189 checkPlaceItemsValues(placeItemsCenterAuto, "", "normal", "normal"); 190 }, "Test setting 'center auto' as incorrect value through CSS."); 196 191 197 192 test(function() { … … 228 223 229 224 test(function() { 225 checkPlaceItemsValuesBadJS("auto"); 230 226 checkPlaceItemsValuesBadJS("auto normal"); 227 checkPlaceItemsValuesBadJS("center auto"); 228 checkPlaceItemsValuesBadJS("legacy"); 229 checkPlaceItemsValuesBadJS("left legacy"); 231 230 checkPlaceItemsValuesBadJS("space-between"); 232 231 checkPlaceItemsValuesBadJS("center safe"); -
trunk/LayoutTests/fast/css/parse-justify-items-expected.txt
r214564 r228319 5 5 PASS Test initial value of justify-items through JS 6 6 PASS Test getting and setting justify-items through JS 7 PASS Test ' auto' value resolution for the root node7 PASS Test 'legacy' value resolution for the root node 8 8 PASS Test bad combinations of justify-items 9 9 PASS Test the value 'initial' … … 11 11 PASS Test the value 'initial' for flex containers 12 12 PASS Test the value 'inherit' 13 PASS Test the value 'legacy'13 PASS Test the legacy alignment 14 14 -
trunk/LayoutTests/fast/css/parse-justify-items.html
r227297 r228319 246 246 checkValues(element, "justifyItems", "justify-items", "normal", "normal"); 247 247 248 element.style.justifyItems = " auto";249 checkValues(element, "justifyItems", "justify-items", " auto", "normal");248 element.style.justifyItems = "legacy"; 249 checkValues(element, "justifyItems", "justify-items", "legacy", "normal"); 250 250 251 251 element.style.display = "flex"; 252 element.style.justifyItems = " auto";253 checkValues(element, "justifyItems", "justify-items", " auto", "normal");252 element.style.justifyItems = "legacy"; 253 checkValues(element, "justifyItems", "justify-items", "legacy", "normal"); 254 254 255 255 element.style.display = "grid"; 256 element.style.justifyItems = " auto";257 checkValues(element, "justifyItems", "justify-items", " auto", "normal");256 element.style.justifyItems = "legacy"; 257 checkValues(element, "justifyItems", "justify-items", "legacy", "normal"); 258 258 259 259 element.style.justifyItems = "self-end"; … … 262 262 263 263 test(function() { 264 document.documentElement.style.justifyItems = "auto"; 265 checkValues(document.documentElement, "justifyItems", "justify-items", "auto", "normal"); 266 }, "Test 'auto' value resolution for the root node"); 267 268 test(function() { 269 container = document.createElement("div"); 264 document.documentElement.style.justifyItems = "legacy"; 265 checkValues(document.documentElement, "justifyItems", "justify-items", "legacy", "normal"); 266 }, "Test 'legacy' value resolution for the root node"); 267 268 test(function() { 270 269 element = document.createElement("div"); 271 container.appendChild(element);272 document.body.appendChild(container); 273 270 document.body.appendChild(element); 271 272 checkBadValues(element, "justifyItems", "justify-items", "auto"); 274 273 checkBadValues(element, "justifyItems", "justify-items", "unsafe auto"); 275 274 checkBadValues(element, "justifyItems", "justify-items", "auto safe"); … … 301 300 checkBadValues(element, "justifyItems", "justify-items", "legacy auto"); 302 301 checkBadValues(element, "justifyItems", "justify-items", "legacy stretch"); 303 checkBadValues(element, "justifyItems", "justify-items", " legacy");302 checkBadValues(element, "justifyItems", "justify-items", "safe legacy"); 304 303 checkBadValues(element, "justifyItems", "justify-items", "legacy left right"); 305 304 checkBadValues(element, "justifyItems", "justify-items", "start safe"); … … 332 331 checkLegacyValues("justifyItems", "justify-items", "legacy center"); 333 332 checkLegacyValues("justifyItems", "justify-items", "legacy right"); 334 }, "Test the value 'legacy'");333 }, "Test the legacy alignment"); 335 334 </script> -
trunk/LayoutTests/imported/w3c/ChangeLog
r228312 r228319 1 2018-02-09 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-align] Implement the new behavior of 'legacy' for justify-items 4 https://bugs.webkit.org/show_bug.cgi?id=172712 5 6 Reviewed by Antti Koivisto. 7 8 Rebaselined Default Alignment related tests because of the new 'legacy' value. 9 10 * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: 11 * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: 12 * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: 13 * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: 14 * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: 15 * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: 16 * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: 17 1 18 2018-02-08 Antoine Quint <graouts@apple.com> 2 19 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt
r227786 r228319 6 6 PASS Verify numeric values are invalid 7 7 PASS Verify 'auto' values are invalid 8 PASS Verify self-position values are invalid 8 9 PASS Verify empty declaration is invalid 9 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html
r227786 r228319 49 49 50 50 test(function() { 51 checkInvalidValues("self-start") 52 checkInvalidValues("center self-end") 53 checkInvalidValues("self-end start") 54 }, "Verify self-position values are invalid"); 55 56 test(function() { 51 57 checkInvalidValues("") 52 58 }, "Verify empty declaration is invalid"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt
r227432 r228319 1 1 2 FAIL Test 'initial' value when nothing is specified assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 3 FAIL Test justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 4 FAIL Test grid items justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 5 FAIL Test flex items justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 6 FAIL Test absolute positioned elements justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 7 FAIL Test absolute positioned grid items justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 8 FAIL Test absolute positioned flex items justify-items: 'initial' assert_equals: justify-items computed style is not what is should. expected "legacy" but got "normal" 2 PASS Test 'initial' value when nothing is specified 3 PASS Test justify-items: 'initial' 4 PASS Test grid items justify-items: 'initial' 5 PASS Test flex items justify-items: 'initial' 6 PASS Test absolute positioned elements justify-items: 'initial' 7 PASS Test absolute positioned grid items justify-items: 'initial' 8 PASS Test absolute positioned flex items justify-items: 'initial' 9 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html
r227432 r228319 20 20 element = document.createElement("div"); 21 21 document.body.appendChild(element); 22 checkValues(element, "justifyItems", "justify-items", "", " legacy");22 checkValues(element, "justifyItems", "justify-items", "", "normal"); 23 23 }, "Test 'initial' value when nothing is specified"); 24 24 25 25 test(function() { 26 26 container.style.display = ""; 27 checkInitialValues(element, "justifyItems", "justify-items", "center", " legacy");27 checkInitialValues(element, "justifyItems", "justify-items", "center", "normal"); 28 28 }, "Test justify-items: 'initial'"); 29 29 30 30 test(function() { 31 31 container.style.display = "grid"; 32 checkInitialValues(element, "justifyItems", "justify-items", "safe start", " legacy");32 checkInitialValues(element, "justifyItems", "justify-items", "safe start", "normal"); 33 33 }, "Test grid items justify-items: 'initial'"); 34 34 35 35 test(function() { 36 36 container.style.display = "flex"; 37 checkInitialValues(element, "justifyItems", "justify-items", "unsafe end", " legacy");37 checkInitialValues(element, "justifyItems", "justify-items", "unsafe end", "normal"); 38 38 }, "Test flex items justify-items: 'initial'"); 39 39 … … 41 41 container.style.display = ""; 42 42 element.style.position = "absolute"; 43 checkInitialValues(element, "justifyItems", "justify-items", "start", " legacy");43 checkInitialValues(element, "justifyItems", "justify-items", "start", "normal"); 44 44 }, "Test absolute positioned elements justify-items: 'initial'"); 45 45 … … 47 47 container.style.display = "grid"; 48 48 element.style.position = "absolute"; 49 checkInitialValues(element, "justifyItems", "justify-items", "end", " legacy");49 checkInitialValues(element, "justifyItems", "justify-items", "end", "normal"); 50 50 }, "Test absolute positioned grid items justify-items: 'initial'"); 51 51 … … 53 53 container.style.display = "flex"; 54 54 element.style.position = "absolute"; 55 checkInitialValues(element, "justifyItems", "justify-items", "end", " legacy");55 checkInitialValues(element, "justifyItems", "justify-items", "end", "normal"); 56 56 }, "Test absolute positioned flex items justify-items: 'initial'"); 57 57 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt
r227432 r228319 1 1 2 FAIL Checking invalid combination - justify-items: auto assert_equals: justify-items specified value is not what it should. expected "" but got "auto" 2 PASS Checking invalid combination - justify-items: auto 3 3 PASS Checking invalid combination - justify-items: space-around 4 4 PASS Checking invalid combination - justify-items: auto safe -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt
r227432 r228319 4 4 PASS Verify 'left' and 'right' values are invalid for block/cross axis alignment 5 5 PASS Verify numeric values are invalid 6 PASS Verify 'auto' value is invalid as first longhand value. 6 PASS Verify 'auto' value is invalid. 7 PASS Verify 'legacy' value is invalid. 7 8 PASS Verify empty declaration is invalid 8 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html
r227786 r228319 38 38 checkInvalidValues("auto right") 39 39 checkInvalidValues("auto auto") 40 }, "Verify 'auto' value is invalid as first longhand value."); 40 checkInvalidValues("center auto") 41 }, "Verify 'auto' value is invalid."); 42 43 test(function() { 44 checkInvalidValues("legacy") 45 checkInvalidValues("legacy start") 46 checkInvalidValues("end legacy") 47 checkInvalidValues("legacy left") 48 checkInvalidValues("center legacy") 49 checkInvalidValues("start legacy center") 50 }, "Verify 'legacy' value is invalid."); 51 41 52 42 53 test(function() { -
trunk/Source/WebCore/ChangeLog
r228316 r228319 1 2018-02-09 Javier Fernandez <jfernandez@igalia.com> 2 3 [css-align] Implement the new behavior of 'legacy' for justify-items 4 https://bugs.webkit.org/show_bug.cgi?id=172712 5 6 Reviewed by Antti Koivisto. 7 8 The syntax of the 'justify-items' property accepts a new 'legacy' value, 9 replacing the 'auto' value which is now parsed as invalid. 10 11 https://github.com/w3c/csswg-drafts/issues/1318 12 13 This change affects also to the 'place-items' shorthand, which doesn't 14 accept 'auto' and, for the time being, neither 'legacy'. 15 16 Since the new value 'legacy' is also the default value, I don't expect 17 this change to break content of sites currently using the 'justify-items' 18 property. 19 20 No new tests, rebaselined existing test. 21 22 * css/CSSComputedStyleDeclaration.cpp: 23 (WebCore::valueForItemPositionWithOverflowAlignment): 24 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): 25 * css/CSSPrimitiveValueMappings.h: 26 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 27 (WebCore::CSSPrimitiveValue::operator ItemPosition const): 28 * css/CSSProperties.json: 29 * css/StyleResolver.cpp: 30 (WebCore::StyleResolver::adjustRenderStyle): 31 * css/parser/CSSPropertyParser.cpp: 32 (WebCore::isAuto): 33 (WebCore::isNormalOrStretch): 34 (WebCore::consumeSelfPositionOverflowPosition): 35 (WebCore::consumeJustifyItems): 36 (WebCore::consumeSimplifiedDefaultPosition): 37 (WebCore::consumeSimplifiedSelfPosition): 38 (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): 39 (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): 40 * rendering/RenderFlexibleBox.cpp: 41 (WebCore::alignmentOffset): 42 * rendering/RenderGrid.cpp: 43 (WebCore::RenderGrid::columnAxisPositionForChild const): 44 (WebCore::RenderGrid::rowAxisPositionForChild const): 45 * rendering/style/RenderStyle.cpp: 46 (WebCore::resolvedSelfAlignment): 47 (WebCore::RenderStyle::resolvedJustifyItems const): 48 * rendering/style/RenderStyle.h: 49 (WebCore::RenderStyle::initialJustifyItems): 50 * rendering/style/RenderStyleConstants.h: 51 * rendering/style/StyleRareNonInheritedData.cpp: 52 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 53 1 54 2018-02-09 Yacine Bandou <yacine.bandou_ext@softathome.com> 2 55 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r228095 r228319 2525 2525 if (data.position() >= ItemPositionCenter && data.overflow() != OverflowAlignmentDefault) 2526 2526 result->append(cssValuePool.createValue(data.overflow())); 2527 result->append(cssValuePool.createValue(data.position())); 2527 if (data.position() == ItemPositionLegacy) 2528 result->append(cssValuePool.createIdentifierValue(CSSValueNormal)); 2529 else 2530 result->append(cssValuePool.createValue(data.position())); 2528 2531 } 2529 2532 ASSERT(result->length() <= 2); … … 3004 3007 return valueForContentPositionAndDistributionWithOverflowAlignment(style.justifyContent(), CSSValueFlexStart); 3005 3008 case CSSPropertyJustifyItems: 3006 return valueForItemPositionWithOverflowAlignment(style.justifyItems() .position() == ItemPositionAuto ? RenderStyle::initialDefaultAlignment() : style.justifyItems());3009 return valueForItemPositionWithOverflowAlignment(style.justifyItems()); 3007 3010 case CSSPropertyJustifySelf: 3008 3011 return valueForItemPositionWithOverflowAlignment(style.justifySelf()); -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r226666 r228319 4963 4963 m_primitiveUnitType = CSS_VALUE_ID; 4964 4964 switch (itemPosition) { 4965 case ItemPositionLegacy: 4966 m_value.valueID = CSSValueLegacy; 4967 break; 4965 4968 case ItemPositionAuto: 4966 4969 m_value.valueID = CSSValueAuto; … … 5011 5014 { 5012 5015 switch (m_value.valueID) { 5016 case CSSValueLegacy: 5017 return ItemPositionLegacy; 5013 5018 case CSSValueAuto: 5014 5019 return ItemPositionAuto; -
trunk/Source/WebCore/css/CSSProperties.json
r228095 r228319 4739 4739 "-webkit-justify-items" 4740 4740 ], 4741 "initial": "initialSelfAlignment",4742 4741 "converter": "SelfOrDefaultAlignmentData" 4743 4742 }, -
trunk/Source/WebCore/css/StyleResolver.cpp
r227141 r228319 1064 1064 } 1065 1065 1066 // If the inherited value of justify-items includes the 'legacy' keyword, 1067 // 'auto' computes to the inherited value. Otherwise, 'auto' computes to 1068 // 'normal'. 1069 if (style.justifyItems().position() == ItemPositionAuto) { 1070 if (parentBoxStyle->justifyItems().positionType() == LegacyPosition) 1071 style.setJustifyItems(parentBoxStyle->justifyItems()); 1072 } 1066 // If the inherited value of justify-items includes the 'legacy' keyword (plus 'left', 'right' or 1067 // 'center'), 'legacy' computes to the the inherited value. Otherwise, 'auto' computes to 'normal'. 1068 if (parentBoxStyle->justifyItems().positionType() == LegacyPosition && style.justifyItems().position() == ItemPositionLegacy) 1069 style.setJustifyItems(parentBoxStyle->justifyItems()); 1073 1070 } 1074 1071 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r228095 r228319 2662 2662 } 2663 2663 2664 static bool isAutoOrNormalOrStretch(CSSValueID id) 2665 { 2666 return identMatches<CSSValueAuto, CSSValueNormal, CSSValueStretch>(id); 2664 static bool isAuto(CSSValueID id) 2665 { 2666 return identMatches<CSSValueAuto>(id); 2667 } 2668 2669 static bool isNormalOrStretch(CSSValueID id) 2670 { 2671 return identMatches<CSSValueNormal, CSSValueStretch>(id); 2667 2672 } 2668 2673 … … 3114 3119 ASSERT(isPositionKeyword); 3115 3120 CSSValueID id = range.peek().id(); 3116 if (isAuto OrNormalOrStretch(id))3121 if (isAuto(id) || isNormalOrStretch(id)) 3117 3122 return consumeIdent(range); 3118 3123 … … 3139 3144 static RefPtr<CSSValue> consumeJustifyItems(CSSParserTokenRange& range) 3140 3145 { 3146 // justify-items property does not allow the 'auto' value. 3147 if (identMatches<CSSValueAuto>(range.peek().id())) 3148 return nullptr; 3141 3149 CSSParserTokenRange rangeCopy = range; 3142 3150 RefPtr<CSSPrimitiveValue> legacy = consumeIdent<CSSValueLegacy>(rangeCopy); … … 3144 3152 if (!legacy) 3145 3153 legacy = consumeIdent<CSSValueLegacy>(rangeCopy); 3146 if (legacy && positionKeyword) {3154 if (legacy) { 3147 3155 range = rangeCopy; 3148 return createPrimitiveValuePair(legacy.releaseNonNull(), positionKeyword.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce); 3156 if (positionKeyword) 3157 return createPrimitiveValuePair(legacy.releaseNonNull(), positionKeyword.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce); 3158 return legacy; 3149 3159 } 3150 3160 return consumeSelfPositionOverflowPosition(range, isSelfPositionOrLeftOrRightKeyword); … … 5569 5579 } 5570 5580 5571 static RefPtr<CSSValue> consumeSimplified ItemPosition(CSSParserTokenRange& range, IsPositionKeyword isPositionKeyword)5581 static RefPtr<CSSValue> consumeSimplifiedDefaultPosition(CSSParserTokenRange& range, IsPositionKeyword isPositionKeyword) 5572 5582 { 5573 5583 ASSERT(isPositionKeyword); 5574 5584 CSSValueID id = range.peek().id(); 5575 if (is AutoOrNormalOrStretch(id) || isPositionKeyword(id))5585 if (isNormalOrStretch(id) || isPositionKeyword(id)) 5576 5586 return consumeIdent(range); 5577 5587 … … 5582 5592 } 5583 5593 5594 static RefPtr<CSSValue> consumeSimplifiedSelfPosition(CSSParserTokenRange& range, IsPositionKeyword isPositionKeyword) 5595 { 5596 ASSERT(isPositionKeyword); 5597 if (isAuto(range.peek().id())) 5598 return consumeIdent(range); 5599 return consumeSimplifiedDefaultPosition(range, isPositionKeyword); 5600 } 5601 5584 5602 bool CSSPropertyParser::consumePlaceItemsShorthand(bool important) 5585 5603 { 5586 5604 ASSERT(shorthandForProperty(CSSPropertyPlaceItems).length() == 2); 5587 5605 5588 // align-items property does not allow the 'auto' value. 5589 if (identMatches<CSSValueAuto>(m_range.peek().id())) 5590 return false; 5591 5592 RefPtr<CSSValue> alignItemsValue = consumeSimplifiedItemPosition(m_range, isSelfPositionKeyword); 5606 RefPtr<CSSValue> alignItemsValue = consumeSimplifiedDefaultPosition(m_range, isSelfPositionKeyword); 5593 5607 if (!alignItemsValue) 5594 5608 return false; 5595 RefPtr<CSSValue> justifyItemsValue = m_range.atEnd() ? alignItemsValue : consumeSimplified ItemPosition(m_range, isSelfPositionOrLeftOrRightKeyword);5609 RefPtr<CSSValue> justifyItemsValue = m_range.atEnd() ? alignItemsValue : consumeSimplifiedDefaultPosition(m_range, isSelfPositionOrLeftOrRightKeyword); 5596 5610 if (!justifyItemsValue) 5597 5611 return false; … … 5609 5623 ASSERT(shorthandForProperty(CSSPropertyPlaceSelf).length() == 2); 5610 5624 5611 RefPtr<CSSValue> alignSelfValue = consumeSimplified ItemPosition(m_range, isSelfPositionKeyword);5625 RefPtr<CSSValue> alignSelfValue = consumeSimplifiedSelfPosition(m_range, isSelfPositionKeyword); 5612 5626 if (!alignSelfValue) 5613 5627 return false; 5614 RefPtr<CSSValue> justifySelfValue = m_range.atEnd() ? alignSelfValue : consumeSimplified ItemPosition(m_range, isSelfPositionOrLeftOrRightKeyword);5628 RefPtr<CSSValue> justifySelfValue = m_range.atEnd() ? alignSelfValue : consumeSimplifiedSelfPosition(m_range, isSelfPositionOrLeftOrRightKeyword); 5615 5629 if (!justifySelfValue) 5616 5630 return false; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r224546 r228319 1337 1337 { 1338 1338 switch (position) { 1339 case ItemPositionLegacy: 1339 1340 case ItemPositionAuto: 1340 1341 case ItemPositionNormal: -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r228095 r228319 1297 1297 // FIXME: Implement the previous values. For now, we always 'start' align the child. 1298 1298 return GridAxisStart; 1299 case ItemPositionLegacy: 1299 1300 case ItemPositionAuto: 1300 1301 case ItemPositionNormal: … … 1364 1365 // FIXME: Implement the previous values. For now, we always 'start' align the child. 1365 1366 return GridAxisStart; 1367 case ItemPositionLegacy: 1366 1368 case ItemPositionAuto: 1367 1369 case ItemPositionNormal: -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r226675 r228319 243 243 static StyleSelfAlignmentData resolvedSelfAlignment(const StyleSelfAlignmentData& value, ItemPosition normalValueBehavior) 244 244 { 245 if (value.position() == ItemPosition Normal || value.position() == ItemPositionAuto)245 if (value.position() == ItemPositionLegacy || value.position() == ItemPositionNormal || value.position() == ItemPositionAuto) 246 246 return { normalValueBehavior, OverflowAlignmentDefault }; 247 247 return value; … … 264 264 StyleSelfAlignmentData RenderStyle::resolvedJustifyItems(ItemPosition normalValueBehaviour) const 265 265 { 266 // FIXME: justify-items 'auto' value is allowed only to provide the 'legacy' keyword's behavior, which it's still not implemented for layout.267 // "If the inherited value of justify-items includes the legacy keyword, auto computes to the inherited value."268 // https://drafts.csswg.org/css-align/#justify-items-property269 if (justifyItems().position() == ItemPositionAuto)270 return { normalValueBehaviour, OverflowAlignmentDefault };271 266 return resolvedSelfAlignment(justifyItems(), normalValueBehaviour); 272 267 } -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r228095 r228319 1494 1494 static Length initialFlexBasis() { return Length(Auto); } 1495 1495 static int initialOrder() { return 0; } 1496 static StyleSelfAlignmentData initialJustifyItems() { return StyleSelfAlignmentData(ItemPositionLegacy, OverflowAlignmentDefault); } 1496 1497 static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); } 1497 1498 static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(isCSSGridLayoutEnabled() ? ItemPositionNormal : ItemPositionStretch, OverflowAlignmentDefault); } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r226666 r228319 267 267 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse }; 268 268 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse }; 269 enum ItemPosition { ItemPosition Auto, ItemPositionNormal, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight };269 enum ItemPosition { ItemPositionLegacy, ItemPositionAuto, ItemPositionNormal, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight }; 270 270 enum OverflowAlignment { OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe }; 271 271 enum ItemPositionType { NonLegacyPosition, LegacyPosition }; -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r228095 r228319 75 75 , alignSelf(RenderStyle::initialSelfAlignment()) 76 76 , justifyContent(RenderStyle::initialContentAlignment()) 77 , justifyItems(RenderStyle::initial SelfAlignment())77 , justifyItems(RenderStyle::initialJustifyItems()) 78 78 , justifySelf(RenderStyle::initialSelfAlignment()) 79 79 #if ENABLE(TOUCH_EVENTS)
Note: See TracChangeset
for help on using the changeset viewer.