Bug 1464926 [wpt PR 11206] - Migrate fullscreen to use top layer., a=testonly
authorDave Tapuska <dtapuska@chromium.org>
Wed, 06 Jun 2018 17:16:12 +0000
changeset 422242 51e29cd8e6f6ff25484e45deb11b94bfa2fc2e5a
parent 422241 83e0a828f3cc612b3712f03f6c071589ec454810
child 422243 a404637bd62855f29d5b70dda1e34cde379f0bbb
push id34122
push userebalazs@mozilla.com
push dateMon, 11 Jun 2018 09:37:00 +0000
treeherdermozilla-central@9941eb8c3b29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1464926, 11206, 240576, 1066600, 563065
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fullscreen/api/document-exit-fullscreen-twice-manual.html
testing/web-platform/tests/fullscreen/model/move-to-iframe-manual.html
testing/web-platform/tests/fullscreen/model/move-to-inactive-document-manual.html
testing/web-platform/tests/fullscreen/model/remove-child-manual.html
testing/web-platform/tests/fullscreen/model/remove-first-manual.html
testing/web-platform/tests/fullscreen/model/remove-last-manual.html
testing/web-platform/tests/fullscreen/model/remove-parent-manual.html
testing/web-platform/tests/fullscreen/model/remove-single-manual.html
testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -339442,16 +339442,22 @@
     ]
    ],
    "html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html": [
     [
      "/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html",
      {}
     ]
    ],
+   "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",
      {}
     ]
    ],
    "html/semantics/interactive-elements/the-dialog-element/inert-does-not-match-disabled-selector.html": [
     [
@@ -560702,17 +560708,17 @@
    "12715d90017a74434cfab8276acfab5419d39a7b",
    "manual"
   ],
   "fullscreen/api/document-exit-fullscreen-timing-manual.html": [
    "9102264efe1ef6fb7394bfe987637fef359fc8c9",
    "manual"
   ],
   "fullscreen/api/document-exit-fullscreen-twice-manual.html": [
-   "c6e9696b4cfdef6a7042ccbe9beaddf8c56d8031",
+   "d017b67adff16d1dad2195763bbe88e741ee47ad",
    "manual"
   ],
   "fullscreen/api/document-fullscreen-element-manual.html": [
    "7026a680ddd3f0b3dfbfd75dccbcfb78b88b8ceb",
    "manual"
   ],
   "fullscreen/api/document-fullscreen-enabled-active-document.html": [
    "380e2bef1b6b4ec75dcf041f3ed0185a5805ae44",
@@ -560866,41 +560872,41 @@
    "f6f0dbc8a505896a0e7ec7aca2746bbd5c1eb7d9",
    "testharness"
   ],
   "fullscreen/model/move-to-fullscreen-iframe-manual.html": [
    "62aec7e1d5065bf99a00fc533c8c6d6704ac2010",
    "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": [
    "258b3c119a6a9ea7220a339b0d8e4964b8fb2a5e",
    "manual"
   ],
   "fullscreen/rendering/fullscreen-pseudo-class-support.html": [
    "0cdfe5cf8321b6c46a75a2f75f6224970368d4ae",
@@ -576509,16 +576515,20 @@
   "html/semantics/interactive-elements/the-dialog-element/dialog-return-value.html": [
    "1b77c8ff31c1a38afb3a9fa9bf77bf85ac4a264b",
    "testharness"
   ],
   "html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html": [
    "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"
   ],
   "html/semantics/interactive-elements/the-dialog-element/inert-does-not-match-disabled-selector.html": [
    "f0187a4040dbbd430b6945947475c152f1eeed7b",
    "testharness"
   ],
--- a/testing/web-platform/tests/fullscreen/api/document-exit-fullscreen-twice-manual.html
+++ b/testing/web-platform/tests/fullscreen/api/document-exit-fullscreen-twice-manual.html
@@ -13,17 +13,17 @@ async_test(t => {
     assert_equals(document.fullscreenElement, div);
 
     // Exit fullscreen twice.
     document.exitFullscreen();
     assert_equals(document.fullscreenElement, div, "fullscreenElement after first exitFullscreen()");
     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");
       t.step_timeout(() => {
         // Done, but if a promise was returned, assert that it is resolved and
         // not rejected. This test does not fail if promises aren't implemented.
         if (secondPromise) {
           secondPromise.then(t.step_func_done(), t.unreached_func("second promise rejected"));
--- a/testing/web-platform/tests/fullscreen/model/move-to-iframe-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/move-to-iframe-manual.html
@@ -2,25 +2,29 @@
 <title>Move the fullscreen element to another document</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="../trusted-click.js"></script>
 <div></div>
 <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 => {
     assert_equals(document.fullscreenElement, div);
     assert_equals(event.target, div);
 
     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");
     document.onfullscreenchange = t.step_func_done(event => {
       assert_equals(document.fullscreenElement, null);
       assert_equals(event.target, document);
     });
   });
--- a/testing/web-platform/tests/fullscreen/model/move-to-inactive-document-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/move-to-inactive-document-manual.html
@@ -1,16 +1,17 @@
 <!DOCTYPE html>
 <title>Move the fullscreen element to an inactive document</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="../trusted-click.js"></script>
 <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, "");
     inactiveDocument.appendChild(div);
 
     div.onfullscreenchange = t.unreached_func("fullscreenchange fired on element");
     inactiveDocument.onfullscreenchange = t.unreached_func("fullscreenchange fired on other document");
     document.onfullscreenchange = t.step_func_done();
--- a/testing/web-platform/tests/fullscreen/model/remove-child-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/remove-child-manual.html
@@ -5,22 +5,25 @@
 <script src="../trusted-click.js"></script>
 <div id="log"></div>
 <div id="parent">
     <div></div>
 </div>
 <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.
         t.step_timeout(function()
         {
             requestAnimationFrame(t.step_func_done());
         }, 0);
     });
--- a/testing/web-platform/tests/fullscreen/model/remove-first-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/remove-first-manual.html
@@ -5,29 +5,33 @@
 <script src="../trusted-click.js"></script>
 <div id="log"></div>
 <div id="first">
     <div id="last"></div>
 </div>
 <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)
     {
         assert_equals(document.fullscreenElement, first);
         assert_equals(event.target, first);
         var last = document.getElementById("last");
         trusted_request(t, last);
         document.onfullscreenchange = t.step_func(function(event)
         {
             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);
                 assert_equals(event.target, document);
             });
         });
     });
 });
--- a/testing/web-platform/tests/fullscreen/model/remove-last-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/remove-last-manual.html
@@ -5,30 +5,36 @@
 <script src="../trusted-click.js"></script>
 <div id="log"></div>
 <div id="first">
     <div id="last"></div>
 </div>
 <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)
     {
         assert_equals(document.fullscreenElement, first);
         assert_equals(event.target, first);
         var last = document.getElementById("last");
         trusted_request(t, last);
         document.onfullscreenchange = t.step_func(function(event)
         {
             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);
             });
         });
     });
 });
 </script>
--- a/testing/web-platform/tests/fullscreen/model/remove-parent-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/remove-parent-manual.html
@@ -5,23 +5,27 @@
 <script src="../trusted-click.js"></script>
 <div id="log"></div>
 <div>
     <div id="child"></div>
 </div>
 <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)
     {
         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);
             assert_equals(event.target, document);
         });
     });
 });
 </script>
--- a/testing/web-platform/tests/fullscreen/model/remove-single-manual.html
+++ b/testing/web-platform/tests/fullscreen/model/remove-single-manual.html
@@ -3,22 +3,26 @@
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="../trusted-click.js"></script>
 <div id="log"></div>
 <div id="single"></div>
 <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);
             assert_equals(event.target, document);
         });
     });
     trusted_request(t, single);
 });
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html
@@ -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>