diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers')
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/button-type-reset-popovertarget.tentative.html | 43 | ||||
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-anchor-display.tentative.html | 4 | ||||
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html | 2 | ||||
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html | 52 | ||||
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.html (renamed from testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.tentative.html) | 0 |
5 files changed, 89 insertions, 12 deletions
diff --git a/testing/web-platform/tests/html/semantics/popovers/button-type-reset-popovertarget.tentative.html b/testing/web-platform/tests/html/semantics/popovers/button-type-reset-popovertarget.tentative.html new file mode 100644 index 0000000000..975eab0d66 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/button-type-reset-popovertarget.tentative.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://issues.chromium.org/issues/329118508"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<div id=mypopover popover=auto>popover</div> + +<iframe name=foo></iframe> +<form target=foo action="about:blank"> + <button id=reset-in-form type=reset popovertarget=mypopover>reset</button> + <button id=submit-in-form type=submit popovertarget=mypopover>submit</button> + <button id=button-in-form type=button popovertarget=mypopover>type=button</button> +</form> + +<button id=reset-outside-form type=reset popovertarget=mypopover>reset</button> +<button id=submit-outside-form type=submit popovertarget=mypopover>submit</button> +<button id=button-outside-form type=button popovertarget=mypopover>type=button</button> + +<script> +test(() => { + const testButton = (id, expectedToToggle) => { + document.getElementById(id).click(); + if (expectedToToggle) { + assert_true(mypopover.matches(':popover-open'), + `${id}: button should open the popover.`); + } else { + assert_false(mypopover.matches(':popover-open'), + `${id}: button should not open the popover.`); + } + if (mypopover.matches(':popover-open')) { + mypopover.hidePopover(); + } + }; + + testButton('reset-in-form', false); + testButton('submit-in-form', false); + testButton('button-in-form', true); + testButton('reset-outside-form', true); + testButton('submit-outside-form', true); + testButton('button-outside-form', true); +}, 'Button type=reset and type=submit should not run popover algorithms when in a form.'); +</script> 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 d50dd6c857..bddc44006d 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 @@ -94,7 +94,7 @@ showDefaultopenPopoversOnLoad(); top: anchor(top); } #popover5 { - anchor-default: --anchor1; /* shouldn't be used */ + position-anchor: --anchor1; /* shouldn't be used */ left: anchor(implicit right); top: anchor(implicit top); } @@ -102,7 +102,7 @@ showDefaultopenPopoversOnLoad(); anchor-name: --anchor6; } #popover6 { - anchor-default: --anchor6; + position-anchor: --anchor6; left: anchor(right); /* shouldn't use the implicit anchor */ top: anchor(top); } 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 7ed6cf1adf..2c6b0bafb9 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 @@ -56,7 +56,7 @@ anchor-name: --anchor2; } #popover2 { - anchor-default: --anchor2; + position-anchor: --anchor2; left: anchor(right); top: anchor(top); } 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 916d52ef5e..45db242e91 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 @@ -11,6 +11,19 @@ <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> + <button id=b1t popovertarget='p1'>Popover 1</button> <button id=b1s popovertarget='p1' popovertargetaction=show>Popover 1</button> <span id=outside>Outside all popovers</span> @@ -26,11 +39,6 @@ <style> #p1 {top: 50px;} #p2 {top: 120px;} - [popover] {bottom:auto;} - [popover]::backdrop { - /* This should *not* affect anything: */ - pointer-events: auto; - } </style> <script> const popover1 = document.querySelector('#p1'); @@ -584,24 +592,50 @@ promise_test(async () => { <div id=p29 popover>Popover 29</div> <button id=b29 popovertarget=p29>Open popover 29</button> -<iframe id=iframe29 width=100 height=100></iframe> +<iframe id=iframe29 width=100 height=30></iframe> <script> promise_test(async () => { let iframe_url = (new URL("/common/blank.html", location.href)).href; iframe29.src = iframe_url; iframe29.contentDocument.body.style.height = '100%'; - assert_false(p29.matches(':popover-open')); + assert_false(p29.matches(':popover-open'),'initially hidden'); p29.showPopover(); - assert_true(p29.matches(':popover-open')); + assert_true(p29.matches(':popover-open'),'showing'); let actions = new test_driver.Actions(); await actions.pointerMove(0,0,{origin: b29}) .pointerDown({button: actions.ButtonType.LEFT}) .send(); + await waitForRender(); + assert_true(p29.matches(':popover-open'),'showing after pointerdown'); actions = new test_driver.Actions(); await actions.pointerMove(0,0,{origin: iframe29.contentDocument.body}) .pointerUp({button: actions.ButtonType.LEFT}) .send(); - assert_true(p29.matches(':popover-open')); + await waitForRender(); + assert_true(p29.matches(':popover-open'),'showing after pointerup'); },`Pointer down in one document and pointer up in another document shouldn't dismiss popover`); </script> + +<div id=p30 popover>Popover 30</div> +<button id=b30 popovertarget=p30>Open popover 30</button> +<button id=b30b>Non-invoker</button> +<script> +promise_test(async () => { + assert_false(p30.matches(':popover-open'),'initially hidden'); + p30.showPopover(); + assert_true(p30.matches(':popover-open'),'showing'); + let actions = new test_driver.Actions(); + await actions.pointerMove(0,0,{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}) + .pointerUp({button: actions.ButtonType.LEFT}) + .send(); + await waitForRender(); + assert_true(p30.matches(':popover-open'),'showing after pointerup'); +},`Pointer down inside invoker and up outside that invoker shouldn't dismiss popover`); +</script> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.html index a0b3b60b72..a0b3b60b72 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-top-layer-nesting.html |