diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-03 19:52:43 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-04 21:32:09 +0800 |
commit | 60d420fe715cbdd8e2db5bad0a390312383ca0a3 (patch) | |
tree | 71d77be8a91e7fbf2d58c2f0cca491785e4139a5 /dom/html | |
parent | 9e2c43705b62ecd6d1e6271d6072859c73957b34 (diff) | |
download | uxp-60d420fe715cbdd8e2db5bad0a390312383ca0a3.tar.gz |
Issue #2135 - Bug 1430305: Implement ShadowRoot.fullscreenElement
Diffstat (limited to 'dom/html')
-rw-r--r-- | dom/html/test/file_fullscreen-shadowdom.html | 52 | ||||
-rw-r--r-- | dom/html/test/mochitest.ini | 1 | ||||
-rw-r--r-- | dom/html/test/test_fullscreen-api.html | 4 |
3 files changed, 56 insertions, 1 deletions
diff --git a/dom/html/test/file_fullscreen-shadowdom.html b/dom/html/test/file_fullscreen-shadowdom.html new file mode 100644 index 0000000000..efc7fe8f5f --- /dev/null +++ b/dom/html/test/file_fullscreen-shadowdom.html @@ -0,0 +1,52 @@ +<!DOCTYPE HTML> +<html> + <!-- + https://bugzilla.mozilla.org/show_bug.cgi?id=1430305 + Bug 1430305 - Implement ShadowRoot.fullscreenElement + --> + <head> + <title>Bug 1430305</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"> + </script> + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"> + </script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + </head> + <body> + <a target="_blank" + href="https://bugzilla.mozilla.org/show_bug.cgi?id=1430305"> + Mozilla Bug 1430305</a> + + <div id="host"></div> + + <pre id="test"> + <script type="application/javascript"> + + function begin() { + var host = document.getElementById("host"); + var shadowRoot = host.attachShadow({mode: "open"}); + shadowRoot.innerHTML = "<div>test</div>"; + var elem = shadowRoot.firstChild; + var gotFullscreenEvent = false; + + document.addEventListener("fullscreenchange", function (e) { + if (document.fullscreenElement === host) { + is(shadowRoot.fullscreenElement, elem, + "Expected element entered fullsceen"); + gotFullscreenEvent = true; + document.exitFullscreen(); + } else { + opener.ok(gotFullscreenEvent, "Entered fullscreen as expected"); + is(shadowRoot.fullscreenElement, null, + "Shouldn't have fullscreenElement anymore."); + is(document.fullscreenElement, null, + "Shouldn't have fullscreenElement anymore."); + opener.nextTest(); + } + }); + elem.requestFullscreen(); + } + </script> + </pre> + </body> +</html> diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index dcbb73840a..a0cc7b77f8 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -72,6 +72,7 @@ support-files = file_fullscreen-rollback.html file_fullscreen-scrollbar.html file_fullscreen-selector.html + file_fullscreen-shadowdom.html file_fullscreen-svg-element.html file_fullscreen-top-layer.html file_fullscreen-unprefix-disabled-inner.html diff --git a/dom/html/test/test_fullscreen-api.html b/dom/html/test/test_fullscreen-api.html index 1ac5b3b517..e269c67ad4 100644 --- a/dom/html/test/test_fullscreen-api.html +++ b/dom/html/test/test_fullscreen-api.html @@ -39,6 +39,7 @@ var gTestWindows = [ "file_fullscreen-navigation.html", "file_fullscreen-scrollbar.html", "file_fullscreen-selector.html", + "file_fullscreen-shadowdom.html", "file_fullscreen-top-layer.html", "file_fullscreen-backdrop.html", "file_fullscreen-nested.html", @@ -96,7 +97,8 @@ addLoadEvent(function() { ["full-screen-api.unprefix.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"] + ["full-screen-api.transition-duration.leave", "0 0"], + ["dom.webcomponents.enabled", true] ]}, nextTest); }); SimpleTest.waitForExplicitFinish(); |