chromium/third_party/blink/web_tests/css3/flexbox/flex-justify-content.html

<!DOCTYPE html>
<html>
<style>
body {
    margin: 0;
}
.flexbox {
    width: 600px;
    display: flex;
    background-color: #aaa;
    position: relative;
}
.flexbox div {
    height: 20px;
    border: 0;
    flex: none;
}

.flexbox :nth-child(1) {
    background-color: blue;
}
.flexbox :nth-child(2) {
    background-color: green;
}
.flexbox :nth-child(3) {
    background-color: red;
}
</style>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<div id=log></div>
<div class="flexbox">
  <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="100" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="200" style="width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: flex-end">
  <div data-expected-width="100" data-offset-x="300" style="flex: 0 0 100px;"></div>
  <div data-expected-width="100" data-offset-x="400" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: center">
  <div data-expected-width="100" data-offset-x="150" style="flex: 1 0 0; max-width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="350" style="width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: center">
  <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
</div>

<!-- True centering on overflow. -->
<div class="flexbox" style="justify-content: center">
  <div data-expected-width="800" data-offset-x="-100" style="width: 800px;"></div>
</div>

<div class="flexbox" style="justify-content: space-between">
  <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: space-between">
  <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
</div>

<!-- If there's only one child, we justify-content: flex-start. -->
<div class="flexbox" style="justify-content: space-between">
  <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: space-around">
  <div data-expected-width="100" data-offset-x="50" style="flex: 1 0 0; max-width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="450" style="width: 100px;"></div>
</div>

<!-- If there's only one child, we justify-content center. -->
<div class="flexbox" style="justify-content: space-around">
  <div data-expected-width="100" data-offset-x="250" style="flex: 1 0 0; max-width: 100px;"></div>
</div>

<!-- Safe centering on overflow. -->
<div class="flexbox" style="justify-content: space-around">
  <div data-expected-width="800" data-offset-x="0" style="width: 800px;"></div>
</div>

<!-- Make sure we don't crash with no children. -->
<div class="flexbox" style="justify-content: space-around"></div>

<div class="flexbox" style="justify-content: space-evenly">
  <div data-expected-width="100" data-offset-x="75" style="flex: 1 0 0; max-width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="425" style="width: 100px;"></div>
</div>

<div class="flexbox" style="justify-content: space-evenly">
  <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
  <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
</div>

<!-- If there's only one child, we justify-content: center. -->
<div class="flexbox" style="justify-content: space-evenly">
  <div data-expected-width="100" data-offset-x="250" style="flex: 1 0 0; max-width: 100px;"></div>
</div>

<!-- Safe centering on overflow. -->
<div class="flexbox" style="justify-content: space-evenly">
  <div data-expected-width="800" data-offset-x="0" style="width: 800px;"></div>
</div>

<!-- Make sure we don't crash with no children. -->
<div class="flexbox" style="justify-content: space-evenly"></div>

<!-- margin:auto applies before justify-content. -->
<div class="flexbox" style="justify-content: flex-end">
  <div data-expected-width="100" data-offset-x="0" style="width: 100px;"></div>
  <div data-expected-width="100" data-offset-x="100" style="width: 100px; margin-right: auto"></div>
  <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
</div>

<!-- The justify-content does nothing here because we are shrinking. -->
<div class="flexbox" style="justify-content: flex-end">
  <div data-expected-width="200" data-offset-x="0" style="flex: 0 1 300px;"></div>
  <div data-expected-width="200" data-offset-x="200" style="width: 200px;"></div>
  <div data-expected-width="200" data-offset-x="400" style="width: 200px;"></div>
</div>

<!-- We overflow the flexbox (no negative flexing) and align the end. The overflow is to the left. -->
<div class="flexbox" style="justify-content: flex-end">
  <div data-expected-width="300" data-offset-x="-100" style="flex: 1 0 300px;"></div>
  <div data-expected-width="200" data-offset-x="200" style="width: 200px;"></div>
  <div data-expected-width="200" data-offset-x="400" style="width: 200px;"></div>
</div>

</body>
</html>