function begin() {
// record initial computed style of #parent
const style = getComputedStyle(gParent);
for (var prop of gParentProperties) {
gInitialVals[prop] = style[prop];
}
nextTest();
}
function nextTest() {
document.body.className = tests.shift();
// trigger a reflow to ensure the state of frames before fullscreen
gFullscreen.getBoundingClientRect();
ok(!document.fullscreenElement, "Shouldn't be in fullscreen");
// check window snapshot
assertWindowPureColor(window, "red");
// simulate click
window.addEventListener("click", firstClick);
synthesizeMouseAtWindowCenter();
}
function firstClick(evt) {
window.removeEventListener("click", firstClick);
is(evt.target, gBack, "Click target should be #back before fullscreen");
addFullscreenChangeContinuation("enter", enterFullscreen);
gFullscreen.requestFullscreen();
}
function enterFullscreen() {
ok(document.fullscreenElement, "Should now be in fullscreen");
// check window snapshot
assertWindowPureColor(window, "green");
// check computed style of #parent
const style = getComputedStyle(gParent);
for (var prop of gParentProperties) {
is(style[prop], gInitialVals[prop],
`Computed style ${prop} of #parent should not be changed`);
}
// simulate click
window.addEventListener("click", secondClick);
synthesizeMouseAtWindowCenter();
}
function secondClick(evt) {
window.removeEventListener("click", secondClick);
is(evt.target, gFullscreen, "Click target should be #fullscreen now");
addFullscreenChangeContinuation("exit", exitFullscreen);
document.exitFullscreen();
}
function exitFullscreen() {
if (tests.length) {
nextTest();
} else {
opener.nextTest();
}
}
</script>
</body>
</html>
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.