Bug 1298550 - Re-enable the now-passing part of grid-percent-grid-gap-001.html. r...
[gecko.git] / layout / reftests / css-grid / grid-item-margin-left-right-auto-004.html
blobb4799ab2fc971b5274fb6c7cf6bdf533eda22f00
1 <!DOCTYPE HTML>
2 <!--
3 Any copyright is dedicated to the Public Domain.
4 http://creativecommons.org/publicdomain/zero/1.0/
5 -->
6 <html><head>
7 <meta charset="utf-8">
8 <title>CSS Grid Test: margin-left/right:auto + align-self</title>
9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1176793">
10 <link rel="help" href="https://drafts.csswg.org/css-grid/#auto-margins">
11 <link rel="match" href="grid-item-margin-left-right-auto-004-ref.html">
12 <style type="text/css">
13 html,body {
14 color:black; background-color:white; font-size:16px; padding:0; margin:0;
16 separator { clear:both; display:block; height:6px; }
18 .grid {
19 display: grid;
20 float: left;
21 position: relative;
22 border: 1px solid;
23 /* border-block-start: 2px solid blue; */
24 border-block-start: 2px solid black;
25 grid-template: 1px 32px 3px / 3px 20px 2px;
26 margin-right: 4px;
29 span {
30 grid-area: 2 / 2; /* the center 32 x 20 pixel area */
31 display: block;
32 width: 13px;
33 height: 9px;
34 background: grey;
35 border-block-start: 2px solid blue;
36 border-inline-start: 2px solid lime;
37 margin: 1px 1px 2px 2px;
38 margin-left: auto;
39 margin-right: auto;
40 justify-self: start;
43 abs1,abs2,abs3,abs4 {
44 position: absolute;
45 top:0;left:0;bottom:0;right:0;
46 background: lightgrey;
48 abs1 { grid-area: 1 / 1 / 2 / 4; }
49 abs2 { grid-area: 1 / 1 / 4 / 2; }
50 abs3 { grid-area: 1 / 3 / 4 / 4; }
51 abs4 { grid-area: 3 / 1 / 4 / 4; }
53 .hl { writing-mode: horizontal-tb; direction:ltr; }
54 .hr { writing-mode: horizontal-tb; direction:rtl; }
55 .vl { writing-mode: vertical-lr; }
56 .vr { writing-mode: vertical-rl; }
57 .vlr { writing-mode: vertical-lr; direction:rtl; }
58 .vrl { writing-mode: vertical-rl; direction:ltr; }
60 .hl { -webkit-writing-mode: horizontal-tb; direction:ltr; }
61 .hr { -webkit-writing-mode: horizontal-tb; direction:rtl; }
62 .vl { -webkit-writing-mode: vertical-lr; }
63 .vr { -webkit-writing-mode: vertical-rl; }
64 .vlr { -webkit-writing-mode: vertical-lr; direction:rtl; }
65 .vrl { -webkit-writing-mode: vertical-rl; direction:ltr; }
67 .astart { align-self:start; }
68 .aend { align-self:end; }
69 .aflexstart { align-self:flex-start; }
70 .aflexend { align-self:flex-end; }
71 .aselfstart { align-self:self-start; }
72 .aselfend { align-self:self-end; }
73 .acenter { align-self:center; }
74 .aleft { align-self:left; }
75 .aright { align-self:right; }
76 .astretch1 { align-self:stretch; }
77 .astretch2 { align-self:stretch; width:13px; height:auto; }
78 .astretch3 { align-self:stretch; height:auto; }
79 .astretch4 { align-self:stretch; width:auto; }
80 .astretch5 { align-self:stretch; width:auto; max-width:13px; }
81 .astretch6 { align-self:stretch; height:auto; max-height:9px; }
82 .astretch7 { align-self:stretch; width:auto; height:auto; max-width:13px; max-height:9px; }
83 .aauto { align-self:auto; }
85 </style>
86 </head>
87 <body>
89 <script>
90 var gridwm = [ "vr", "vlr", "vrl" ]; // *-003.html tests hl/hr/vl
91 var wm = [ "hl", "hr", "vl", "vr", "vlr", "vrl" ];
92 var test = [ "start", "end", "flexstart", "flexend", "center", "left", "right",
93 "stretch1", "stretch2", "stretch3", "stretch4", "stretch5",
94 "stretch6", "stretch7", "auto" ];
95 for (var i = 0; i < gridwm.length; ++i) {
96 for (var j = 0; j < wm.length; ++j) {
97 for (var k = 0; k < test.length; ++k) {
98 var div = document.createElement("div");
99 div.className = "grid " + gridwm[i];
100 var span = document.createElement("span");
101 span.className = wm[j] + " a" + test[k];
102 div.appendChild(span);
103 div.appendChild(document.createElement("abs1"));
104 div.appendChild(document.createElement("abs2"));
105 div.appendChild(document.createElement("abs3"));
106 div.appendChild(document.createElement("abs4"));
108 document.body.appendChild(div)
110 document.body.appendChild(document.createElement("separator"));
113 </script>
116 </body>
117 </html>