summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/grid-definition/flex-factor-sum-less-than-1-001.html
blob: ad7af2d84640ab626cf783e65a2da78a137d48c6 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<title>CSS Grid Layout Test: flex factor sum smaller than 1.</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid/#algo-find-fr-size">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#fr-unit">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=520477">
<link rel="stylesheet" href="/css/support/grid.css">
<meta name="assert" content="Test that resolving auto tracks on grid items works properly even when the flex factor sum is less than 1." />

<style>
.onlyColumnFractionFlexFactors {
    grid-template-columns: minmax(0, 0.1fr) minmax(0, 0.2fr) minmax(0, 0.3fr);
    grid-template-rows: 50px;
    width: 100px;
}
.onlyRowFractionFlexFactors {
    grid-template-columns: 50px;
    grid-template-rows: minmax(0, 0.1fr) minmax(0, 0.2fr) minmax(0, 0.3fr);
    width: 50px;
    height: 100px;
}
.fixedAndfractionFlexFactors {
    grid-template-columns: 50px minmax(0, 0.2fr) 30px;
    grid-template-rows: minmax(0, 0.1fr) 50px minmax(0, 0.3fr);
    width: 100px;
    height: 100px;
}
.zeroValueFlexFactor {
    grid-template-columns: .0fr .2fr .3fr;
    grid-template-rows: 50px;
    width: 100px;
}
.firstRowThirdColumn {
    background-color: yellow;
    grid-column: 3;
    grid-row: 1;
}
.secondRowThirdColumn {
    background-color: yellow;
    grid-column: 3;
    grid-row: 2;
}
.thirdRowFirstColumn {
    background-color: brown;
    grid-column: 1;
    grid-row: 3;
}
.thirdRowThirdColumn {
    background-color: magenta;
    grid-column: 3;
    grid-row: 3;
}
</style>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>

<body onload="checkLayout('.grid');">

<div style="position: relative;">
    <div class="grid onlyColumnFractionFlexFactors">
        <div class="firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
        <div class="firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div>
        <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="50"></div>
    </div>
</div>

<div style="position: relative;">
    <div class="grid onlyRowFractionFlexFactors">
        <div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
        <div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
        <div class="thirdRowFirstColumn" data-expected-width="50" data-expected-height="30"></div>
    </div>
</div>

<div style="position: relative;">
    <div class="grid zeroValueFlexFactor">
        <div class="firstRowFirstColumn" data-expected-width="0" data-expected-height="50"></div>
        <div class="firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div>
        <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="50"></div>
    </div>
</div>

<div style="position: relative;">
    <div class="grid fixedAndfractionFlexFactors">
        <div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="5"></div>
        <div class="firstRowSecondColumn" data-expected-width="4" data-expected-height="5"></div>
        <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="5"></div>
        <div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
        <div class="secondRowSecondColumn" data-expected-width="4" data-expected-height="50"></div>
        <div class="secondRowThirdColumn" data-expected-width="30" data-expected-height="50"></div>
        <div class="thirdRowFirstColumn" data-expected-width="50" data-expected-height="15"></div>
        <div class="thirdRowSecondColumn" data-expected-width="4" data-expected-height="15"></div>
        <div class="thirdRowThirdColumn" data-expected-width="30" data-expected-height="15"></div>
    </div>
</div>

</body>
</html>