summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/abspos/positioned-grid-items-sizing-001.html
blob: 7fb303c0dd0df39d614f8bee8bd003494fcd233c (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
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Positioned grid items sizing</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#abspos" title="9. Absolute Positioning">
<link rel="match" href="positioned-grid-items-sizing-001-ref.html">
<meta name="assert" content="This test checks that the sizing of positioned grid items without specific dimensions or offsets is equivalent to the size of regular items.">
<meta name="flags" content="ahem">
<link href="/css/support/grid.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>

.grid {
  grid: 25px 50px / 100px 60px;
  margin: 1px 2px 3px 4px;
  padding: 6px 3px 9px 12px;
  border: solid;
  border-width: 8px 2px 4px 6px;
  font: 10px/1 Ahem;
  float: left;
  inline-size: 200px;
  block-size: 100px;
  /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
  position: relative;
}

.grid > div {
  position: absolute;
}

</style>

<p>The test passes if it has the same output than the reference.</p>

<div class="grid">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>

<div class="grid directionRTL">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>

<div class="grid verticalLR">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>

<div class="grid verticalLR directionRTL">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>

<div class="grid verticalRL">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>

<div class="grid verticalRL directionRTL">
  <div class="onlyFirstRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlyFirstRowOnlySecondColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlyFirstColumn">XXX XX X XX XXX</div>
  <div class="onlySecondRowOnlySecondColumn">XXX XX X XX XXX</div>
</div>