summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-select-element/show-picker-being-cv-hidden.html
blob: 8990734f9366b9ebb6379adfa3b7a758c820523f (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>
<title>Test showPicker() being rendered requirement with content-visibility</title>
<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>
<div style="content-visibility: hidden">
    <select id="select">
        <option>Item 1</option>
    </select>
</div>
<script>
promise_test(async t => {
    await test_driver.bless('show picker');
    assert_throws_dom('NotSupportedError', () => { select.showPicker(); });

    // Test that dynamically changing to actually being rendered works.
    await test_driver.bless('show picker');
    select.parentElement.style.contentVisibility = 'visible';
    select.showPicker();
    select.blur();
}, 'select showPicker() throws when content-visibility hidden');
</script>