3 Any copyright is dedicated to the Public Domain.
4 http://creativecommons.org/publicdomain/zero/1.0/
8 <title>CSS Grid Test: align-items:stretch / justify-items:stretch
</title>
9 <link rel=
"author" title=
"Mats Palmgren" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1151213">
10 <link rel=
"help" href=
"https://drafts.csswg.org/css-align-3/#align-items-property">
11 <link rel=
"help" href=
"https://drafts.csswg.org/css-align-3/#justify-items-property">
12 <link rel=
"match" href=
"grid-align-content-001-ref.html">
13 <style type=
"text/css">
15 color:black
; background-color:white
; font-size:16px; padding:0; margin:0;
17 separator
{ clear:both
; display:block
; height:6px; }
23 border-block-start: 2px solid blue
;
24 grid-template: 1px 25px 5px / 3px 21px 1px;
25 padding: 1px 1px 3px 2px;
30 justify-items: stretch
;
35 grid-area: 2 / 2 / 3 / 3; /* the center area */
40 /* good for manual debugging but causes anti-aliasing diff: */
41 /* border-block-start: 2px solid blue; */
42 /* border-inline-start: 2px solid lime; */
43 border-block-start: 2px solid black
;
44 border-inline-start: 2px solid black
;
45 margin: 1px 1px 2px 2px;
50 top:0;left:0;bottom:0;right:0;
51 width:2px; height:2px;
54 abs1
{ top:auto
; left:auto
; }
55 abs2
{ top:auto
; right:auto
; }
56 abs3
{ bottom:auto
; left:auto
; }
57 abs4
{ bottom:auto
; right:auto
; }
62 background: lightgrey
;
65 .hl { writing-mode: horizontal-tb
; direction:ltr
; }
66 .hr { writing-mode: horizontal-tb
; direction:rtl
; }
67 .vl { writing-mode: vertical-lr
; }
68 .vr { writing-mode: vertical-rl
; }
69 .vlr { writing-mode: vertical-lr
; direction:rtl
; }
70 .vrl { writing-mode: vertical-rl
; direction:ltr
; }
73 .stretch2 { height:auto
; }
74 .stretch3 { height:auto
; max-height:13px; }
75 .stretch4 { width:auto
; }
76 .stretch5 { width:auto
; max-width:17px; }
77 .stretch6 { width:auto
; height:auto
; max-width:17px; max-height:13px; }
78 .stretch7 { width:auto
; height:auto
; }
84 There should be no red areas.
85 All grey areas should have a black dot in each corner.
90 var gridwm
= [ "hl", "hr", "vl", "vr", "vlr", "vrl" ];
91 var wm
= [ "hl", "hr", "vl", "vr", "vlr", "vrl" ];
92 var test
= [ "stretch1", "stretch2", "stretch3", "stretch4", "stretch5",
93 "stretch6", "stretch7" ];
94 for (var i
= 0; i
< gridwm
.length
; ++i
) {
95 for (var j
= 0; j
< wm
.length
; ++j
) {
96 for (var k
= 0; k
< test
.length
; ++k
) {
97 var div
= document
.createElement("div");
98 div
.className
= "grid " + gridwm
[i
];
99 var span
= document
.createElement("span");
100 span
.className
= wm
[j
] + " " + test
[k
];
101 div
.appendChild(span
);
102 span
.appendChild(document
.createElement("fill"));
103 span
.appendChild(document
.createElement("abs1"));
104 span
.appendChild(document
.createElement("abs2"));
105 span
.appendChild(document
.createElement("abs3"));
106 span
.appendChild(document
.createElement("abs4"));
108 document
.body
.appendChild(div
)
110 if (j
% 2 == 1) document
.body
.appendChild(document
.createElement("separator"));