wpt / css / css-grid / grid-lanes / subgrid / grid-subgridded-to-grid-lanes / gap / column-subgrid-grid-gap-015.html

Status: FAIL | Duration: 10ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-grid/grid-lanes/subgrid/grid-subgridded-to-grid-lanes/gap/column-subgrid-grid-gap-015.html

<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Lanes Test: nested empty column-direction subgrid propagates parent gutter delta</title>
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-3/#subgrids">
<link rel="match" href="column-subgrid-grid-gap-015-ref.html">
<style>
html,body { color:black; background-color:white; padding:0; margin:0; }

.grid-lanes {
  display:inline-grid-lanes;
  grid-template-columns:auto auto auto auto;
  border:1px solid;
  background:yellow;
}

.subgrid {
  display:grid;
  grid-template-columns:subgrid;
  min-height:30px;
}
</style>
</head>
<body>
<!--
  Each track ends up 95px wide. The nested subgrid spans 2 tracks and is
  auto-placed, so its largest possible per-track contribution is broadcast
  to every track of the grid-lanes container. For a span-2 auto-placed
  subgrid that contribution is the max of its two edge contributions, where
  each edge sums that side's accumulated margin with half of the propagated
  column-gap delta. Here the start edge gives 10 (outer margin-left) +
  50 (half of the 100 column-gap delta) = 60, and the end edge gives 45
  (inner margin-right 20 + half of the outer 50 column-gap) +
  50 = 95. The end edge wins, so every track grows to 95px.
-->
<div class="grid-lanes">
  <div class="subgrid" style="margin-left: 10px; column-gap:50px; grid-column:span 3; background:cyan;">
    <div class="subgrid" style="margin-right: 20px;column-gap:100px;grid-column:span 2; background:magenta;"></div>
  </div>
</div>
</body>
</html>

/css/css-grid/grid-lanes/subgrid/grid-subgridded-to-grid-lanes/gap/column-subgrid-grid-gap-015-ref.html

<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<style>
html,body { color:black; background-color:white; padding:0; margin:0; }

.grid {
  display:inline-grid;
  grid-template-columns:95px 95px 95px 95px;
  border:1px solid;
  background:yellow;
}

.subgrid {
  display:grid;
  grid-template-columns:subgrid;
  min-height:30px;
}
</style>
</head>
<body>
<div class="grid">
  <div class="subgrid" style="margin-left: 10px; column-gap:50px; grid-column:span 3; background:cyan;">
    <div class="subgrid" style="margin-right: 20px;column-gap:100px;grid-column:span 2; background:magenta;"></div>
  </div>
</div>
</body>
</html>