diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html b/testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html new file mode 100644 index 0000000000..7cc95a95e9 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/hide-other-popover-side-effects.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://chromium-review.googlesource.com/c/chromium/src/+/4094463/8/third_party/blink/renderer/core/html/html_element.cc#1404"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<div id=popover1 popover=auto>popover1</div> +<div id=popover2 popover=auto>popover2</div> + +<script> +test(() => { + const popover2 = document.getElementById('popover2'); + popover1.showPopover(); + popover1.addEventListener('beforetoggle', () => { + popover2.remove(); + }); + assert_throws_dom('InvalidStateError', () => popover2.showPopover(), + "popover1's beforetoggle event handler removes popover2 so showPopover should throw."); + assert_false(popover2.matches(':popover-open'), 'popover2 should not match :popover-open once it is closed.'); +}, 'Removing a popover while it is opening and force closing another popover should throw an exception.'); +</script> |