Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/grid-lanes/tentative/track-sizing/auto-repeat/intrinsic-auto-repeat/column-auto-repeat-auto-016.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<title>Auto-fit repeat tracks with auto size and auto/explicit item placement</title>
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.grid-lanes {
display: grid-lanes;
item-tolerance: 0;
grid-template-columns: repeat(auto-fit, auto);
height: 200px;
width: 1000px;
}
.grid-lanes > div {
width: 100px;
height: 100px;
}
</style>
<div class="grid-lanes">
<div></div>
<div></div>
<div style="grid-column: 4"></div>
<div style="grid-column: 6"></div>
<div></div>
</div>
<script>
test(function() {
const container = document.querySelector('.grid-lanes');
const computedStyle = window.getComputedStyle(container);
// These don't end up being 100px because auto tracks get stretched at the end of
// track sizing.
assert_equals(computedStyle.getPropertyValue('grid-template-columns'),
"200px 200px 200px 200px 0px 200px 0px 0px 0px 0px");
});
</script>
</html>