4 https://bugzilla.mozilla.org/show_bug.cgi?id=1350780
7 <title>Test for Bug
1350780</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
19 grid-template-columns: auto;
22 .gridBeforeNoContent::before {
24 grid-template-columns:
40px;
28 <script type=
"application/javascript">
30 SimpleTest.waitForExplicitFinish();
32 function checkTemplateWithData(data) {
33 let obj = document.createElement(
"div");
35 // We need either a template or an additionalClass.
36 if (typeof(data.template !=
"undefined")) {
37 obj.style.display =
"grid";
38 obj.style.gridTemplateColumns = data.template;
41 if (typeof(data.additionalClass !=
"undefined")) {
42 obj.className = data.additionalClass;
45 let container = document.getElementById(
"container");
46 container.appendChild(obj);
48 let computedStyle = getComputedStyle(obj, data.pseudo);
49 let computedTemplate = computedStyle.getPropertyValue(
"grid-template-columns");
51 let message =
"Got expected template with pseudo " + data.pseudo;
52 if (typeof(data.additionalClass !=
"undefined")) {
53 message +=
" with class " + data.additionalClass;
57 is(computedTemplate, data.expected, message);
59 container.removeChild(obj);
65 pseudo:
"::selection",
70 { additionalClass:
"gridBefore",
73 { additionalClass:
"gridBeforeNoContent",
78 for (let i =
0; i < dataToTest.length; ++i) {
79 checkTemplateWithData(dataToTest[i]);
87 <body onload=
"runTest()">
88 <div id=
"container"></div>
89 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1350780">Mozilla Bug
1350780</a>