1
0
Fork 0
firefox/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

23 lines
924 B
HTML

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1523168">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<button popovertarget=mypopover>
<label>label</label>
</button>
<div id=mypopover popover=auto>popover</div>
<script>
promise_test(async() => {
const label = document.querySelector('label');
assert_false(mypopover.matches(':popover-open'),
'Popover should be closed at the start of the test.');
await test_driver.click(label);
assert_true(mypopover.matches(':popover-open'),
'The popover should be opened by clicking on the label.');
}, 'Buttons with popovertarget should invoke targets even if there is a label in the button.');
</script>