RESOLVED WONTFIX 73900
Web Inspector: [TextPrompt] Autocomplete improperly determines user input
https://bugs.webkit.org/show_bug.cgi?id=73900
Summary Web Inspector: [TextPrompt] Autocomplete improperly determines user input
Alexander Pavlov (apavlov)
Reported 2011-12-06 03:06:09 PST
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
Attachments
Patch (4.47 KB, patch)
2011-12-06 03:12 PST, Alexander Pavlov (apavlov)
no flags
[PATCH] Comments addressed (4.50 KB, patch)
2011-12-06 04:13 PST, Alexander Pavlov (apavlov)
yurys: review+
Alexander Pavlov (apavlov)
Comment 1 2011-12-06 03:12:58 PST
Yury Semikhatsky
Comment 2 2011-12-06 03:59:59 PST
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.
Alexander Pavlov (apavlov)
Comment 3 2011-12-06 04:13:24 PST
Created attachment 118022 [details] [PATCH] Comments addressed
Alexander Pavlov (apavlov)
Comment 4 2011-12-06 04:55:15 PST
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.
Yury Semikhatsky
Comment 5 2011-12-06 05:16:38 PST
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.
Alexander Pavlov (apavlov)
Comment 6 2011-12-06 05:20:50 PST
(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.
Alexander Pavlov (apavlov)
Comment 7 2011-12-08 02:36:26 PST
This issue has been determined to be a Chromium-specific regression, so the workaround patch should not be landed.
Note You need to log in before you can comment on or make changes to this bug.