| <script src="../../../resources/js-test-pre.js"></script> |
| <p id="description">There was a bug that moving focus with TAB from a number input with an invalid string dispatched an extra focus event and an extra blur event.</p> |
| <input type=number id=number> |
| var num = document.getElementById('number'); |
| num.addEventListener('focus', handleFocus); |
| num.addEventListener('blur', handleBlur); |
| document.execCommand('InsertText', false, '123'); |
| document.execCommand('InsertText', false, 'a'); |
| var tabEvent = document.createEvent('KeyboardEvent'); |
| tabEvent.initKeyboardEvent('keydown', true, true, document.defaultView, 'U+0009'); |
| num.dispatchEvent(tabEvent); |
| shouldBe('numOfFocus', '1'); |
| shouldBe('numOfBlur', '1'); |
| <script src="../../../resources/js-test-post.js"></script> |