Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test active document check for requestFullscreen #4334

Merged
merged 4 commits into from
Dec 15, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions fullscreen/api/active-document-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>Element ready check for containing iframe, element's document is not the active document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<iframe allowfullscreen></iframe>
<script>
async_test((t) => {
onload = () => {
var iframes = document.getElementsByTagName("iframe");
trusted_request(iframes[0].contentDocument.body, document.body);
window[0].location.href = '/common/blank.html';
iframes[0].contentDocument.onfullscreenchange = t.unreached_func("fullscreenchange event");
iframes[0].contentDocument.onfullscreenerror = t.step_func_done();
Copy link
Member

@upsuper upsuper Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wait. This is wrong. iframes[0].contentDocument is a different than the previous document you request fullscreen on, so these events are never triggered.

You need to record the previous document and set event handlers on that.

Also, shouldn't it be easier to just check document.fullscreenEnabled?

};
});
</script>