function runTests() { var wrapper = document.getElementById("wrapper"); var grid = wrapper.getGridFragments()[0];
// test property existence
isnot(typeof(grid.cols.lines), "undefined", "Grid.cols.lines property exists.");
if (typeof(grid.cols.lines) != "undefined") {
// test column line count
is(grid.cols.lines.length, 5, "Grid.cols.lines property has length that matches grid-template-columns."
);
if (grid.cols.lines.length == 5) {
// test column line position
is(grid.cols.lines[1].start, 50, "Grid column line 2 position is as expected.");
// test column line width
is(grid.cols.lines[1].breadth, 10, "Grid column line 2 width is as expected.");
// test column line numbers, positive and negative
is(grid.cols.lines[3].number, 4, "Grid column line 4 positive number is as expected.");
is(grid.cols.lines[3].negativeNumber, -2, "Grid column line 4 negative number is as expected.");
// test column line names
is(grid.cols.lines[0].names.length, 0, "Grid column line 1 has no names.");
is(grid.cols.lines[1].names.length, 2, "Grid column line 2 has 2 names.");
is(grid.cols.lines[1].names + "", "first,divider", "Grid column line 2 has the names 'first,divider'.");
is(grid.cols.lines[4].names.length, 1, "Grid column line 5 has 1 name.");
is(grid.cols.lines[4].names + "", "last", "Grid column line 5 has the name 'last'.");
}
}
// test property existence
isnot(typeof(grid.rows.lines), "undefined", "Grid.rows.lines property exists.");
if (typeof(grid.rows.lines) != "undefined") {
// test column line count
is(grid.rows.lines.length, 3, "Grid.rows.lines property has length that matches grid-template-rows."
);
if (grid.rows.lines.length == 3) {
// test row line names
is(grid.rows.lines[0].names.length, 2, "Grid row line 1 has 2 names.");
is(grid.rows.lines[0].names + "", "top1,top2", "Grid row line 1 has the names 'top1,top2'.");
is(grid.rows.lines[1].names.length, 1, "Grid row line 2 has 1 name.");
is(grid.rows.lines[1].names + "", "bot", "Grid row line 2 has the name 'bot'.");
is(grid.rows.lines[2].names.length, 0, "Grid row line 3 has no names.");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.