function runTests() {
// Test 1: elements styled with display:grid
let idsWithGrid = [ "gridDiv", "gridFieldset", "gridButton", "gridDivOh", "gridFieldsetOh", "gridButtonOh",
];
for (let id of idsWithGrid) {
let wrapper = document.getElementById(id);
// test function existence
is(typeof(wrapper.getGridFragments), "function",
id + ": getGridFragments function exists."
);
// test that wrapper has one grid
let gridFragments = wrapper.getGridFragments();
is(gridFragments.length, 1,
id + ": one grid on an un-fragmented display:grid styled element."
);
// test that the grid has cols and rows properties
if (gridFragments.length) {
let grid = gridFragments[0];
isnot(typeof(grid.cols), "undefined", id + ": Grid.cols property exists.");
isnot(typeof(grid.rows), "undefined", id + ": Grid.rows property exists.");
}
}
// Test 2: elements styled without display:grid
let idsWithoutGrid = [ "boxA",
];
for (let id of idsWithoutGrid) {
let wrapper = document.getElementById(id);
// test that wrapper has no grid
let gridFragments = wrapper.getGridFragments();
is(gridFragments.length, 0,
id + ": no grid on element."
);
}
¤ 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.0.3Bemerkung:
¤
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.