<!DOCTYPE html>

<title>CSS Flexbox: Definite main sizes</title>

<style>
.rect {
  width: 50px;
  height: 50px;
  background-color: green;
}

.flexbox {
  border: 3px solid black;
}

.flexbox > div > div {
  overflow: hidden;
}

</style>

<link rel="stylesheet" href="resources/flexbox.css">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#definite-sizes">
<link rel="author" title="Google Inc." href="https://www.google.com/">

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

<body onload="checkLayout('.flexbox')" style="height: 800px;">
<div id=log></div>

<p>Simple case of percentage resolution:</p>
<div class="flexbox" style="width: 300px;">
  <div class="flex-one" data-expected-width="250">
    <div style="width: 50%;" data-expected-width="125">
      <div class="rect"></div>
    </div>
  </div>
  <div class="rect flex-none"></div>
</div>

<p>auto flex-basis. However, as this is a width, we follow regular width
rules and resolve the percentage:</p>
<div class="flexbox" style="width: 300px;">
  <div data-expected-width="50">
    <div style="width: 50%;" data-expected-width="25">
      <div class="rect"></div>
    </div>
  </div>
  <div class="rect flex-none"></div>
</div>

<p>Simple case of percentage resolution, columns:</p>
<div class="flexbox column" style="height: 300px;">
  <div class="flex-one" data-expected-height="250">
    <div style="height: 50%;" data-expected-height="125">
      <div class="rect"></div>
    </div>
  </div>
  <div class="rect flex-none"></div>
</div>

<p>auto flex-basis. This is still definite.</p>
<div class="flexbox column" style="height: 300px;">
  <div data-expected-height="50">
    <div style="height: 50%;" data-expected-height="25">
      <div class="rect"></div>
    </div>
  </div>
  <div class="rect flex-none"></div>
</div>
