<!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>
