<!doctype html>
<html class="test-wait">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1400522">
<link rel="author" href="mailto:xiaochengh@chromium.org">

<selectmenu id="selectMenu" style="position: absolute;">
    <div slot="button">
        <button id="b1" behavior="button"></button>
    </div>
    <selectmenu>
        <div slot="button">
            <button id="b2" behavior="button">x</button>
        </div>
        <div id="listbox" popover slot="listbox" behavior="listbox">
            <option>y</option>
        </div>
    </selectmenu>
</selectmenu>

<script type="module">
    const raf = () => new Promise(resolve => requestAnimationFrame(resolve));

    document.querySelector('#b1').click();
    document.querySelector('#b2').click();

    document.querySelector('#selectMenu').style.top = '-25px';

    await raf();
    await raf();

    document.querySelector('#selectMenu').style.top = '0px';

    document.documentElement.classList.remove('test-wait');
</script>
</html>
