From 88e447abde020fbb26c5d250b8ac0616aca4b95f Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Wed, 17 May 2023 13:49:08 +0000 Subject: [PATCH] Bug 1831162 [wpt PR 39828] - Add a test for fullscreen for the A/B/A case, a=testonly Automatic update from web-platform-tests Add a test for fullscreen for the A/B/A case See the discussion at [1] for more context. This test requests fullscreen on A, then B, then A, where A and B are sibling divs. All three requests should succeed, and at the end, A should be topmost (and the fullscreen element) with both A and B in the top layer. [1] https://github.com/whatwg/fullscreen/pull/223 Change-Id: I3f35dda5b9eb1bc24201616bb5bb4949d20fd170 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4501251 Commit-Queue: Mason Freed Reviewed-by: Joey Arhar Auto-Submit: Mason Freed Cr-Commit-Position: refs/heads/main@{#1141456} -- wpt-commits: bf4540b22b7a2a6939d8cf7468c4ce76e48c3fef wpt-pr: 39828 --- .../fullscreen/api/fullscreen-reordering.html | 62 +++++++++++++++++++ .../popovers/resources/popover-utils.js | 16 +++++ 2 files changed, 78 insertions(+) create mode 100644 testing/web-platform/tests/fullscreen/api/fullscreen-reordering.html diff --git a/testing/web-platform/tests/fullscreen/api/fullscreen-reordering.html b/testing/web-platform/tests/fullscreen/api/fullscreen-reordering.html new file mode 100644 index 0000000000000..1a286c32c7703 --- /dev/null +++ b/testing/web-platform/tests/fullscreen/api/fullscreen-reordering.html @@ -0,0 +1,62 @@ + +Re-requesting fullscreen doesn't fail but doesn't change order + + + + + + +
+
Element A
+
Element B
+
+ + + + diff --git a/testing/web-platform/tests/html/semantics/popovers/resources/popover-utils.js b/testing/web-platform/tests/html/semantics/popovers/resources/popover-utils.js index 39de6aa99b1fc..aa69b7d41ae03 100644 --- a/testing/web-platform/tests/html/semantics/popovers/resources/popover-utils.js +++ b/testing/web-platform/tests/html/semantics/popovers/resources/popover-utils.js @@ -47,6 +47,22 @@ async function sendEnter() { function isElementVisible(el) { return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); } +function isTopLayer(el) { + // A bit of a hack. Just test a few properties of the ::backdrop pseudo + // element that change when in the top layer. + const properties = ['right','background']; + const testEl = document.createElement('div'); + document.body.appendChild(testEl); + const computedStyle = getComputedStyle(testEl, '::backdrop'); + const nonTopLayerValues = properties.map(p => computedStyle[p]); + testEl.remove(); + for(let i=0;i animation.finish()); await waitForRender();