Fixing a crash and adding more test cases to 'grid' shorthand

This CL fixes a crash that happened when the auto-flow values did not
exist. More test cases were added to grid-shorthand-valid.html and
grid-shorthand-invalid.html to validate the behavior.

Bug: 1028283, 1286308
Change-Id: Ic4b126298d5d7a5ff1f5290e086266126ffb664e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3379475
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Ana Sollano Kim <ansollan@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#958139}
diff --git a/css/css-grid/parsing/grid-shorthand-invalid.html b/css/css-grid/parsing/grid-shorthand-invalid.html
index 653b519..cdcbb4c 100644
--- a/css/css-grid/parsing/grid-shorthand-invalid.html
+++ b/css/css-grid/parsing/grid-shorthand-invalid.html
@@ -43,7 +43,9 @@
 test_invalid_value("grid", 'none / "a" []');
 test_invalid_value("grid", 'none / "a" [] 10px');
 test_invalid_value("grid", 'auto-flow 100px');
-
+test_invalid_value("grid", 'auto-flow / auto-flow');
+test_invalid_value("grid", 'auto-flow 1fr / auto-flow 1fr');
+test_invalid_value("grid", 'dense auto-flow / dense auto-flow');
 // FIXME: add more values to test full syntax
 
 </script>
diff --git a/css/css-grid/parsing/grid-shorthand-valid.html b/css/css-grid/parsing/grid-shorthand-valid.html
index 75f98da..8d546a8 100644
--- a/css/css-grid/parsing/grid-shorthand-valid.html
+++ b/css/css-grid/parsing/grid-shorthand-valid.html
@@ -54,12 +54,15 @@
 test_valid_value("grid", '"a" "a" [a] [a] "b" / auto', '"a" "a" [a a] "b" / auto');
 test_valid_value("grid", '100px / auto-flow dense 100px');
 test_valid_value("grid", 'auto-flow dense 1fr / 100px');
+test_valid_value("grid", '100px / dense auto-flow 100px', '100px / auto-flow dense 100px');
+test_valid_value("grid", 'dense auto-flow 1fr / 100px', 'auto-flow dense 1fr / 100px');
 test_valid_value("grid", '100px / auto-flow 100px');
 test_valid_value("grid", 'auto-flow 1fr / 100px');
 test_valid_value("grid", 'none / auto-flow 100px');
 test_valid_value("grid", 'auto-flow 1fr / none');
 test_valid_value("grid", 'auto / auto-flow 100px');
 test_valid_value("grid", 'auto-flow 1fr / auto');
+test_valid_value("grid", '1fr / 1fr');
 
 // FIXME: add more values to test full syntax