Bug 1464926 [wpt PR 11206] - Migrate fullscreen to use top layer., a=testonly

Automatic update from web-platform-testsMigrate fullscreen to use top layer.

Previous attempts of adding and removing to the top layer were done
synchronously. The spec has been updated to do this asynchronously and
this change matches those changes.

Bug: 240576
Change-Id: Ic57a651596c685daa4b32d78421de5db912c106e
Reviewed-on: https://chromium-review.googlesource.com/1066600
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563065}

--

wpt-commits: 1829a42c93e435937db68c8a842fa9b56dd39dc2
wpt-pr: 11206
This commit is contained in:
Dave Tapuska 2018-06-06 17:16:12 +00:00 коммит произвёл James Graham
Родитель 5224d12b8a
Коммит 148e2a6b71
10 изменённых файлов: 70 добавлений и 10 удалений

Просмотреть файл

@ -339447,6 +339447,12 @@
{}
]
],
"html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html": [
[
"/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html",
{}
]
],
"html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html": [
[
"/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html",
@ -560707,7 +560713,7 @@
"manual"
],
"fullscreen/api/document-exit-fullscreen-twice-manual.html": [
"c6e9696b4cfdef6a7042ccbe9beaddf8c56d8031",
"d017b67adff16d1dad2195763bbe88e741ee47ad",
"manual"
],
"fullscreen/api/document-fullscreen-element-manual.html": [
@ -560871,31 +560877,31 @@
"manual"
],
"fullscreen/model/move-to-iframe-manual.html": [
"818cb1b5db729db4959591dc75d4bb1ae3c7542d",
"7d591d11ce4a399156ed7cae7ddbee93aa8cb883",
"manual"
],
"fullscreen/model/move-to-inactive-document-manual.html": [
"552d65141acc2221e8407316c02e0d4cf17db7eb",
"e3f8160bd2457bfb2797f85aed082f865ae6ad78",
"manual"
],
"fullscreen/model/remove-child-manual.html": [
"b1142930c6c972057213bd477cf116fcc9e7fc2a",
"0b19b1bbb6040b4ca6280bba0f742680856c5b9a",
"manual"
],
"fullscreen/model/remove-first-manual.html": [
"3de98ae96822370fa80c1b8d61df254910a63ff9",
"b694dcf40492ec67239f19152779794acde3fe4a",
"manual"
],
"fullscreen/model/remove-last-manual.html": [
"8caa21a892edeaba9996a7f2bf1c670385e0a91b",
"5c425c386688bf38a8b26ba25c43923e128db88e",
"manual"
],
"fullscreen/model/remove-parent-manual.html": [
"e5791db04ab5e2b75a00c922457fcc8ba87c7ce7",
"c0f0103c9e4491ef04b016f7bbacd8564ea5493d",
"manual"
],
"fullscreen/model/remove-single-manual.html": [
"c7fc8323d503adb6d7f0c390a8add90c5c9e8082",
"64bf88ae3a1a3708dfe823d85f67636ae5b0d736",
"manual"
],
"fullscreen/rendering/fullscreen-pseudo-class-manual.html": [
@ -576514,6 +576520,10 @@
"529cf6c2cf2daf031f7d41aef93e6f5645e30ec2",
"testharness"
],
"html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html": [
"86aef9d34903bf33c036cd8eabb4078b98cbe4d9",
"testharness"
],
"html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html": [
"c00ac5b6d038b45b1a7cfbef94a4527757fa74e6",
"testharness"

Просмотреть файл

@ -18,7 +18,7 @@ async_test(t => {
const secondPromise = document.exitFullscreen();
assert_equals(document.fullscreenElement, div, "fullscreenElement after second exitFullscreen()");
document.onfullscreenchange = t.step_func(() => {
document.onfullscreenchange = t.step_func(event => {
assert_equals(document.fullscreenElement, null);
// Ensure that there's only one fullscreenchange event.
document.onfullscreenchange = t.unreached_func("second fullscreenchange event");

Просмотреть файл

@ -7,6 +7,7 @@
<iframe></iframe>
<script>
async_test(t => {
t.add_cleanup(() => document.exitFullscreen());
const div = document.querySelector("div");
const iframe = document.querySelector("iframe");
document.onfullscreenchange = t.step_func(event => {
@ -16,6 +17,9 @@ async_test(t => {
assert_equals(div.ownerDocument, document);
iframe.contentDocument.body.appendChild(div);
assert_not_equals(div.ownerDocument, document);
// Moving /div/ removes it from the top layer and thus the fullscreen
// element synchronously becomes null.
assert_equals(document.fullscreenElement, null);
div.onfullscreenchange = t.unreached_func("fullscreenchange fired on element");
iframe.contentDocument.onfullscreenchange = t.unreached_func("fullscreenchange fired on other document");

Просмотреть файл

@ -6,6 +6,7 @@
<div></div>
<script>
async_test(t => {
t.add_cleanup(() => document.exitFullscreen());
const div = document.querySelector("div");
document.onfullscreenchange = t.step_func(event => {
const inactiveDocument = document.implementation.createDocument(null, "");

Просмотреть файл

@ -10,12 +10,15 @@
<script>
async_test(function(t)
{
t.add_cleanup(() => document.exitFullscreen());
var parent = document.getElementById("parent");
trusted_request(t, parent);
document.onfullscreenchange = t.step_func(function()
{
assert_equals(document.fullscreenElement, parent);
parent.textContent = ""; // removes all children
// The fullscreen element should not be affected.
assert_equals(document.fullscreenElement, parent);
document.onfullscreenchange = t.unreached_func("fullscreenchange event");
// A fullscreenchange event would be fired after an async section
// and an animation frame task, so wait until after that.

Просмотреть файл

@ -10,6 +10,7 @@
<script>
async_test(function(t)
{
t.add_cleanup(() => document.exitFullscreen());
var first = document.getElementById("first");
trusted_request(t, first);
document.onfullscreenchange = t.step_func(function(event)
@ -23,6 +24,9 @@ async_test(function(t)
assert_equals(document.fullscreenElement, last);
assert_equals(event.target, last);
first.remove();
// Both /first/ and /last/ were removed from the top layer and
// thus the fullscreen element synchronously becomes null.
assert_equals(document.fullscreenElement, null);
document.onfullscreenchange = t.step_func_done(function(event)
{
assert_equals(document.fullscreenElement, null);

Просмотреть файл

@ -10,6 +10,7 @@
<script>
async_test(function(t)
{
t.add_cleanup(() => document.exitFullscreen());
var first = document.getElementById("first");
trusted_request(t, first);
document.onfullscreenchange = t.step_func(function(event)
@ -23,9 +24,14 @@ async_test(function(t)
assert_equals(document.fullscreenElement, last);
assert_equals(event.target, last);
last.remove();
// Because /last/ was removed from the top layer, we exit
// fullscreen element synchronously.
assert_equals(document.fullscreenElement, first);
document.onfullscreenchange = t.step_func_done(function(event)
{
assert_equals(document.fullscreenElement, first);
// fullscreen change element should be queued against the
// document target.
assert_equals(document.fullscreenElement, null);
assert_equals(event.target, document);
});
});

Просмотреть файл

@ -10,6 +10,7 @@
<script>
async_test(function(t)
{
t.add_cleanup(() => document.exitFullscreen());
var child = document.getElementById("child");
trusted_request(t, child);
document.onfullscreenchange = t.step_func(function(event)
@ -17,6 +18,9 @@ async_test(function(t)
assert_equals(document.fullscreenElement, child);
assert_equals(event.target, child);
child.parentNode.remove();
// Because /child/ was removed from the top layer, the fullscreen
// element becomes null synchronously.
assert_equals(document.fullscreenElement, null);
document.onfullscreenchange = t.step_func_done(function(event)
{
assert_equals(document.fullscreenElement, null);

Просмотреть файл

@ -8,12 +8,16 @@
<script>
async_test(function(t)
{
t.add_cleanup(() => document.exitFullscreen());
var single = document.getElementById("single");
document.onfullscreenchange = t.step_func(function(event)
{
assert_equals(document.fullscreenElement, single);
assert_equals(event.target, single);
single.remove();
// Because /single/ was removed from the top layer, the fullscreen
// element becomes null synchronously.
assert_equals(document.fullscreenElement, null);
document.onfullscreenchange = t.step_func_done(function(event)
{
assert_equals(document.fullscreenElement, null);

Просмотреть файл

@ -0,0 +1,24 @@
<!doctype html>
<title>dialog element: removing from document after showModal()</title>
<link rel=help href="https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal">
<link rel=help href="https://fullscreen.spec.whatwg.org/#removing-steps">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<dialog></dialog>
<script>
async_test(t => {
const dialog = document.querySelector('dialog')
dialog.showModal()
assert_true(dialog.open)
// The dialog element is now in top layer. Removing it should synchronously
// remove it from top layer, but should leave it in a strange limbo state.
dialog.addEventListener('close', t.unreached_func('close event'))
dialog.remove()
assert_true(dialog.open)
// if an event was queued, it would fire before this timeout
step_timeout(t.step_func_done(() => {
assert_true(dialog.open)
// pass if no close event was fired
}))
})
</script>