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

Side by Side Diff: LayoutTests/fast/css-grid-layout/resources/non-grid-columns-rows-get-set-multiple.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("gridWithFixedElement"), "7px 11px", "17px 2px"); 4 testGridDefinitionsValues(document.getElementById("gridWithFixedElement"), "7px 11px", "17px 2px");
5 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "53 % 99%", "27% 52%"); 5 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "53 % 99%", "27% 52%");
6 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto auto", "auto auto"); 6 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto auto", "auto auto");
7 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px 1 20px", "150px 170px"); 7 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px 1 20px", "150px 170px");
8 testGridDefinitionsValues(document.getElementById("gridWithThreeItems"), "15px a uto 100px", "120px 18px auto"); 8 testGridDefinitionsValues(document.getElementById("gridWithThreeItems"), "15px a uto 100px", "120px 18px auto");
9 testGridDefinitionsValues(document.getElementById("gridWithPercentAndViewportPer cent"), "50% 120px", "35% 168px"); 9 testGridDefinitionsValues(document.getElementById("gridWithPercentAndViewportPer cent"), "50% 120px", "35% 168px");
10 testGridDefinitionsValues(document.getElementById("gridWithFitContentAndFitAvail able"), "none", "none"); 10 testGridDefinitionsValues(document.getElementById("gridWithFitContentAndFitAvail able"), "none", "none");
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 testGridDefinitionsSetBadJSValues("-webkit-fit-content -webkit-fit-content", "-w ebkit-fit-available -webkit-fit-available"); 55 testGridDefinitionsSetBadJSValues("-webkit-fit-content -webkit-fit-content", "-w ebkit-fit-available -webkit-fit-available");
56 testGridDefinitionsSetBadJSValues("auto minmax(16px, auto)", "minmax(auto, 15%) 10vw"); 56 testGridDefinitionsSetBadJSValues("auto minmax(16px, auto)", "minmax(auto, 15%) 10vw");
57 // Negative values are not allowed. 57 // Negative values are not allowed.
58 testGridDefinitionsSetBadJSValues("-10px minmax(16px, 32px)", "minmax(10%, 15%) -10vw"); 58 testGridDefinitionsSetBadJSValues("-10px minmax(16px, 32px)", "minmax(10%, 15%) -10vw");
59 testGridDefinitionsSetBadJSValues("10px minmax(16px, -1vw)", "minmax(-1%, 15%) 1 0vw"); 59 testGridDefinitionsSetBadJSValues("10px minmax(16px, -1vw)", "minmax(-1%, 15%) 1 0vw");
60 60
61 function testInherit() 61 function testInherit()
62 { 62 {
63 var parentElement = document.createElement("div"); 63 var parentElement = document.createElement("div");
64 document.body.appendChild(parentElement); 64 document.body.appendChild(parentElement);
65 parentElement.style.gridTemplateColumns = "50px 1fr (last)"; 65 parentElement.style.gridTemplateColumns = "50px 1fr [last]";
66 parentElement.style.gridTemplateRows = "101% (middle) 45px"; 66 parentElement.style.gridTemplateRows = "101% [middle] 45px";
67 testGridDefinitionsValues(parentElement, "50px 1fr (last)", "101% (middle) 4 5px"); 67 testGridDefinitionsValues(parentElement, "50px 1fr [last]", "101% [middle] 4 5px");
68 68
69 element = document.createElement("div"); 69 element = document.createElement("div");
70 parentElement.appendChild(element); 70 parentElement.appendChild(element);
71 element.style.gridTemplateColumns = "inherit"; 71 element.style.gridTemplateColumns = "inherit";
72 element.style.gridTemplateRows = "inherit"; 72 element.style.gridTemplateRows = "inherit";
73 testGridDefinitionsValues(element, "50px 1fr (last)", "101% (middle) 45px"); 73 testGridDefinitionsValues(element, "50px 1fr [last]", "101% [middle] 45px");
74 74
75 document.body.removeChild(parentElement); 75 document.body.removeChild(parentElement);
76 } 76 }
77 debug(""); 77 debug("");
78 debug("Test setting grid-template-columns and grid-template-rows to 'inherit' th rough JS"); 78 debug("Test setting grid-template-columns and grid-template-rows to 'inherit' th rough JS");
79 testInherit(); 79 testInherit();
80 80
81 function testInitial() 81 function testInitial()
82 { 82 {
83 element = document.createElement("div"); 83 element = document.createElement("div");
84 document.body.appendChild(element); 84 document.body.appendChild(element);
85 element.style.gridTemplateColumns = "150% (middle) 55px"; 85 element.style.gridTemplateColumns = "150% [middle] 55px";
86 element.style.gridTemplateRows = "1fr (line) 2fr (line)"; 86 element.style.gridTemplateRows = "1fr [line] 2fr [line]";
87 testGridDefinitionsValues(element, "150% (middle) 55px", "1fr (line) 2fr (li ne)"); 87 testGridDefinitionsValues(element, "150% [middle] 55px", "1fr [line] 2fr [li ne]");
88 88
89 element.style.gridTemplateColumns = "initial"; 89 element.style.gridTemplateColumns = "initial";
90 element.style.gridTemplateRows = "initial"; 90 element.style.gridTemplateRows = "initial";
91 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'none'"); 91 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu mns')", "'none'");
92 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'none'"); 92 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows ')", "'none'");
93 93
94 document.body.removeChild(element); 94 document.body.removeChild(element);
95 } 95 }
96 debug(""); 96 debug("");
97 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th rough JS"); 97 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th rough JS");
98 testInitial(); 98 testInitial();
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js ('k') | Source/core/css/CSSGridLineNamesValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698