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

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

Issue 1168453002: [CSSGridLayout] Switch from parentheses to brackets for grid line names (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing v2 Created 5 years, 6 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
OLDNEW
1 description('Test that setting and getting grid-template-columns and grid-templa te-rows works as expected'); 1 description('Test that setting and getting grid-template-columns and grid-templa te-rows works as expected');
2 2
3 debug("Test getting grid-template-columns and grid-template-rows set through CSS "); 3 debug("Test getting grid-template-columns and grid-template-rows set through CSS ");
4 testGridDefinitionsValues(document.getElementById("gridWithNoneElement"), "none" , "none"); 4 testGridDefinitionsValues(document.getElementById("gridWithNoneElement"), "none" , "none");
5 testGridDefinitionsValues(document.getElementById("gridWithFixedElement"), "10px ", "15px"); 5 testGridDefinitionsValues(document.getElementById("gridWithFixedElement"), "10px ", "15px");
6 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "53 %", "27%"); 6 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "53 %", "27%");
7 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto" , "auto"); 7 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto" , "auto");
8 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px", "150px"); 8 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px", "150px");
9 testGridDefinitionsValues(document.getElementById("gridWithViewPortPercentageEle ment"), "64px", "60px"); 9 testGridDefinitionsValues(document.getElementById("gridWithViewPortPercentageEle ment"), "64px", "60px");
10 testGridDefinitionsValues(document.getElementById("gridWithMinMax"), "minmax(10% , 15px)", "minmax(20px, 50%)"); 10 testGridDefinitionsValues(document.getElementById("gridWithMinMax"), "minmax(10% , 15px)", "minmax(20px, 50%)");
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 debug(""); 78 debug("");
79 debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS"); 79 debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS");
80 testNonGridDefinitionsSetJSValues("18px", "66px"); 80 testNonGridDefinitionsSetJSValues("18px", "66px");
81 testNonGridDefinitionsSetJSValues("none", "none"); 81 testNonGridDefinitionsSetJSValues("none", "none");
82 82
83 function testInherit() 83 function testInherit()
84 { 84 {
85 var parentElement = document.createElement("div"); 85 var parentElement = document.createElement("div");
86 document.body.appendChild(parentElement); 86 document.body.appendChild(parentElement);
87 parentElement.style.gridTemplateColumns = "50px (last)"; 87 parentElement.style.gridTemplateColumns = "50px [last]";
88 parentElement.style.gridTemplateRows = "(first) 101%"; 88 parentElement.style.gridTemplateRows = "[first] 101%";
89 89
90 element = document.createElement("div"); 90 element = document.createElement("div");
91 parentElement.appendChild(element); 91 parentElement.appendChild(element);
92 element.style.gridTemplateColumns = "inherit"; 92 element.style.gridTemplateColumns = "inherit";
93 element.style.gridTemplateRows = "inherit"; 93 element.style.gridTemplateRows = "inherit";
94 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'50px (last)'"); 94 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'50px [last]'");
95 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'(first) 101%'"); 95 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'[first] 101%'");
96 96
97 document.body.removeChild(parentElement); 97 document.body.removeChild(parentElement);
98 } 98 }
99 debug(""); 99 debug("");
100 debug("Test setting grid-template-columns and grid-template-rows to 'inherit' th rough JS"); 100 debug("Test setting grid-template-columns and grid-template-rows to 'inherit' th rough JS");
101 testInherit(); 101 testInherit();
102 102
103 function testInitial() 103 function testInitial()
104 { 104 {
105 element = document.createElement("div"); 105 element = document.createElement("div");
106 document.body.appendChild(element); 106 document.body.appendChild(element);
107 element.style.gridTemplateColumns = "150% (last)"; 107 element.style.gridTemplateColumns = "150% [last]";
108 element.style.gridTemplateRows = "(first) 1fr"; 108 element.style.gridTemplateRows = "[first] 1fr";
109 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'150% (last)'"); 109 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'150% [last]'");
110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'(first) 1fr'"); 110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'[first] 1fr'");
111 111
112 element.style.gridTemplateColumns = "initial"; 112 element.style.gridTemplateColumns = "initial";
113 element.style.gridTemplateRows = "initial"; 113 element.style.gridTemplateRows = "initial";
114 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'none'"); 114 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'none'");
115 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'none'"); 115 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'none'");
116 116
117 document.body.removeChild(element); 117 document.body.removeChild(element);
118 } 118 }
119 debug(""); 119 debug("");
120 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th rough JS"); 120 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th rough JS");
121 testInitial(); 121 testInitial();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698