
These shipped in M71. BUG=829937,383813 Change-Id: I7e221ad086b637f2031e7ad9a8092f4c38ce9a8a Reviewed-on: https://chromium-review.googlesource.com/c/1478487 Reviewed-by: Andrew Grieve <agrieve@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#634671}
45 lines
1.4 KiB
HTML
45 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<script src='../resources/testharness.js'></script>
|
|
<script src='../resources/testharnessreport.js'></script>
|
|
<script src='resources/shadow-dom.js'></script>
|
|
<script src='../fullscreen/trusted-click.js'></script>
|
|
|
|
<div id='host0'>
|
|
<template data-mode='open'>
|
|
<canvas></canvas>
|
|
</template>
|
|
</div>
|
|
|
|
<script>
|
|
convertTemplatesToShadowRootsWithin(host0);
|
|
|
|
async_test((test) => {
|
|
document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.');
|
|
|
|
// All fullscreenElement should default to null.
|
|
assert_equals(document.fullscreenElement, null);
|
|
assert_equals(document.webkitFullscreenElement, null);
|
|
assert_equals(document.webkitCurrentFullScreenElement, null);
|
|
assert_equals(host0.shadowRoot.fullscreenElement, null);
|
|
|
|
var canvas = host0.shadowRoot.querySelector('canvas');
|
|
trusted_request(test, canvas);
|
|
|
|
document.onfullscreenchange = test.step_func(() => {
|
|
// Not interested in handling before or after exitFullscreen.
|
|
if (document.fullscreenElement === null)
|
|
return;
|
|
|
|
assert_equals(document.fullscreenElement, host0);
|
|
assert_equals(document.webkitFullscreenElement, host0);
|
|
assert_equals(document.webkitCurrentFullScreenElement, host0);
|
|
|
|
assert_equals(host0.shadowRoot.fullscreenElement, canvas);
|
|
|
|
document.exitFullscreen();
|
|
test.done();
|
|
});
|
|
|
|
}, 'Test for fullscreenElement adjustment for single shadow tree.');
|
|
</script>
|