Skip to content

Commit

Permalink
Disallow dialog.requestFullscreen() (includes web-platform-tests)
Browse files Browse the repository at this point in the history
Follows whatwg/fullscreen#104

The compat risk is virtually none given how rarely this happens:
https://www.chromestatus.com/metrics/feature/timeline/popularity/1998
https://www.chromestatus.com/metrics/feature/timeline/popularity/1999

Bug: 240576
Change-Id: Ifcd793251d50cd40fc2fc5ef5ee50343f0aac35f
Reviewed-on: https://chromium-review.googlesource.com/684435
Reviewed-by: Takayoshi Kochi <[email protected]>
Commit-Queue: Philip Jägenstedt <[email protected]>
Cr-Commit-Position: refs/heads/master@{#505007}
  • Loading branch information
foolip authored and chromium-wpt-export-bot committed Sep 28, 2017
1 parent 0f1ee41 commit 37f4e33
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
assert_equals(document.fullscreenElement, target);
assert_equals(target.parentNode, moveTo);
});
document.onfullscreenerror = t.unreached_func("fullscreenchange event");
document.onfullscreenerror = t.unreached_func("fullscreenerror event");

trusted_click(t, () => {
target.requestFullscreen();
Expand Down
16 changes: 16 additions & 0 deletions fullscreen/api/element-request-fullscreen-dialog-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Element#requestFullscreen() for dialog element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<dialog></dialog>
<script>
async_test(t => {
var dialog = document.querySelector("dialog");
assert_true(dialog instanceof HTMLDialogElement);
trusted_request(t, dialog);
document.onfullscreenchange = t.unreached_func("fullscreenchange event");
document.onfullscreenerror = t.step_func_done();
});
</script>
16 changes: 16 additions & 0 deletions fullscreen/api/element-request-fullscreen-null-ns-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Element#requestFullscreen() for an element in null namespace</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<script>
async_test(t => {
const element = document.createElementNS(null, 'a');
assert_equals(Object.getPrototypeOf(element), Element.prototype);
document.body.appendChild(element);
trusted_request(t, element);
document.onfullscreenchange = t.unreached_func("fullscreenchange event");
document.onfullscreenerror = t.step_func_done();
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var rect = document.querySelector("rect");
assert_true(rect instanceof SVGRectElement);
trusted_request(t, rect, document.body);
document.onfullscreenchange = t.unreached_func("fullscreenerror event");
document.onfullscreenchange = t.unreached_func("fullscreenchange event");
document.onfullscreenerror = t.step_func_done();
});
</script>

0 comments on commit 37f4e33

Please sign in to comment.