diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/html/semantics/popovers | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers')
9 files changed, 109 insertions, 40 deletions
diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html index 435929a6c1..4312a156ce 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html @@ -42,6 +42,7 @@ window.addEventListener('load', runTest); background: orange; } [popover] { + inset: auto; background: lime; padding:0; border:0; diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html index 55a11fafdb..8db022b126 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html @@ -15,6 +15,7 @@ display: none; } [popover] { + inset: auto; background: lime; padding: 0; border: 0; diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display.tentative.html index bddc44006d..a713540094 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-display.tentative.html @@ -61,6 +61,7 @@ showDefaultopenPopoversOnLoad(); background: orange; } [popover] { + inset: auto; background: lime; padding:0; border:0; diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html index 2c6b0bafb9..a301032a5b 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html @@ -40,6 +40,7 @@ background: orange; } [popover] { + inset: auto; background: lime; padding:0; border:0; diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html index ae2a3a8e41..f6220f3c76 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html @@ -13,6 +13,7 @@ body { } #target { + inset: auto; transition: display 2s; } </style> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-focus-2.html b/testing/web-platform/tests/html/semantics/popovers/popover-focus-2.html index 892e5fd68f..8f24ace919 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-focus-2.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-focus-2.html @@ -80,7 +80,7 @@ promise_test(async t => { assert_equals(document.activeElement,invoker2,'Focus should move within popover'); await sendShiftTab(); await sendShiftTab(); - assert_equals(document.activeElement, button1 ,'Focus should not move back to invoker as it is non-focusable'); + assert_equals(document.activeElement,invoker0,'Focus should not move back to invoker as it is non-focusable'); // Reset invoker1 to focusable. invoker1.disabled = false; await verifyFocusOrder([button1, button2, invoker0, invoker1, inside_popover1, invoker2, inside_popover2, button3, button4],'set 1'); diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-hover-crash-hang.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-hover-crash-hang.tentative.html new file mode 100644 index 0000000000..60309398db --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/popover-hover-crash-hang.tentative.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Crash/hang test for popover hover behavior</title> +<link rel="author" href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popover-hint.research.explainer/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="resources/popover-utils.js"></script> + +<div id=menu popover=manual> + Popover + <button popovertarget="submenu"><span id=button>Button</span> + <div id=submenu popover=manual>Button-contained popover</div> + </button> +</div> +<button id=unrelated>Unrelated</button> + +<script> + promise_test(async (t) => { + menu.showPopover(); + assert_true(menu.matches(':popover-open')); + await mouseHover(button,100); + button.click(); + assert_true(menu.matches(':popover-open')); + assert_true(submenu.matches(':popover-open')); + await mouseHover(submenu,100); + await mouseHover(unrelated,100); + assert_true(submenu.matches(':popover-open')); + // This test passes if nothing crashes/hangs. + },'crash test'); +</script> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-scroll-within.html b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-scroll-within.html new file mode 100644 index 0000000000..2329aea201 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-scroll-within.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Popover light dismiss behavior when scrolled within</title> +<meta name="timeout" content="long"> +<link rel="author" href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popover.research.explainer"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="resources/popover-utils.js"></script> + +<style> + [popover] { + /* Position most popovers at the bottom-right, out of the way */ + inset:auto; + bottom:0; + right:0; + } + [popover]::backdrop { + /* This should *not* affect anything: */ + pointer-events: auto; + } +</style> + +<div popover id=p>Inside popover + <div style="height:2000px;background:lightgreen"></div> + Bottom of popover6 +</div> +<button popovertarget=p>Popover</button> +<style> + #p6 { + width: 300px; + height: 300px; + overflow-y: scroll; + } +</style> +<script> + const popover = document.querySelector('#p'); + promise_test(async () => { + popover.showPopover(); + assert_equals(popover.scrollTop,0,'popover should start non-scrolled'); + await new test_driver.Actions() + .scroll(0, 0, 0, 50, {origin: popover}) + .send(); + await waitForRender(); + assert_true(popover.matches(':popover-open'),'popover should stay open'); + assert_equals(popover.scrollTop,50,'popover should be scrolled'); + popover.hidePopover(); + },'Scrolling within a popover should not close the popover'); +</script> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html index 45db242e91..78b8674513 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html @@ -303,33 +303,6 @@ },'An invoking element that was not used to invoke the popover is not part of the ancestor chain'); </script> -<div popover id=p6>Inside popover 6 - <div style="height:2000px;background:lightgreen"></div> - Bottom of popover6 -</div> -<button popovertarget=p6>Popover 6</button> -<style> - #p6 { - width: 300px; - height: 300px; - overflow-y: scroll; - } -</style> -<script> - const popover6 = document.querySelector('#p6'); - promise_test(async () => { - popover6.showPopover(); - assert_equals(popover6.scrollTop,0,'popover6 should start non-scrolled'); - await new test_driver.Actions() - .scroll(0, 0, 0, 50, {origin: popover6}) - .send(); - await waitForRender(); - assert_true(popover6.matches(':popover-open'),'popover6 should stay open'); - assert_equals(popover6.scrollTop,50,'popover6 should be scrolled'); - popover6.hidePopover(); - },'Scrolling within a popover should not close the popover'); -</script> - <my-element id="myElement"> <template shadowrootmode="open"> <button id=b7 popovertarget=p7 popovertargetaction=show tabindex="0">Popover7</button> @@ -602,18 +575,26 @@ promise_test(async () => { p29.showPopover(); assert_true(p29.matches(':popover-open'),'showing'); let actions = new test_driver.Actions(); - await actions.pointerMove(0,0,{origin: b29}) + // Using the iframe's contentDocument as the origin would throw an error, so + // we are using iframe29 as the origin instead. + const iframe_box = iframe29.getBoundingClientRect(); + + await actions + .pointerMove(1,1,{origin: b29}) .pointerDown({button: actions.ButtonType.LEFT}) + .pointerMove(iframe_box.width / 2, iframe_box.height / 2, {origin: iframe29}) + .pointerUp({button: actions.ButtonType.LEFT}) .send(); - await waitForRender(); - assert_true(p29.matches(':popover-open'),'showing after pointerdown'); + assert_true(p29.matches(':popover-open'), 'popover should be open after pointerUp in iframe.'); actions = new test_driver.Actions(); - await actions.pointerMove(0,0,{origin: iframe29.contentDocument.body}) + await actions + .pointerMove(iframe_box.width / 2, iframe_box.height / 2, {origin: iframe29}) + .pointerDown({button: actions.ButtonType.LEFT}) + .pointerMove(1,1,{origin: b29}) .pointerUp({button: actions.ButtonType.LEFT}) .send(); - await waitForRender(); - assert_true(p29.matches(':popover-open'),'showing after pointerup'); + assert_true(p29.matches(':popover-open'), 'popover should be open after pointerUp on main frame button.'); },`Pointer down in one document and pointer up in another document shouldn't dismiss popover`); </script> @@ -626,13 +607,10 @@ promise_test(async () => { p30.showPopover(); assert_true(p30.matches(':popover-open'),'showing'); let actions = new test_driver.Actions(); - await actions.pointerMove(0,0,{origin: b30}) + await actions + .pointerMove(2,2,{origin: b30}) .pointerDown({button: actions.ButtonType.LEFT}) - .send(); - await waitForRender(); - assert_true(p30.matches(':popover-open'),'showing after pointerdown'); - actions = new test_driver.Actions(); - await actions.pointerMove(0,0,{origin: b30b}) + .pointerMove(2,2,{origin: b30b}) .pointerUp({button: actions.ButtonType.LEFT}) .send(); await waitForRender(); |