Title: [114505] branches/chromium/1084/Source/WebCore/inspector/front-end/TextPrompt.js
- Revision
- 114505
- Author
- [email protected]
- Date
- 2012-04-18 08:09:31 -0700 (Wed, 18 Apr 2012)
Log Message
Merge 114382 - Web Inspector: Suggest box appears after the command was executed in console sometimes.
https://bugs.webkit.org/show_bug.cgi?id=84148
Reviewed by Pavel Feldman.
TextPrompt.complete() requests completions asynchronously, this change adds a flag
that informs TextPrompt._completionsReady() whether completions should still be shown.
* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype.clearAutoComplete):
(WebInspector.TextPrompt.prototype.complete):
(WebInspector.TextPrompt.prototype._completionsReady):
[email protected]
BUG=123826
Review URL: https://chromiumcodereview.appspot.com/10116026
Modified Paths
Diff
Modified: branches/chromium/1084/Source/WebCore/inspector/front-end/TextPrompt.js (114504 => 114505)
--- branches/chromium/1084/Source/WebCore/inspector/front-end/TextPrompt.js 2012-04-18 14:59:53 UTC (rev 114504)
+++ branches/chromium/1084/Source/WebCore/inspector/front-end/TextPrompt.js 2012-04-18 15:09:31 UTC (rev 114505)
@@ -303,6 +303,7 @@
clearTimeout(this._completeTimeout);
delete this._completeTimeout;
}
+ delete this._waitingForCompletions;
if (!this.autoCompleteElement)
return;
@@ -378,6 +379,7 @@
}
var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this._completionStopCharacters, this._element, "backward");
+ this._waitingForCompletions = true;
this._loadCompletions(this, wordPrefixRange, force, this._completionsReady.bind(this, selection, auto, wordPrefixRange, !!reverse));
},
@@ -423,10 +425,11 @@
*/
_completionsReady: function(selection, auto, originalWordPrefixRange, reverse, completions)
{
- if (!completions || !completions.length) {
+ if (!this._waitingForCompletions || !completions || !completions.length) {
this.hideSuggestBox();
return;
}
+ delete this._waitingForCompletions;
var selectionRange = selection.getRangeAt(0);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes