chromium/third_party/blink/web_tests/external/wpt/css/css-grid/grid-model/grid-computed-value-display-floated-items-001.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: 'float' affects to the computed value of 'display' on grid items</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-containers" title="3.1 Establishing Grid Containers">
<link rel="help" href="http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo" title="9.7 Relationships between 'display', 'position', and 'float'">
<meta name="flags" content="dom">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
  #grid {
    display: grid;
  }

  #inline-grid {
    display: inline-grid;
  }

  .inline-table {
    display: inline-table;
  }

  .inline {
    display: inline;
  }

  .flex {
    display: flex;
  }

  .float {
    float: left;
  }
</style>
<div id="log"></div>

<div id="grid">
  <div id="grid-inline-table" class="float inline-table"></div>
  <div id="grid-inline" class="float inline"></div>
  <div id="grid-flex" class="float flex"></div>
</div>
<div id="inline-grid">
  <div id="inline-grid-inline-table" class="float inline-table"></div>
  <div id="inline-grid-inline" class="float inline"></div>
  <div id="inline-grid-flex" class="float flex"></div>
</div>

<script>
  function testComputedStyleDisplay(element, value) {
    assert_equals(getComputedStyle(element).getPropertyValue("display"), value, "getComputedStyle() display should be '" + value + "'");
  }

  var gridInlineTable = document.getElementById("grid-inline-table");
  test(function() {
      testComputedStyleDisplay(gridInlineTable, "table");
    }, "Test display floated 'inline-table' grid item");

  var gridInline = document.getElementById("grid-inline");
  test(function() {
      testComputedStyleDisplay(gridInline, "block");
    }, "Test display floated 'inline' grid item");

  var gridFlex = document.getElementById("grid-flex");
  test(function() {
      testComputedStyleDisplay(gridFlex, "flex");
    }, "Test display floated 'flex' grid item");

  var inlineGridInlineTable = document.getElementById("inline-grid-inline-table");
  test(function() {
      testComputedStyleDisplay(inlineGridInlineTable, "table");
    }, "Test display floated 'inline-table' grid item within an inline grid");

  var inlineGridInline = document.getElementById("inline-grid-inline");
  test(function() {
      testComputedStyleDisplay(inlineGridInline, "block");
    }, "Test display floated 'inline' grid item within an inline grid");

  var inlineGridFlex = document.getElementById("inline-grid-flex");
  test(function() {
      testComputedStyleDisplay(inlineGridFlex, "flex");
    }, "Test display floated 'flex' grid item within an inline grid");
</script>