<!DOCTYPE html>
<html>
<body>
<p tabindex="1">This tests moving the focus from a select element while its popup menu is open. WebKit should dismiss the popup.</p>
<select>
  <option>Click here</option>
  <option>You should see this</option>
</select>
<div id="result"></div>
<script>

const select = document.querySelector('select');

if (window.testRunner)
    testRunner.waitUntilDone();
else {
    select.addEventListener('mousedown', () => {
        setTimeout(() => document.querySelector('p').focus(), 0);
    });
}

window.onload = () => {
    const event = document.createEvent("MouseEvent");
    event.initMouseEvent("mousedown", true, true, document.defaultView, 1, select.offsetLeft + 5, select.offsetTop + 5, select.offsetLeft + 5, select.offsetTop + 5, false, false, false, false, 0, document);
    select.dispatchEvent(event);
    
    if (!window.testRunner)
        return;

    testRunner.runUIScript(`uiController.uiScriptComplete()`, () => {
        document.querySelector('p').focus();
        document.getElementById('result').textContent = internals.isSelectPopupVisible(select) ? 'FAIL' : 'PASS';
        testRunner.notifyDone();
    });
}

</script>
</body>
</html>
