Bug 1654689 [wpt PR 24703] - grid-template-areas must define at least one cell, a=testonly
authorTab Atkins Jr <jackalmage@gmail.com>
Thu, 30 Jul 2020 13:01:07 +0000
changeset 542750 be29d7106459ce0f37cdfd2af8f130116dbc4133
parent 542749 500076583e336992b903310c32ce1f3c6102166f
child 542751 c86674e2b4ca1fe0a74b246cf33703b71698b586
push id37657
push usernerli@mozilla.com
push dateSat, 01 Aug 2020 09:48:10 +0000
treeherdermozilla-central@750bc4c5c4ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1654689, 24703
milestone81.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1654689 [wpt PR 24703] - grid-template-areas must define at least one cell, a=testonly Automatic update from web-platform-tests grid-template-areas must define at least one cell (#24703) -- wpt-commits: 31bf745dee7797144c8c0144af9ac98395997282 wpt-pr: 24703
testing/web-platform/tests/css/css-grid/parsing/grid-template-areas-one-cell.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-grid/parsing/grid-template-areas-one-cell.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>grid-template-areas must define at least one cell</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=author title="Tab Atkins-Bittner" href="https://www.xanthir.com/contact/">
+<link rel=help href="https://www.w3.org/TR/css-grid-1/#grid-template-areas-property">
+<meta name=assert content="grid-template-areas must define at least one cell to be valid.">
+
+<script>
+function testValidGta(val) {
+  test(()=>{
+    const root = document.children[0];
+    root.style.gridTemplateAreas = "";
+    root.style.gridTemplateAreas = val;
+    assert_not_equals(root.style.gridTemplateAreas, "");
+  }, `"grid-template-areas: ${val};" should be valid.`);
+}
+function testInvalidGta(val) {
+  test(()=>{
+    const root = document.children[0];
+    root.style.gridTemplateAreas = "";
+    root.style.gridTemplateAreas = val;
+    assert_equals(root.style.gridTemplateAreas, "");
+  }, `"grid-template-areas: ${val};" should be invalid.`);
+}
+
+testValidGta("'a'");
+testValidGta("'.'");
+
+testInvalidGta("''");
+testInvalidGta("'' ''");
+testInvalidGta("'$'");
+testInvalidGta("'  '");
+</script>