function begin() {
info("The default background of window should be white");
assertWindowPureColor(window, "white");
addFullscreenChangeContinuation("enter", enterFullscreen);
gFullscreen.requestFullscreen();
}
function setBackdropStyle(style) {
gStyle.textContent = `#fullscreen::backdrop { ${style} }`;
}
function enterFullscreen() {
is(getComputedStyle(gFullscreen).background, gFullscreenElementBackground, "Computed background of #fullscreen shouldn't be changed");
info("The default background of backdrop for fullscreen is black");
assertWindowPureColor(window, "black");
setBackdropStyle("background: green");
info("The background color of backdrop should be changed to green");
assertWindowPureColor(window, "green");
gFullscreen.style.background = "blue";
info("The blue fullscreen element should cover the backdrop");
assertWindowPureColor(window, "blue");
gFullscreen.style.background = "";
setBackdropStyle("display: none");
info("The white body should be shown when the backdrop is hidden");
assertWindowPureColor(window, "white");
setBackdropStyle("");
info("Content should return to black because we restore the backdrop");
assertWindowPureColor(window, "black");
gFullscreen.style.display = "none";
info("The backdrop should disappear with the fullscreen element");
assertWindowPureColor(window, "white");
gFullscreen.style.display = "";
setBackdropStyle("position: absolute");
info("Changing position shouldn't immediately affect the view");
assertWindowPureColor(window, "black");
window.scroll(0, screen.height);
info("Scrolled up the absolutely-positioned element");
assertWindowPureColor(window, "white");
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.