summaryrefslogtreecommitdiffstats
path: root/dom/grid/test/chrome/test_grid_implicit.html
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-09-28 23:25:06 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-09-28 23:47:04 -0400
commitf1adcd1eeed03591f10ecc72c5e5b71856a18ca9 (patch)
tree687b2a90bc14b1f83a38d7ba1462d647e9bb7eee /dom/grid/test/chrome/test_grid_implicit.html
parent22851ce36d97fca5a4768f3c49a4fff6cebd320a (diff)
downloadUXP-f1adcd1eeed03591f10ecc72c5e5b71856a18ca9.tar
UXP-f1adcd1eeed03591f10ecc72c5e5b71856a18ca9.tar.gz
UXP-f1adcd1eeed03591f10ecc72c5e5b71856a18ca9.tar.lz
UXP-f1adcd1eeed03591f10ecc72c5e5b71856a18ca9.tar.xz
UXP-f1adcd1eeed03591f10ecc72c5e5b71856a18ca9.zip
Issue #1233 - Part 2: Update Reftests
List of relevant patches applied: 1425599 part 15 - [css-grid] Test reference fixes + more tests. 1373678 Part 3: Add line number checks to test_grid_implicit.html. 1416350 - Part 3: Add test to verify line numbers of grids with leading implicit tracks. 1416350 - Part 4: Add a reftest of repeat:auto-fit grids with leading implicit tracks. 1417711 - [css-grid] An abs.pos. grid container child that only covers removed 'auto-fit' tracks should not span to the end padding edge. 1416350 - Part 5: Correct the expected results for grids that have leading implicit tracks. 1418727 part 3 - [css-grid] Reftest updates.
Diffstat (limited to 'dom/grid/test/chrome/test_grid_implicit.html')
-rw-r--r--dom/grid/test/chrome/test_grid_implicit.html63
1 files changed, 60 insertions, 3 deletions
diff --git a/dom/grid/test/chrome/test_grid_implicit.html b/dom/grid/test/chrome/test_grid_implicit.html
index c7782e0e5..1f7142658 100644
--- a/dom/grid/test/chrome/test_grid_implicit.html
+++ b/dom/grid/test/chrome/test_grid_implicit.html
@@ -33,6 +33,11 @@ body {
grid-template-rows: [areaA-end areaB-start areaC-end] 50px [areaA-start areaB-end areaC-start];
}
+.template4 {
+ grid-template-columns: 100px 50px 100px;
+ grid-template-rows: 50px;
+}
+
.box {
background-color: #444;
color: #fff;
@@ -50,6 +55,9 @@ body {
.d {
grid-area: areaD;
}
+.e {
+ grid-column: -7 / 5;
+}
</style>
<script>
@@ -78,9 +86,12 @@ function runTests() {
is(grid.cols.lines[4].type, "implicit", "Grid column line 5 is implicit.");
is(grid.cols.lines[5].type, "implicit", "Grid column line 6 is implicit.");
- is(grid.rows.lines[0].type, "implicit", "Grid row line 1 is implicit.");
- is(grid.rows.lines[1].type, "explicit", "Grid row line 2 is explicit.");
- is(grid.rows.lines[3].type, "explicit", "Grid row line 4 is explicit.");
+ is(grid.rows.lines[0].type, "implicit", "Grid row line 0 is implicit.");
+ is(grid.rows.lines[0].number, 0, "Grid row line 0 has correct number.");
+ is(grid.rows.lines[1].type, "explicit", "Grid row line 1 is explicit.");
+ is(grid.rows.lines[1].number, 1, "Grid row line 1 has correct number.");
+ is(grid.rows.lines[3].type, "explicit", "Grid row line 3 is explicit.");
+ is(grid.rows.lines[3].number, 3, "Grid row line 3 has correct number.");
// test that row line 1 gets the name forced on it by placement of item B
todo_isnot(grid.rows.lines[0].names.indexOf("got-this-name-implicitly"), -1,
@@ -221,6 +232,48 @@ function runTests() {
}
}
+ // test the fourth grid wrapper
+ wrapper = document.getElementById("wrapper4");
+ grid = wrapper.getGridFragments()[0];
+
+ // test column and row line counts
+ is(grid.cols.lines.length, 8,
+ "Grid.cols.lines property expands properly with implicit columns on both sides."
+ );
+ is(grid.rows.lines.length, 2,
+ "Grid.rows.lines property is as expected"
+ );
+
+ if (grid.cols.lines.length == 8) {
+ // check that all the lines get correct implict/explicit type and number
+ let expectedType = [
+ "implicit",
+ "implicit",
+ "implicit",
+ "explicit",
+ "explicit",
+ "explicit",
+ "explicit",
+ "implicit",
+ ];
+ let expectedNumber = [
+ 0,
+ 0,
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ ];
+
+ for (let i = 0; i < grid.cols.lines.length; i++) {
+ let line = grid.cols.lines[i];
+ is(line.type, expectedType[i], "Line index " + i + " has expected type.");
+ is(line.number, expectedNumber[i], "Line index " + i + " has expected number.");
+ }
+ }
+
SimpleTest.finish();
}
</script>
@@ -246,5 +299,9 @@ function runTests() {
<div id="boxC" class="box c">C</div>
</div>
+ <div id="wrapper4" class="wrapper template4">
+ <div id="boxE" class="box e">E</div>
+ </div>
+
</body>
</html>