mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Add support for fullscreen #10102
This commit is contained in:
parent
c3c086e521
commit
55f0e56224
33 changed files with 454 additions and 30 deletions
|
@ -21,6 +21,8 @@ skip: true
|
|||
skip: false
|
||||
[FileAPI]
|
||||
skip: false
|
||||
[fullscreen]
|
||||
skip: false
|
||||
[hr-time]
|
||||
skip: false
|
||||
[html]
|
||||
|
|
|
@ -1305,9 +1305,6 @@
|
|||
[HTMLIFrameElement interface: attribute seamless]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLIFrameElement interface: attribute allowFullscreen]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLIFrameElement interface: attribute align]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
[iframe-allowfullscreen.html]
|
||||
type: testharness
|
||||
[iframe-allowfullscreen]
|
||||
expected: FAIL
|
||||
|
||||
[iframe-sandbox-allowfullscreen]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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>
|
10
tests/wpt/web-platform-tests/fullscreen/api/blank.html
Normal file
10
tests/wpt/web-platform-tests/fullscreen/api/blank.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue