grid-template-areas-one-cell.html (1160B)
1 <!doctype html> 2 <title>grid-template-areas must define at least one cell</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel=author title="Tab Atkins-Bittner" href="https://www.xanthir.com/contact/"> 6 <link rel=help href="https://www.w3.org/TR/css-grid-1/#grid-template-areas-property"> 7 <meta name=assert content="grid-template-areas must define at least one cell to be valid."> 8 9 <script> 10 function testValidGta(val) { 11 test(()=>{ 12 const root = document.children[0]; 13 root.style.gridTemplateAreas = ""; 14 root.style.gridTemplateAreas = val; 15 assert_not_equals(root.style.gridTemplateAreas, ""); 16 }, `"grid-template-areas: ${val};" should be valid.`); 17 } 18 function testInvalidGta(val) { 19 test(()=>{ 20 const root = document.children[0]; 21 root.style.gridTemplateAreas = ""; 22 root.style.gridTemplateAreas = val; 23 assert_equals(root.style.gridTemplateAreas, ""); 24 }, `"grid-template-areas: ${val};" should be invalid.`); 25 } 26 27 testValidGta("'a'"); 28 testValidGta("'.'"); 29 30 testInvalidGta("''"); 31 testInvalidGta("'' ''"); 32 testInvalidGta("'$'"); 33 testInvalidGta("' '"); 34 </script>