diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html | 56 |
1 files changed, 17 insertions, 39 deletions
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(); |