diff --git a/browser/base/content/test/fullscreen/browser.ini b/browser/base/content/test/fullscreen/browser.ini index 15c00afce761..f1f0f8cf9067 100644 --- a/browser/base/content/test/fullscreen/browser.ini +++ b/browser/base/content/test/fullscreen/browser.ini @@ -4,6 +4,4 @@ support-files = [browser_bug1557041.js] skip-if = os == 'linux' # Bug 1561973 [browser_fullscreen_permissions_prompt.js] -skip-if = debug && os == 'mac' # Bug 1568570 -[browser_fullscreen_cross_origin.js] -support-files = fullscreen.html fullscreen_frame.html +skip-if = debug && os == 'mac' # Bug 1568570 \ No newline at end of file diff --git a/browser/base/content/test/fullscreen/browser_fullscreen_cross_origin.js b/browser/base/content/test/fullscreen/browser_fullscreen_cross_origin.js deleted file mode 100644 index df3e8bfc7a12..000000000000 --- a/browser/base/content/test/fullscreen/browser_fullscreen_cross_origin.js +++ /dev/null @@ -1,74 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -const ORIGIN = - "https://example.com/browser/browser/base/content/test/fullscreen/fullscreen_frame.html"; - -add_task(async function test_fullscreen_cross_origin() { - async function requestFullscreen(aAllow, aExpect) { - await BrowserTestUtils.withNewTab(ORIGIN, async function(browser) { - const iframeId = aExpect == "allowed" ? "frameAllowed" : "frameDenied"; - - info("Start fullscreen on iframe " + iframeId); - await SpecialPowers.spawn( - browser, - [{ aExpect, iframeId }], - async function(args) { - let frame = content.document.getElementById(args.iframeId); - await content.SpecialPowers.spawn( - frame, - [args.aExpect], - async expect => { - let frameDoc = content.document; - const waitForFullscreen = new Promise(resolve => { - const message = - expect == "allowed" ? "fullscreenchange" : "fullscreenerror"; - frameDoc.notifyUserGestureActivation(); - function handler(evt) { - frameDoc.removeEventListener(message, handler); - Assert.equal( - evt.type, - message, - `Request should be ${expect}` - ); - frameDoc.exitFullscreen(); - resolve(); - } - frameDoc.addEventListener(message, handler); - }); - - frameDoc.getElementById("request").click(); - await waitForFullscreen; - } - ); - } - ); - - if (aExpect == "allowed") { - waitForFullScreenState(browser, false); - } - }); - } - - await new Promise(r => { - SpecialPowers.pushPrefEnv( - { - set: [ - ["full-screen-api.enabled", true], - ["full-screen-api.allow-trusted-requests-only", false], - ["full-screen-api.transition-duration.enter", "0 0"], - ["full-screen-api.transition-duration.leave", "0 0"], - ["dom.security.featurePolicy.enabled", true], - ["dom.security.featurePolicy.header.enabled", true], - ["dom.security.featurePolicy.webidl.enabled", true], - ], - }, - r - ); - }); - - await requestFullscreen(undefined, "denied"); - await requestFullscreen("fullscreen", "allowed"); -}); diff --git a/browser/base/content/test/fullscreen/fullscreen.html b/browser/base/content/test/fullscreen/fullscreen.html deleted file mode 100644 index 8b4289bb36eb..000000000000 --- a/browser/base/content/test/fullscreen/fullscreen.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -
- - - - diff --git a/browser/base/content/test/fullscreen/fullscreen_frame.html b/browser/base/content/test/fullscreen/fullscreen_frame.html deleted file mode 100644 index ca1b1a4dd818..000000000000 --- a/browser/base/content/test/fullscreen/fullscreen_frame.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/dom/html/HTMLIFrameElement.cpp b/dom/html/HTMLIFrameElement.cpp index 0f284aa2b87a..d7ebee6b3743 100644 --- a/dom/html/HTMLIFrameElement.cpp +++ b/dom/html/HTMLIFrameElement.cpp @@ -306,6 +306,8 @@ void HTMLIFrameElement::RefreshFeaturePolicy(bool aParseAllowAttribute) { mFeaturePolicy->SetDeclaredPolicy(OwnerDoc(), allow, NodePrincipal(), origin); } + + mFeaturePolicy->InheritPolicy(OwnerDoc()->FeaturePolicy()); } if (AllowPaymentRequest()) { @@ -316,7 +318,6 @@ void HTMLIFrameElement::RefreshFeaturePolicy(bool aParseAllowAttribute) { mFeaturePolicy->MaybeSetAllowedPolicy(NS_LITERAL_STRING("fullscreen")); } - mFeaturePolicy->InheritPolicy(OwnerDoc()->FeaturePolicy()); MaybeStoreCrossOriginFeaturePolicy(); } diff --git a/dom/html/test/file_fullscreen-event-order.html b/dom/html/test/file_fullscreen-event-order.html index 72fb2c9b4747..4ed5635861c5 100644 --- a/dom/html/test/file_fullscreen-event-order.html +++ b/dom/html/test/file_fullscreen-event-order.html @@ -2,7 +2,7 @@ - + - + - - - - - -Mozilla Bug 1104916 - - - --- -