File: grid-template-shorthand.html

package info (click to toggle)
thunderbird 1%3A143.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,703,968 kB
  • sloc: cpp: 7,770,492; javascript: 5,943,842; ansic: 3,918,754; python: 1,418,263; xml: 653,354; asm: 474,045; java: 183,079; sh: 111,238; makefile: 20,410; perl: 14,359; objc: 13,059; yacc: 4,583; pascal: 3,405; lex: 1,720; ruby: 999; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 69; csh: 10
file content (72 lines) | stat: -rw-r--r-- 2,753 bytes parent folder | download | duplicates (7)
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>
<html>
<head>
<meta charset="utf-8">
<title>CSS Grid Layout Test: grid-template sets longhands</title>
<link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template">
<meta name="assert" content="grid-template supports the full grammar 'none | [ <grid-template-rows> / <grid-template-columns> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/shorthand-testcommon.js"></script>
</head>
<body>
<script>
test_shorthand_value('grid-template', 'none', {
  'grid-template-rows': 'none',
  'grid-template-columns': 'none',
  'grid-template-areas': 'none'
});

// <grid-template-rows> / <grid-template-columns>
test_shorthand_value('grid-template', '10px / 20%', {
  'grid-template-rows': '10px',
  'grid-template-columns': '20%',
  'grid-template-areas': 'none'
});

test_shorthand_value('grid-template', 'fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))', {
  'grid-template-rows': 'fit-content(calc(-0.5em + 10px))',
  'grid-template-columns': 'fit-content(calc(0.5em + 10px))',
  'grid-template-areas': 'none'
});

// [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?
test_shorthand_value('grid-template',
                     '[header-top] "a a a"     [header-bottom]' +
                     '  [main-top] "b b b" 1fr [main-bottom]' +
                     '           / auto 1fr auto', {
  'grid-template-rows': '[header-top] auto [header-bottom main-top] 1fr [main-bottom]',
  'grid-template-columns': 'auto 1fr auto',
  'grid-template-areas': '"a a a" "b b b"'
});

test_shorthand_value('grid-template',
                     '  "a a a"' +
                     '  "b b b" 1fr' +
                     '/ auto 1fr auto', {
  'grid-template-rows': 'auto 1fr',
  'grid-template-columns': 'auto 1fr auto',
  'grid-template-areas': '"a a a" "b b b"'
});

test_shorthand_value('grid-template',
                     ' [] "a a a"     []' +
                     ' [] "b b b" 1fr []' +
                     '  / [] auto 1fr [] auto []', {
  'grid-template-rows': 'auto 1fr',
  'grid-template-columns': 'auto 1fr auto',
  'grid-template-areas': '"a a a" "b b b"'
});

test_shorthand_value('grid-template',
                     ' [] "a a a"     []' +
                     ' [] "b b b" 1fr []' +
                     ' "c c c" / [] auto 1fr [] auto []', {
  'grid-template-rows': 'auto 1fr auto',
  'grid-template-columns': 'auto 1fr auto',
  'grid-template-areas': '"a a a" "b b b" "c c c"'
});
</script>
</body>
</html>