Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Grid item with a fixed max-width is clamped by it.</title>
<link rel="author" title="Yulun Wu" href="mailto:yulun_wu@apple.com">
<meta name="assert" content="A grid item with an automatic inline size which is stretched into its grid area is clamped by its fixed max-width, so its used inline size is the max-width rather than the inline size of the grid area.">
<link rel="stylesheet" href="/css/support/grid.css">
<style>
.grid {
grid-template-columns: 100px;
/* Layout-preserving: keeps the grid on the modern grid path. */
justify-items: normal;
}
.item {
max-width: 50px;
height: 50px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.grid')">
<div id="log"></div>
<div class="grid">
<div class="item" data-expected-width="50"></div>
</div>
</body>