Add support for fullscreen #10102

This commit is contained in:
Jansen Jan 2016-12-08 14:02:08 +01:00
parent c3c086e521
commit 55f0e56224
33 changed files with 454 additions and 30 deletions

View file

@ -21,6 +21,8 @@ skip: true
skip: false
[FileAPI]
skip: false
[fullscreen]
skip: false
[hr-time]
skip: false
[html]

View file

@ -1305,9 +1305,6 @@
[HTMLIFrameElement interface: attribute seamless]
expected: FAIL
[HTMLIFrameElement interface: attribute allowFullscreen]
expected: FAIL
[HTMLIFrameElement interface: attribute align]
expected: FAIL

View file

@ -1,8 +1,5 @@
[iframe-allowfullscreen.html]
type: testharness
[iframe-allowfullscreen]
expected: FAIL
[iframe-sandbox-allowfullscreen]
expected: FAIL

View file

@ -8132,6 +8132,12 @@
"url": "/_mozilla/mozilla/form_tab_keyevent.html"
}
],
"mozilla/fullscreen-remove-single.html": [
{
"path": "mozilla/fullscreen-remove-single.html",
"url": "/_mozilla/mozilla/fullscreen-remove-single.html"
}
],
"mozilla/getBoundingClientRect.html": [
{
"path": "mozilla/getBoundingClientRect.html",

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>Remove the single element on the fullscreen element stack</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="single"></div>
<script>
async_test(function(t)
{
var single = document.getElementById("single");
document.onfullscreenchange = t.step_func(function()
{
assert_equals(document.fullscreenElement, single);
document.onfullscreenchange = t.step_func(function()
{
assert_equals(document.fullscreenElement, null);
t.done();
});
single.remove();
});
single.requestFullscreen();
});
</script>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View file

@ -3,15 +3,23 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe></iframe>
<iframe allowfullscreen></iframe>
<iframe src="blank.html"></iframe>
<iframe allowfullscreen src="blank.html"></iframe>
<script>
test(function()
async_test(function(t)
{
assert_true(document.fullscreenEnabled, "top-level document");
var iframes = document.getElementsByTagName("iframe");
assert_false(iframes[0].contentDocument.fullscreenEnabled, "iframe without allowfullscreen");
assert_true(iframes[1].contentDocument.fullscreenEnabled, "iframe with allowfullscreen");
var loaded = 0;
iframes[0].onload = t.step_func(function() {
assert_false(iframes[0].contentDocument.fullscreenEnabled, "iframe without allowfullscreen");
if (++loaded == 2) t.done();
});
iframes[1].onload = t.step_func(function() {
assert_true(iframes[1].contentDocument.fullscreenEnabled, "iframe with allowfullscreen");
if (++loaded == 2) t.done();
});
});
</script>

View file

@ -6,8 +6,13 @@
<script>
async_test(function(t)
{
var sync = true;
assert_equals(document.onfullscreenerror, null, "initial onfullscreenerror");
document.onfullscreenerror = t.step_func_done();
document.createElement("a").requestFullscreen();
document.onfullscreenerror = t.step_func_done(function(event) {
assert_false(sync);
});
var e = document.createElement('span');
e.requestFullscreen();
sync = false;
});
</script>