Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3459)

Unified Diff: chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js

Issue 177049: On Linux, move the passing of filedescriptors to a dedicated socketpair(). (Closed)
Patch Set: Removed *.d files from reference build Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js
index 61e1b52db3149246092924260bbbcc4d14947fb1..5ff774f826021c78887571acfd970f4649f8395b 100644
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/TextPrompt.js
@@ -66,6 +66,7 @@ WebInspector.TextPrompt.prototype = {
this._tabKeyPressed(event);
break;
case "Right":
+ case "End":
if (!this.acceptAutoComplete())
this.autoCompleteSoon();
break;
@@ -140,7 +141,6 @@ WebInspector.TextPrompt.prototype = {
complete: function(auto)
{
this.clearAutoComplete(true);
-
var selection = window.getSelection();
if (!selection.rangeCount)
return;
@@ -150,17 +150,24 @@ WebInspector.TextPrompt.prototype = {
return;
if (auto && !this.isCaretAtEndOfPrompt())
return;
-
var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this.completionStopCharacters, this.element, "backward");
- var completions = this.completions(wordPrefixRange, auto);
+ this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange));
+ },
+ _completionsReady: function(selection, auto, originalWordPrefixRange, completions)
+ {
if (!completions || !completions.length)
return;
+ var selectionRange = selection.getRangeAt(0);
+
var fullWordRange = document.createRange();
- fullWordRange.setStart(wordPrefixRange.startContainer, wordPrefixRange.startOffset);
+ fullWordRange.setStart(originalWordPrefixRange.startContainer, originalWordPrefixRange.startOffset);
fullWordRange.setEnd(selectionRange.endContainer, selectionRange.endOffset);
+ if (originalWordPrefixRange.toString() + selectionRange.toString() != fullWordRange.toString())
+ return;
+
if (completions.length === 1 || selection.isCollapsed || auto) {
var completionText = completions[0];
} else {
@@ -178,7 +185,7 @@ WebInspector.TextPrompt.prototype = {
var completionText = completions[foundIndex + 1];
}
- var wordPrefixLength = wordPrefixRange.toString().length;
+ var wordPrefixLength = originalWordPrefixRange.toString().length;
this._userEnteredRange = fullWordRange;
this._userEnteredText = fullWordRange.toString();

Powered by Google App Engine
This is Rietveld 408576698