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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-get-set.html

Issue 1889143003: Improve named grid areas parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-get-set-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link href="resources/grid.css" rel="stylesheet"> 4 <link href="resources/grid.css" rel="stylesheet">
5 <style> 5 <style>
6 #gridWithSingleStringTemplate { 6 #gridWithSingleStringTemplate {
7 grid-template-areas: "area"; 7 grid-template-areas: "area";
8 } 8 }
9 9
10 #gridWithTwoColumnsTemplate { 10 #gridWithTwoColumnsTemplate {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", '"foobar"') 148 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", '"foobar"')
149 element.style.gridTemplateAreas = "none"; 149 element.style.gridTemplateAreas = "none";
150 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", 'none'); 150 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", 'none');
151 document.body.removeChild(element); 151 document.body.removeChild(element);
152 152
153 debug("Test grid-template-areas: inherit"); 153 debug("Test grid-template-areas: inherit");
154 var parentElement = document.createElement("div"); 154 var parentElement = document.createElement("div");
155 document.body.appendChild(parentElement); 155 document.body.appendChild(parentElement);
156 parentElement.style.gridTemplateAreas = "'foo bar'"; 156 parentElement.style.gridTemplateAreas = "'foo bar'";
157 shouldBeEqualToString("window.getComputedStyle(parentElement).getPropertyVal ue('grid-template-areas')", '"foo bar"') 157 shouldBeEqualToString("window.getComputedStyle(parentElement).getPropertyVal ue('grid-template-areas')", '"foo bar"')
158 parentElement.style.gridTemplateAreas = "'foo" + "\t" + "bar'";
159 shouldBeEqualToString("window.getComputedStyle(parentElement).getPropertyVal ue('grid-template-areas')", '"foo bar"')
160 parentElement.style.gridTemplateAreas = "'foo" + "\n" + "bar'";
161 shouldBeEqualToString("window.getComputedStyle(parentElement).getPropertyVal ue('grid-template-areas')", '"foo bar"')
158 162
159 var element = document.createElement("div"); 163 var element = document.createElement("div");
160 parentElement.appendChild(element); 164 parentElement.appendChild(element);
161 element.style.gridTemplateAreas = "inherit"; 165 element.style.gridTemplateAreas = "inherit";
162 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", '"foo bar"') 166 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", '"foo bar"')
163 document.body.removeChild(parentElement); 167 document.body.removeChild(parentElement);
164 168
165 debug("Test invalid grid-template-areas values."); 169 debug("Test invalid grid-template-areas values.");
166 var element = document.createElement("div"); 170 var element = document.createElement("div");
167 document.body.appendChild(element); 171 document.body.appendChild(element);
(...skipping 11 matching lines...) Expand all
179 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none") 183 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
180 184
181 // The rows don't have the same number of columns. 185 // The rows don't have the same number of columns.
182 element.style.gridTemplateAreas = "'nav head' 'foot'"; 186 element.style.gridTemplateAreas = "'nav head' 'foot'";
183 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none") 187 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
184 188
185 // Empty rows. 189 // Empty rows.
186 element.style.gridTemplateAreas = "'' ''"; 190 element.style.gridTemplateAreas = "'' ''";
187 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none") 191 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
188 192
193 element.style.gridTemplateAreas = "'^nav'";
194 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
195 element.style.gridTemplateAreas = "'n^av'";
196 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
197
198 element.style.gridTemplateAreas = "'\x04nav'";
199 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
200 element.style.gridTemplateAreas = "'n\x04av'";
201 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
202
189 debug(""); 203 debug("");
190 debug("FIXME: We currently don't validate that the named grid areas are &lt; indent&gt;."); 204 debug("FIXME: We currently don't validate that the named grid areas are &lt; indent&gt;.");
191 // <ident> only allows a leading '-'. 205 // <ident> only allows a leading '-'.
192 element.style.gridTemplateAreas = '"nav-up"'; 206 element.style.gridTemplateAreas = '"nav-up"';
193 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none") 207 shouldBeEqualToString("window.getComputedStyle(element).getPropertyValue('gr id-template-areas')", "none")
194 </script> 208 </script>
195 </body> 209 </body>
196 </html> 210 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-areas-get-set-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698