3 Any copyright is dedicated to the Public Domain.
4 http://creativecommons.org/publicdomain/zero/1.0/
8 <title>Reference: stretching intrinsic ratio item with 'normal' and/or 'stretch', with Automatic Minimum Size clamping
</title>
9 <link rel=
"author" title=
"Mats Palmgren" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1315383">
10 <style type=
"text/css">
15 grid-column-gap: 10px;
20 x
{ width:32px; height:2px; background:cyan
; }
21 .w24 > x { width:24px; }
22 .w8 > x { width:8px; }
23 .w4 > x { width:4px; }
29 <div class=
"grid" style=
"grid:24px 10px 24px / repeat(7, 32px); grid-column-gap: 10px;">
30 <div style=
"height:24px; width:2px; background:cyan; grid-row:1"></div>
31 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
32 <div style=
"height:24px; grid-row:3"></div>
33 <x style=
"grid-row:4"></x>
38 <div class=
"grid w24" style=
"grid:32px 10px 32px / repeat(7, 24px); grid-column-gap: 10px;">
39 <div style=
"height:32px; width:2px; background:cyan; grid-row:1"></div>
40 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
41 <div style=
"height:32px; grid-row:3"></div>
42 <x style=
"grid-row:4"></x>
47 <div class=
"grid w4" style=
"grid:8px 10px 8px / repeat(7, 4px); grid-column-gap:32px; width:220px">
48 <div style=
"height:8px; width:2px; background:cyan; grid-row:1"></div>
49 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
50 <div style=
"height:8px; grid-row:3"></div>
51 <x style=
"grid-row:4"></x>
56 <div class=
"grid w4" style=
"grid:32px 10px 32px / repeat(7, 4px); grid-column-gap:32px; width:220px">
57 <div style=
"height:32px; width:2px; background:cyan; grid-row:1"></div>
58 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
59 <div style=
"height:32px; grid-row:3"></div>
60 <x style=
"grid-row:4"></x>
65 <div class=
"grid w8" style=
"grid:4px 10px 4px 2px 2px / repeat(7, 8px); grid-gap:8px; width:104px">
66 <div style=
"height:4px; width:2px; background:cyan; grid-row:1"></div>
67 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
68 <div style=
"height:4px; grid-row:3"></div>
69 <x style=
"grid-row:4"></x>
74 <div class=
"grid" style=
"grid:8px 10px 8px 2px 2px / repeat(7, 32px); grid-gap:16px; ">
75 <div style=
"height:4px; width:2px; background:cyan; grid-row:1"></div>
76 <div style=
"height:10px; grid-row:2; grid-column: span 7"></div>
77 <div style=
"height:4px; grid-row:3"></div>
78 <x style=
"grid-row:4"></x>
84 var url
= "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQoz2NgGAWjYBTAAAADEAABaJFtwwAAAABJRU5ErkJggg%3D%3D";
85 var grids
= document
.querySelectorAll('.grid');
86 var js
= [ "normal", "start", "center", "stretch" ];
87 var as
= [ "normal", "start", "center", "stretch" ];
164 var index
= 0; // imgSizes index
165 for (var i
= 0; i
< grids
.length
; ++i
) {
166 for (var j
= 0; j
< js
.length
; j
++) {
167 for (var a
= 0; a
< as
.length
; a
++) {
168 if (as
[a
] != "normal" && as
[a
] != "stretch" &&
169 js
[j
] != "normal" && js
[j
] != "stretch") {
172 var img
= document
.createElement('img');
173 img
.style
.width
= imgSizes
[index
][0];
174 img
.style
.height
= imgSizes
[index
][1];
175 if (as
[a
] != "normal" && as
[a
] != "stretch")
176 img
.style
.alignSelf
= as
[a
];
177 if (js
[j
] != "normal" && js
[j
] != "stretch")
178 img
.style
.justifySelf
= js
[j
];
180 img
.setAttribute('title', as
[a
] + ' / ' + js
[j
]);
181 grids
[i
].appendChild(img
);
185 for (var j
= 0; j
< js
.length
; j
++) {
186 for (var a
= 0; a
< as
.length
; a
++) {
187 if (as
[a
] != "normal" && as
[a
] != "stretch" &&
188 js
[j
] != "normal" && js
[j
] != "stretch") {
191 var x
= document
.createElement('x');
192 grids
[i
].appendChild(x
);