<html>
<body>
<script src="../../../resources/js-test.js"></script>
<select id="select" size="3">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
<option>option 4</option>
</select>
<script>
description('This tests that no crash occurs when changing the type of a select element during a focus event.');
var s = document.getElementById('select');
s.addEventListener('focus', function() {
s.size = 1;
});
var x = s.offsetLeft + s.offsetWidth / 2;
var y = s.offsetTop + s.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
testPassed('Did not crash');
</script>
</body>
</html>