Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/customizable-combobox/datalist-popover.tentative.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>
<style>
input, datalist {
appearance: base;
}
</style>
<input list=datalist>
<datalist id=datalist>
<option>one</option>
<option>two</option>
</datalist>
<script>
test(() => {
const input = document.querySelector('input');
const datalist = document.querySelector('datalist');
assert_false(datalist.matches(':popover-open'),
'datalist should not be :popover-open at the start of the test.');
input.focus();
assert_true(datalist.matches(':popover-open'),
'datalist should be :popover-open after focusing the input.');
}, 'Focusing input should show datalist as a popover.');
</script>