summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/grid-definition/grid-inline-support-grid-template-areas-001.html
blob: 1573fa496f62335048050f6ee8168d31dce71329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Support for 'grid-template-ares' property within an inline grid</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-template-areas-property" title="5.2 Named Areas: the 'grid-template-areas' property">
<meta name="flags" content="ahem dom">
<meta name="assert" content="This test checks that 'grid-template-areas' is supported in an inline grid. So you can define the grid structure.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/testing-utils.js"></script>
<style>
  #inline-grid {
    display: inline-grid;
  }
</style>
<div id="log"></div>

<div id="inline-grid"></div>

<script>
  // Single values.
  TestingUtils.testGridTemplateAreas('inline-grid', 'none', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a"', '"a"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"."', '"."');
  TestingUtils.testGridTemplateAreas('inline-grid', '"lower UPPER 10 -minus _low 1-st ©copy_right line¶"', '"lower UPPER 10 -minus _low 1-st ©copy_right line¶"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b"', '"a b"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" "c d"', '"a b" "c d"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a   b"   "c   d"', ['"a b" "c d"', '"a   b" "c   d"']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b""c d"', '"a b" "c d"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b"\t"c d"', '"a b" "c d"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b"\n"c d"', '"a b" "c d"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" "a b"', '"a b" "a b"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a a" "b b"', '"a a" "b b"');
  TestingUtils.testGridTemplateAreas('inline-grid', '". a ." "b a c"', '". a ." "b a c"');
  TestingUtils.testGridTemplateAreas('inline-grid', '".. a ..." "b a c"', ['". a ." "b a c"', '".. a ..." "b a c"']);
  TestingUtils.testGridTemplateAreas('inline-grid', '".a..." "b a c"', ['". a ." "b a c"', '".a..." "b a c"']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"head head" "nav main" "foot ."', '"head head" "nav main" "foot ."');
  TestingUtils.testGridTemplateAreas('inline-grid', '"head head" "nav main" "foot ...."', ['"head head" "nav main" "foot ."', '"head head" "nav main" "foot ...."']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"head head" "nav main" "foot."', ['"head head" "nav main" "foot ."', '"head head" "nav main" "foot."']);
  TestingUtils.testGridTemplateAreas('inline-grid', '". header header ." "nav main main main" "nav footer footer ."', '". header header ." "nav main main main" "nav footer footer ."');
  TestingUtils.testGridTemplateAreas('inline-grid', '"... header header ...." "nav main main main" "nav footer footer ...."', ['". header header ." "nav main main main" "nav footer footer ."', '"... header header ...." "nav main main main" "nav footer footer ...."']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"...header header...." "nav main main main" "nav footer footer...."', ['". header header ." "nav main main main" "nav footer footer ."', '"...header header...." "nav main main main" "nav footer footer...."']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"title stats" "score stats" "board board" "ctrls ctrls"', '"title stats" "score stats" "board board" "ctrls ctrls"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"title board" "stats board" "score ctrls"', '"title board" "stats board" "score ctrls"');
  TestingUtils.testGridTemplateAreas('inline-grid', '". a" "b a" ". a"', '". a" "b a" ". a"');
  TestingUtils.testGridTemplateAreas('inline-grid', '".. a" "b a" "... a"', ['". a" "b a" ". a"', '".. a" "b a" "... a"']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"..a" "b a" ".a"', ['". a" "b a" ". a"', '"..a" "b a" ".a"']);
  TestingUtils.testGridTemplateAreas('inline-grid', '"a a a" "b b b"', '"a a a" "b b b"');
  TestingUtils.testGridTemplateAreas('inline-grid', '". ." "a a"', '". ." "a a"');
  TestingUtils.testGridTemplateAreas('inline-grid', '"... ...." "a a"', ['". ." "a a"', '"... ...." "a a"']);

  // Reset values.
  document.getElementById('inline-grid').style.gridTemplateAreas = '';

  // Wrong values.
  TestingUtils.testGridTemplateAreas('inline-grid', 'a', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a" "b c"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" "c" "d e"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b c" "d e"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b"-"c d"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" - "c d"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" . "c d"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b a"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a" "b" "a"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" "b b"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"b a" "b b"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a b" "b a"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"a ." ". a"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '","', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"10%"', 'none');
  TestingUtils.testGridTemplateAreas('inline-grid', '"USD$"', 'none');
</script>