summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html
blob: bf8ab9710dce07085b930b1a48a656a565703f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!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>