File: grid-area-computed.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 (78 lines) | stat: -rw-r--r-- 3,023 bytes parent folder | download | duplicates (8)
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
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Grid Layout Test: getComputedStyle().gridArea</title>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#placement">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
  #container {
    container-type: inline-size;
    width: 100px;
  }
</style>
</head>
<body>
<div id="container">
  <div id="target"></div>
</div>
<script>
// auto
test_computed_value("grid-area", "auto / auto / auto / auto",
                    ["auto", "auto / auto / auto / auto"]);
test_computed_value("grid-row", "auto / auto", ["auto", "auto / auto"]);
test_computed_value("grid-column-end", "auto");

// <custom-ident>
test_computed_value("grid-row", "-zπ", [ "-zπ", "-zπ / -zπ"]);
test_computed_value("grid-row-start", "AZ");
test_computed_value("grid-column-start", "-_π");
test_computed_value("grid-row-end", "_9");


// <integer> && <custom-ident>?
test_computed_value("grid-area", "1 / 90 -a- / auto / auto",
                    ["1 / 90 -a-", "1 / 90 -a- / auto / auto"]);
test_computed_value("grid-row", "2 az / auto", ["2 az", "2 az / auto"]);
test_computed_value("grid-column", "9 / -19 zA");
test_computed_value("grid-row-start", "-19");
test_computed_value("grid-row-start", "9 -Z_");
test_computed_value("grid-column-start", "-44 Z");
test_computed_value("grid-row-end", "1 -πA");
test_computed_value("grid-column-end", "5 π_");
test_computed_value("grid-row-start", "calc(1.1) -a-", "1 -a-");
test_computed_value("grid-row-start", "calc(10) -a-", "10 -a-");
test_computed_value("grid-row-start", "calc(10 + (sign(2cqw - 10px) * 5)) -a-", "5 -a-");

// span && [ <integer> || <custom-ident> ]
test_computed_value("grid-area", "span 2 i / auto / auto / auto",
                    ["span 2 i", "span 2 i / auto / auto / auto"]);
test_computed_value("grid-row", "span 2 / auto", ["span 2", "span 2 / auto"]);
test_computed_value("grid-column-start", "span 1 i", "span i");
test_computed_value("grid-row-start", "span 1");
test_computed_value("grid-row-end", "span 2 i");
test_computed_value("grid-column-end", "span 2");

// https://github.com/w3c/csswg-drafts/issues/3448
test_computed_value("grid-row-start", "span i");
test_computed_value("grid-row", "span i / auto", ["span i", "span i / auto"]);

// <grid-line> [ / <grid-line> ]{0,3}
test_computed_value("grid-area", "auto / i / auto / i",
                    ["auto / i", "auto / i / auto / i"]);
test_computed_value("grid-area", "auto / i / 2 j",
                    ["auto / i / 2 j", "auto / i / 2 j / i"]);
test_computed_value("grid-area", "auto / i / 2 j / span 3 k");
test_computed_value("grid-row", "auto / i");
test_computed_value("grid-column", "2 j / span 3 k");


// https://github.com/w3c/csswg-drafts/issues/2858
test_computed_value("grid-column-end",  "\\31st", "\\31 st");
test_computed_value("grid-column-end",  "\\31 st", "\\31 st");

</script>
</body>
</html>