4 <link href=
"resources/grid.css" rel=
"stylesheet">
5 <script src=
"../../resources/check-layout.js"></script>
8 grid-template-columns: min-content
1fr;
9 grid-template-rows: min-content;
15 function shrinkToFitTest()
18 reduceContainerWidthAndCheckLayout();
20 restoreContainerWidthAndCheckLayout();
24 function reduceContainerWidthAndCheckLayout()
26 var grid
= document
.getElementById("grid")
27 grid
.style
.width
= "250px";
28 grid
.setAttribute("data-expected-width", "250");
29 grid
.setAttribute("data-expected-height", "300");
31 var cell1
= document
.getElementById("cell1")
32 cell1
.setAttribute("data-expected-width", "80");
33 cell1
.setAttribute("data-expected-height", "300");
35 var cell2
= document
.getElementById("cell2")
36 cell2
.setAttribute("data-expected-width", "170");
37 cell2
.setAttribute("data-expected-height", "300");
40 function restoreContainerWidthAndCheckLayout()
42 var grid
= document
.getElementById("grid")
43 grid
.style
.width
= "500px";
44 grid
.setAttribute("data-expected-width", "500");
45 grid
.setAttribute("data-expected-height", "110");
47 var cell1
= document
.getElementById("cell1")
48 cell1
.setAttribute("data-expected-width", "80");
49 cell1
.setAttribute("data-expected-height", "110");
51 var cell2
= document
.getElementById("cell2")
52 cell2
.setAttribute("data-expected-width", "420");
53 cell2
.setAttribute("data-expected-height", "110");
56 <body onload=
"shrinkToFitTest();">
58 <p>This test checks that a min-content sized row track grows when the container width is reduced and that it shrinks to fit its content when container is resized to its initial dimensions.
</p>
60 <div id=
"grid" class=
"grid" data-expected-width=
"500" data-expected-height=
"110">
61 <div id=
"cell1" class=
"firstRowFirstColumn" data-expected-width=
"80" data-expected-height=
"110">
64 <div id=
"cell2" class=
"firstRowSecondColumn" data-expected-width=
"420" data-expected-height=
"110">
66 #cell2 (
1fr) xxx. xx xxx xxxxx xxx xxx ,x. xxxxx xx xx xxx. xxx xx xxxxx xxx xxxxx, . xx xx xxxxxxxxx. xxx xxxxxxxx xxx xx xx, . xxx x xxxxx x x. xxx xxxx xxxxxxx xxxxx,x. x x x xx xxxxxx. xxxxxx xx x xxx xx x,x. xxxxxxxx xx xxx. xxxx x xx x xxx xx xx,x. xxx x xxxxx xxx. xxxxxx xxx x xxx xx xx, . x xx xxxxx xxx. xxx xx x xxxxxxx x xxx, . xx xxxxx xxxx x. xxx xx xxxxx xxx xxxxx,x. x xxx xxxxx xxx. xxx xx xx xxxxxx xx xx, . x xx xxxx x x x. xxx xx xx xxxxxx xx xx, .
</span>