summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003.html
blob: d50263320ce2fd7e5448648c08e7d0a044978488 (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
<!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">
<!-- https://github.com/w3c/csswg-drafts/issues/3046 -->
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.grid {
  position: relative;
  display: inline-grid;
  background: grey;
  text-orientation: sideways;
  font-family: Ahem;
}
.row { grid: minmax(0px, 1fr) / auto 50px 100px }
.column { grid: auto 50px 100px / minmax(0px, 1fr); }
.item1 {
   font-size: 30px;
   background: blue;
}
.item2 {
  font-size: 20px;
  background: red;
}
.item3 {
  font-size: 80px;
  background: green;
}
.height50 { height: 50px; }
.relativeHeight { height: 50%; }
.relativeWidth  { width: 50%; }
</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('.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. -->
<pre>flex row</pre>
<div class="grid row alignItemsBaseline">
  <div class="item1 verticalLR" data-offset-x="0"   data-offset-y="34" data-expected-width="30"  data-expected-height="30">É</div>
  <div class="item2"            data-offset-x="30"  data-offset-y="48" data-expected-width="50"  data-expected-height="20">É</div>
  <div class="item3"            data-offset-x="80" data-offset-y="0"  data-expected-width="100" data-expected-height="80">É</div>
</div>

<pre>flex row</pre>
<div class="grid row alignItemsBaseline">
  <div class="item1 relativeHeight" data-offset-x="0"   data-offset-y="56" data-expected-width="30"  data-expected-height="43">É</div>
  <div class="item2"                data-offset-x="30"  data-offset-y="64" data-expected-width="50"  data-expected-height="20">É</div>
  <div class="item3 verticalLR"     data-offset-x="80" data-offset-y="0"  data-expected-width="100" data-expected-height="80">É</div>
</div>

<pre>flex row</pre>
<div class="grid row alignItemsBaseline">
  <div class="item1 relativeHeight" data-offset-x="0"   data-offset-y="40" data-expected-width="30"  data-expected-height="40">É</div>
  <div class="item2 verticalLR"     data-offset-x="30"  data-offset-y="44" data-expected-width="50"  data-expected-height="20">É</div>
  <div class="item3"                data-offset-x="80" data-offset-y="0"  data-expected-width="100" data-expected-height="80">É</div>
</div>

<pre>flex column - all items share a baseline group</pre>
<div class="grid column justifyItemsBaseline">
  <div class="item1"            data-offset-x="16" data-offset-y="0"   data-expected-width="30" data-expected-height="30">É</div>
  <div class="item2 verticalLR" data-offset-x="12" data-offset-y="30"  data-expected-width="20" data-expected-height="50">É</div>
  <div class="item3 verticalLR" data-offset-x="0"  data-offset-y="80" data-expected-width="80" data-expected-height="100">É</div>
</div>

<pre>flex column - all items share a baseline group</pre>
<div class="grid column justifyItemsBaseline">
  <div class="item1 relativeWidth height50" data-offset-x="0" data-offset-y="0"   data-expected-width="40" data-expected-height="50">É</div>
  <div class="item2 verticalLR"             data-offset-x="12" data-offset-y="50"  data-expected-width="20" data-expected-height="50">É</div>
  <div class="item3 verticalLR"             data-offset-x="0"  data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div>
</div>

<pre>flex column - all items share a baseline group</pre>
<div class="grid column justifyItemsBaseline">
  <div class="item1 relativeWidth height50" data-offset-x="0" data-offset-y="0"   data-expected-width="40" data-expected-height="50">É</div>
  <div class="item2"                        data-offset-x="16" data-offset-y="50"  data-expected-width="20" data-expected-height="50">É</div>
  <div class="item3 verticalLR"             data-offset-x="0"  data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div>
</div>

</body>