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

@ -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>