Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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>