4 <link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
5 <script src="../../fast/js/resources/js-test-pre.js"></script>
8 <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>
9 <div id="console"></div>
11 <input type=number id=number>
15 function handleFocus() {
19 function handleBlur() {
25 var num = document.getElementById('number');
26 num.addEventListener('focus', handleFocus);
27 num.addEventListener('blur', handleBlur);
29 document.execCommand('InsertText', false, '123');
30 document.execCommand('InsertText', false, 'a');
31 var tabEvent = document.createEvent('KeyboardEvent');
32 tabEvent.initKeyboardEvent('keydown', true, true, document.defaultView, 'U+0009');
33 num.dispatchEvent(tabEvent);
35 shouldBe('numOfFocus', '1');
36 shouldBe('numOfBlur', '1');
38 var successfullyParsed = true;
40 <script src="../../fast/js/resources/js-test-post.js"></script>