summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html')
-rw-r--r--testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html b/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html
new file mode 100644
index 0000000000..bf8ab9710d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/popovers/label-in-invoker.html
@@ -0,0 +1,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>