summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001.html
blob: 723f3d3090299573b4598b44c8d2a83a25947bb4 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Self-Baseline alignment and sizing cyclic dependency</title>
<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#alignment">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#column-align">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#row-align">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-justify-items">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#baseline-alignment">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-justify-self-baseline">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="../../support/alignment.css">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.inline-grid {
  position: relative;
  border: solid;
  text-orientation: sideways;
  font-family: Ahem;
}

.columns { grid-template-columns: 100px 100px; }
.rows { grid-template-rows: 100px 100px; }

.min-content-columns { grid-template-columns: min-content; }
.max-content-columns { grid-template-columns: max-content; }
.fit-content-columns { grid-template-columns: fit-content; }
.min-content-rows { grid-template-rows: min-content; }
.max-content-rows { grid-template-rows: max-content; }
.fit-content-rows { grid-template-rows: fit-content; }

.flex-columns     { grid-template-columns: 1fr; }
.max-flex-columns { grid-template-columns: minmax(0px, 1fr); }
.flex-rows        { grid-template-rows: 1fr; }
.max-flex-rows    { grid-template-rows: minmax(0px, 1fr); }
.auto-rows        { grid-template-rows: auto 100px; }

.height25  { height: 25px; }
.height50  { height: 50px; }
.height200 { height: 200px; }
.width25   { width: 25px; }
.width50   { width: 50px; }
.width200  { width: 200px; }

.height200Percent { height: 200%; }
.width200Percent  { width: 200%; }
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
  setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { checkLayout('.inline-grid'); })">
<!-- NOTE: previously this test was asserting some "cyclic" behaviour where an item would switch baseline alignment participation - this is no longer the case per spec. -->
<div style="height: 125px">
    <pre>auto-sized rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns">
        <div class="firstRowFirstColumn height50"          data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="50"></div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="100"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="50" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 200px">
    <pre>min-content-sized rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns min-content-rows">
        <div class="firstRowFirstColumn"                   data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="80">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="160"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="80" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 200px">
    <pre>max-content-sized rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns max-content-rows">
        <div class="firstRowFirstColumn"                   data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="80">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="160"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="80" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 200px">
    <pre>fit-content-sized rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns fit-content-rows">
        <div class="firstRowFirstColumn"                   data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="80">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="160"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="80" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 125px">
    <pre>flexible-sized rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns flex-rows">
        <div class="firstRowFirstColumn height50"          data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="50"></div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="100"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="50" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 125px">
    <pre>flex max-function rows - items with relative height</pre>
    <div class="inline-grid alignItemsBaseline columns max-flex-rows">
        <div class="firstRowFirstColumn height50"          data-offset-x="0"   data-offset-y="0"  data-expected-width="100" data-expected-height="50"></div>
        <div class="firstRowSecondColumn height200Percent" data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="100"></div>
        <div class="autoRowAutoColumnSpanning2 height25"   data-offset-x="0"   data-offset-y="50" data-expected-width="200" data-expected-height="25"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>auto-sized columns - items with relative width</pre>
    <div class="inline-grid justifyItemsBaseline rows">
        <div class="firstRowFirstColumn verticalRL width50"          data-offset-x="0"  data-offset-y="0"   data-expected-width="50"  data-expected-height="100"></div>
        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0"  data-offset-y="100" data-expected-width="100" data-expected-height="100"></div>
        <div class="firstRowSpanning2AutoColumn verticalRL width25"  data-offset-x="50" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>min-content-sized columns - items with relative width</pre>
    <div class="inline-grid justifyItemsBaseline rows min-content-columns">
        <div class="firstRowFirstColumn verticalRL"                  data-offset-x="0"  data-offset-y="0"   data-expected-width="80"  data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0"  data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
        <div class="firstRowSpanning2AutoColumn verticalRL width25"  data-offset-x="80" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>max-content-sized columns - items with relative width</pre>
    <div class="inline-grid justifyItemsBaseline rows max-content-columns">
        <div class="firstRowFirstColumn verticalRL"                  data-offset-x="0"  data-offset-y="0"   data-expected-width="80"  data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0"  data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
        <div class="firstRowSpanning2AutoColumn verticalRL width25"  data-offset-x="80" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>fit-content-sized columns - items with relative width</pre>
    <div class="inline-grid justifyItemsBaseline rows fit-content-columns">
        <div class="firstRowFirstColumn verticalRL"                  data-offset-x="0"  data-offset-y="0"   data-expected-width="80"  data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0"  data-offset-y="100" data-expected-width="160" data-expected-height="100"></div>
        <div class="firstRowSpanning2AutoColumn verticalRL width25"  data-offset-x="80" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>flexible-sized columns - items with relative width</pre>
    <div class="inline-grid justifyItemsBaseline rows flex-columns">
        <div class="firstRowFirstColumn verticalRL width50"          data-offset-x="0"  data-offset-y="0"   data-expected-width="50"  data-expected-height="100"></div>
        <div class="secondRowFirstColumn verticalRL width200Percent" data-offset-x="0"  data-offset-y="100" data-expected-width="100" data-expected-height="100"></div>
        <div class="firstRowSpanning2AutoColumn verticalRL width25"  data-offset-x="50" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
    </div>
</div>

<div style="height: 250px">
    <pre>flex max-function columns - items with relative width<br>baseline is not applied initially, but orthogonal items in an auto-sized row force repeating the track sizing and height is not indefinite in that phase.</pre>
    <!-- https://github.com/w3c/csswg-drafts/issues/3046 -->
    <div class="inline-grid justifyItemsBaseline auto-rows max-flex-columns">
        <div class="firstRowFirstColumn verticalLR width50 height50"          data-offset-x="0"   data-offset-y="0"   data-expected-width="50"  data-expected-height="50"></div>
        <div class="secondRowFirstColumn verticalLR width200Percent height50" data-offset-x="0"   data-offset-y="50"  data-expected-width="100" data-expected-height="50"></div>
        <div class="firstRowSpanning2AutoColumn verticalLR width25"           data-offset-x="50"  data-offset-y="0"   data-expected-width="25"  data-expected-height="150"></div>
    </div>
</div>

</body>