Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js

Issue 19668006: [CSS Grid Layout] infinity should be defined as a negative value (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description('Test that setting and getting grid-definition-columns and grid-defi nition-rows works as expected'); 1 description('Test that setting and getting grid-definition-columns and grid-defi nition-rows works as expected');
2 2
3 debug("Test getting |display| set through CSS"); 3 debug("Test getting |display| set through CSS");
4 var gridWithFixedElement = document.getElementById("gridWithFixedElement"); 4 var gridWithFixedElement = document.getElementById("gridWithFixedElement");
5 shouldBe("getComputedStyle(gridWithFixedElement, '').getPropertyValue('grid-defi nition-columns')", "'7px 11px'"); 5 shouldBe("getComputedStyle(gridWithFixedElement, '').getPropertyValue('grid-defi nition-columns')", "'7px 11px'");
6 shouldBe("getComputedStyle(gridWithFixedElement, '').getPropertyValue('grid-defi nition-rows')", "'17px 2px'"); 6 shouldBe("getComputedStyle(gridWithFixedElement, '').getPropertyValue('grid-defi nition-rows')", "'17px 2px'");
7 7
8 var gridWithPercentElement = document.getElementById("gridWithPercentElement"); 8 var gridWithPercentElement = document.getElementById("gridWithPercentElement");
9 shouldBe("getComputedStyle(gridWithPercentElement, '').getPropertyValue('grid-de finition-columns')", "'53% 99%'"); 9 shouldBe("getComputedStyle(gridWithPercentElement, '').getPropertyValue('grid-de finition-columns')", "'53% 99%'");
10 shouldBe("getComputedStyle(gridWithPercentElement, '').getPropertyValue('grid-de finition-rows')", "'27% 52%'"); 10 shouldBe("getComputedStyle(gridWithPercentElement, '').getPropertyValue('grid-de finition-rows')", "'27% 52%'");
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'"); 162 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'");
163 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'"); 163 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'");
164 164
165 element = document.createElement("div"); 165 element = document.createElement("div");
166 document.body.appendChild(element); 166 document.body.appendChild(element);
167 element.style.gridDefinitionColumns = "auto minmax(16px, auto)"; 167 element.style.gridDefinitionColumns = "auto minmax(16px, auto)";
168 element.style.gridDefinitionRows = "minmax(auto, 15%) 10vw"; 168 element.style.gridDefinitionRows = "minmax(auto, 15%) 10vw";
169 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'"); 169 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'");
170 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'"); 170 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'");
171 171
172 // Negative values are not allowed.
173 element = document.createElement("div");
174 document.body.appendChild(element);
175 element.style.gridDefinitionColumns = "-10px minmax(16px, 32px)";
176 element.style.gridDefinitionRows = "minmax(10%, 15%) -10vw";
177 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'");
178 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'");
179
180 element = document.createElement("div");
181 document.body.appendChild(element);
182 element.style.gridDefinitionColumns = "10px minmax(16px, -1vw)";
183 element.style.gridDefinitionRows = "minmax(-1%, 15%) 10vw";
184 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-column s')", "'none'");
185 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-rows') ", "'none'");
186
172 function testInherit() 187 function testInherit()
173 { 188 {
174 var parentElement = document.createElement("div"); 189 var parentElement = document.createElement("div");
175 document.body.appendChild(parentElement); 190 document.body.appendChild(parentElement);
176 parentElement.style.gridDefinitionColumns = "50px 1fr 'last'"; 191 parentElement.style.gridDefinitionColumns = "50px 1fr 'last'";
177 parentElement.style.gridDefinitionRows = "101% 'middle' 45px"; 192 parentElement.style.gridDefinitionRows = "101% 'middle' 45px";
178 193
179 element = document.createElement("div"); 194 element = document.createElement("div");
180 parentElement.appendChild(element); 195 parentElement.appendChild(element);
181 element.style.gridDefinitionColumns = "inherit"; 196 element.style.gridDefinitionColumns = "inherit";
(...skipping 19 matching lines...) Expand all
201 element.style.gridDefinitionColumns = "initial"; 216 element.style.gridDefinitionColumns = "initial";
202 element.style.gridDefinitionRows = "initial"; 217 element.style.gridDefinitionRows = "initial";
203 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co lumns')", "'none'"); 218 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co lumns')", "'none'");
204 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro ws')", "'none'"); 219 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro ws')", "'none'");
205 220
206 document.body.removeChild(element); 221 document.body.removeChild(element);
207 } 222 }
208 debug(""); 223 debug("");
209 debug("Test setting grid-definition-columns and grid-definition-rows to 'initial ' through JS"); 224 debug("Test setting grid-definition-columns and grid-definition-rows to 'initial ' through JS");
210 testInitial(); 225 testInitial();
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js ('k') | Source/core/css/CSSParser-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698