The underlying cause is that a handler invoked as setTimeout(.., 0) from keydown handler gets run BEFORE the keypress and textInput events are dispatched, presumably due to some weird change in WebKit. Upstreaming http://code.google.com/p/chromium/issues/detail?id=106224
Created attachment 118015 [details] Patch
Comment on attachment 118015 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=118015&action=review > Source/WebCore/ChangeLog:5 > + Please describe the fix here. > Source/WebCore/inspector/front-end/TextPrompt.js:346 > + var immediately = this.isSuggestBoxVisible() || this._autocompleteRequestForced; Could you extract this code into a separate method and call it directly where you pass actuateNow=true. This way you could get rid of actuateNow parameter.
Created attachment 118022 [details] [PATCH] Comments addressed
A small investigation has shown that the sequence of keydown, keypress, textInput (a.k.a input) events is NOT dispatched synchronously. For one, in Chromium the "keydown" event arrives into Source/WebKit/chromium/src/WebViewImpl.cpp (handleInputEvent) as WebInputEvent::[Raw]KeyDown over IPC, while the "keypress" event arrives into the same method in a DIFFERENT IPC message as WebInputEvent::Char. Obviously, anything can happen between these two invocations of handleInputEvent(), including a triggering of a DOM timer (setTimeout). Hence, the correct solution seems to be the autocompletion of user input in the "input" event handler, which has been implemented in the suggested patch.
Comment on attachment 118022 [details] [PATCH] Comments addressed View in context: https://bugs.webkit.org/attachment.cgi?id=118022&action=review > Source/WebCore/inspector/front-end/TextPrompt.js:329 > + this._autocompleteRequestForced = force || false; Please rename _autocompleteRequestForced to something more appropriate that would reflect that it can have one of three states. > Source/WebCore/inspector/front-end/TextPrompt.js:330 > + return; Remove this line.
(In reply to comment #5) > (From update of attachment 118022 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=118022&action=review > > > Source/WebCore/inspector/front-end/TextPrompt.js:329 > > + this._autocompleteRequestForced = force || false; > > Please rename _autocompleteRequestForced to something more appropriate that would reflect that it can have one of three states. Renamed to _autocompleteRequestState. > > Source/WebCore/inspector/front-end/TextPrompt.js:330 > > + return; > > Remove this line. Done.
This issue has been determined to be a Chromium-specific regression, so the workaround patch should not be landed.