Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/popovers/label-in-invoker.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<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>