Skip to content

Commit

Permalink
Backed out changeset 46fd81530a8b (bug 1832837) for causing failures …
Browse files Browse the repository at this point in the history
…at fullscreen-reordering.html.
  • Loading branch information
Butkovits Atila committed May 22, 2023
1 parent 3c45916 commit 085fd16
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 22 deletions.
9 changes: 9 additions & 0 deletions dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15286,6 +15286,15 @@ bool Document::FullscreenElementReadyCheck(FullscreenRequest& aRequest) {
aRequest.Reject("FullscreenDeniedHTMLDialog");
return false;
}
// XXXsmaug Note, we don't follow the latest fullscreen spec here.
// This whole check could be probably removed.
if (fullscreenElement && !nsContentUtils::ContentIsHostIncludingDescendantOf(
elem, fullscreenElement)) {
// If this document is fullscreen, only grant fullscreen requests from
// a descendant of the current fullscreen element.
aRequest.Reject("FullscreenDeniedNotDescendant");
return false;
}
if (!nsContentUtils::IsChromeDoc(this) && !IsInFocusedTab(this)) {
aRequest.Reject("FullscreenDeniedNotFocusedTab");
return false;
Expand Down
39 changes: 17 additions & 22 deletions dom/base/test/fullscreen/file_fullscreen-rollback.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
Tests:
* Request full-screen in doc.
* Request full-screen in doc on element not descended from full-screen element.
* Cancel full-screen, FSE should rollback to previous FSE.
* Request full-screen in doc on element not descended from full-screen element. Request should be denied.
* Request full-screen in subdoc.
* Cancel full-screen in subdoc, doc should be full-screen.
* Request full-screen in subdoc.
Expand Down Expand Up @@ -79,43 +78,39 @@
function change1() {
is(document.fullscreenElement, e("fse"), "Body should be FSE");
// Request full-screen from element not descendent from current FSE.
enterFullscreen(e("non-fse"), change2);
addFullscreenErrorContinuation(error1);
requestFullscreen(e("non-fse"));
}

function change2() {
is(document.fullscreenElement, e("non-fse"), "FSE should be e('non-fse')");
revertFullscreen(document, change3);
}

function change3() {
is(document.fullscreenElement, e("fse"), "FSE should rollback to FSE.");
function error1() {
is(document.fullscreenElement, e("fse"), "FSE should not change");
var iframe = e("subdoc");
enterFullscreen(iframe.contentDocument.body, change4);
enterFullscreen(iframe.contentDocument.body, change2);
}

function change4() {
function change2() {
var iframe = e("subdoc");
is(document.fullscreenElement, iframe, "Subdoc container should be FSE.");
is(iframe.contentDocument.fullscreenElement, iframe.contentDocument.body, "Subdoc body should be FSE in subdoc");
revertFullscreen(document, change5);
revertFullscreen(document, change3);
}

function change5() {
function change3() {
is(document.fullscreenElement, e("fse"), "FSE should rollback to FSE.");
revertFullscreen(document, change6);
revertFullscreen(document, change4);
}

function change6() {
function change4() {
is(document.fullscreenElement, null, "Should have left full-screen entirely");
enterFullscreen(e("fse"), change7);
enterFullscreen(e("fse"), change5);
}

function change7() {
function change5() {
is(document.fullscreenElement, e("fse"), "FSE should be e('fse')");
enterFullscreen(e("fse-inner"), change8);
enterFullscreen(e("fse-inner"), change6);
}

function change8() {
function change6() {
var element = e('fse-inner');
is(document.fullscreenElement, element, "FSE should be e('fse-inner')");

Expand All @@ -124,12 +119,12 @@
// we set the fullscreenChangeEnters value to 1. This is a hack, but
// it is a hack that supports the expected behavior.
setFullscreenChangeEnters(1);
addFullscreenChangeContinuation("exit", change9);
addFullscreenChangeContinuation("exit", change7);
info(`Removing FSE should exit fullscreen.`);
element.remove();
}

function change9() {
function change7() {
is(document.fullscreenElement, null, "Should have fully exited full-screen mode when removed FSE from doc");
opener.nextTest();
}
Expand Down
1 change: 1 addition & 0 deletions dom/locales/en-US/chrome/dom/dom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ FullscreenDeniedMovedDocument=Request for fullscreen was denied because requesti
FullscreenDeniedLostWindow=Request for fullscreen was denied because we no longer have a window.
FullscreenDeniedPopoverOpen=Request for fullscreen was denied because the element is already open as a popover.
FullscreenDeniedSubDocFullscreen=Request for fullscreen was denied because a subdocument of the document requesting fullscreen is already fullscreen.
FullscreenDeniedNotDescendant=Request for fullscreen was denied because requesting element is not a descendant of the current fullscreen element.
FullscreenDeniedNotFocusedTab=Request for fullscreen was denied because requesting element is not in the currently focused tab.
FullscreenDeniedFeaturePolicy=Request for fullscreen was denied because of FeaturePolicy directives.
FullscreenExitWindowFocus=Exited fullscreen because a window was focused.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[element-ready-check-fullscreen-element-sibling.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Element ready check for sibling of fullscreen element]
expected: FAIL
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[element-request-fullscreen-non-top.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[\n Element#requestFullscreen() for non-top element in fullscreen element stack\n]
expected: FAIL
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[element-request-fullscreen-two-elements.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Element#requestFullscreen() on two elements in the same document]
expected: FAIL
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[popover-top-layer-interactions.html]
[A Fullscreen Element should *not* close a Fullscreen Element.]
expected: FAIL

[A Popover should *not* close a Modal Dialog.]
expected:
if not debug and (os == "linux"): [PASS, FAIL]
if not debug and (os == "android"): [PASS, FAIL]
if not debug and (os == "mac"): [PASS, FAIL]

[A Popover should *not* close a Fullscreen Element.]
expected:
if not debug and (os == "linux"): [PASS, FAIL]
if not debug and (os == "android"): [PASS, FAIL]
if not debug and (os == "mac"): [PASS, FAIL]

0 comments on commit 085fd16

Please sign in to comment.