<!DOCTYPE html>
<title>CSS Grid: indefinite grid container and percentage columns.</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"/>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#valdef-grid-template-columns-length-percentage"/>
<meta name="assert" content="Checks that percentage columns are only indefinite during intrinsic size computation. Aftewards, they are properly resolved against the grid container intrinsic sizes."/>
<link rel="issue" href="https://crbug.com/616716"/>
<link rel="stylesheet" href="/css/support/grid.css"/>
<link rel="stylesheet" href="/css/support/width-keyword-classes.css"/>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"/>
<style>
.wrapper {
    position: relative;
    clear: both;
}

.grid {
    font: 10px/1 Ahem;
}

.float {
    float: left;
}

.abspos {
    position: absolute;
}

.fixedSize {
    width: 200px;
    height: 200px;
}

.oneColumn100 {
    grid-template-columns: 100%;
}

.oneColumn50 {
    grid-template-columns: 50%;
}

.twoColumns {
    grid-template-columns: 50% 100px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
    setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">
<div id="log"></div>
<div class="wrapper">
    <div class="grid float oneColumn100" data-expected-width="40" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid abspos oneColumn100" data-expected-width="40" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid max-content oneColumn100" data-expected-width="40" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid fit-content oneColumn100" data-expected-width="40" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid min-content oneColumn100" data-expected-width="20" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid float oneColumn50" data-expected-width="40" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid abspos oneColumn50" data-expected-width="40" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid max-content oneColumn50" data-expected-width="40" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid fit-content oneColumn50" data-expected-width="40" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid min-content oneColumn50" data-expected-width="20" data-expected-height="20">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="20">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid float twoColumns" data-expected-width="140" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="70" data-expected-height="10">
            XX X
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="70" data-offset-y="0" data-expected-width="100" data-expected-height="10">
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid abspos twoColumns" data-expected-width="140" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="70" data-expected-height="10">
            XX X
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="70" data-offset-y="0" data-expected-width="100" data-expected-height="10">
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid max-content twoColumns" data-expected-width="140" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="70" data-expected-height="10">
            XX X
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="70" data-offset-y="0" data-expected-width="100" data-expected-height="10">
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid fit-content twoColumns" data-expected-width="140" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="70" data-expected-height="10">
            XX X
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="70" data-offset-y="0" data-expected-width="100" data-expected-height="10">
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid min-content twoColumns" data-expected-width="120" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="60" data-expected-height="10">
            XX X
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="60" data-offset-y="0" data-expected-width="100" data-expected-height="10">
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid float twoColumns" data-expected-width="100" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="10">
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid abspos twoColumns" data-expected-width="100" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="10">
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid max-content twoColumns" data-expected-width="100" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="10">
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid min-content twoColumns" data-expected-width="100" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="10">
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="10">
            XX X
        </div>
    </div>
</div>

<div class="wrapper">
    <div class="grid fit-content twoColumns" data-expected-width="100" data-expected-height="10">
        <div class="firstRowFirstColumn"
            data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="10">
        </div>
        <div class="firstRowSecondColumn"
            data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="10">
            XX X
        </div>
    </div>
</div>
</body>
