2009-07-12 Joseph Pecoraro <joepeck02@gmail.com>
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jul 2009 03:55:23 +0000 (03:55 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jul 2009 03:55:23 +0000 (03:55 +0000)
        Reviewed by Maciej Stachowiak.

        Inspector: Duplicate Computation in Autocompletion
        https://bugs.webkit.org/show_bug.cgi?id=26778

        * inspector/front-end/TextPrompt.js:
        (WebInspector.TextPrompt.prototype._completionsReady):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/inspector/front-end/TextPrompt.js

index 224f631..e8f54a9 100644 (file)
@@ -1,3 +1,13 @@
+2009-07-12  Joseph Pecoraro  <joepeck02@gmail.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Inspector: Duplicate Computation in Autocompletion
+        https://bugs.webkit.org/show_bug.cgi?id=26778
+
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype._completionsReady):
+
 2009-07-12  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Maciej Stachowiak.
index 30772f7..4194ff1 100644 (file)
@@ -159,10 +159,9 @@ WebInspector.TextPrompt.prototype = {
             return;
 
         var selectionRange = selection.getRangeAt(0);
-        var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this.completionStopCharacters, this.element, "backward");
 
         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())
@@ -185,7 +184,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();