function clickButton(expectEvent) {
let lastClickCount = clickCount;
synthesizeMouseAtCenter(button, {});
(expectEvent ? isnot : is)(clickCount, lastClickCount, `Should've ${expectEvent ? "" : "not "}been able to click`);
}
function enterFullscreen() {
lastFullscreenPromise = null;
shouldEnterFullscreen = true;
clickButton(true);
shouldEnterFullscreen = false;
isnot(lastFullscreenPromise, null, "Should be transitioning to fullscreen");
return lastFullscreenPromise;
}
async function testFullscreenIsModal(modal) {
info("testing modal: " + modal);
is(document.fullscreenElement, null, "Shouldn't be in fullscreen");
await enterFullscreen();
clickButton(/* expectEvent = */ !modal);
ok(document.fullscreenElement.matches(":fullscreen"), "Fullscreen element matches :fullscreen");
is(document.fullscreenElement.matches(":modal"), modal, "Fullscreen element matches :modal");
// Before exiting fullscreen, wait on the document becoming active,
// which signifies that the fullscreen request has been completely
// processed. It is important that the fullscreen request is all
// the way done, or the exit fullscreen request could be dropped.
let documentWrapper = SpecialPowers.wrap(document);
await SimpleTest.promiseWaitForCondition(() => documentWrapper.isActive(), "Timed out waiting for document to become active.");
ok(documentWrapper.isActive(), "Document is active.");
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.