Changeset 142611 in webkit


Ignore:
Timestamp:
Feb 12, 2013 6:15:45 AM (11 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [SuggestBox] SuggestBox not hidden when prefix is empty and there is preceding input
https://bugs.webkit.org/show_bug.cgi?id=109568

Reviewed by Vsevolod Vlasov.

The suggestbox would get hidden in the case of empty input, yet it should get hidden
in the case of empty user-entered prefix (which is a wider notion.)

  • inspector/front-end/TextPrompt.js:

(WebInspector.TextPrompt.prototype.complete):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142610 r142611  
     12013-02-12  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [SuggestBox] SuggestBox not hidden when prefix is empty and there is preceding input
     4        https://bugs.webkit.org/show_bug.cgi?id=109568
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        The suggestbox would get hidden in the case of empty input, yet it should get hidden
     9        in the case of empty user-entered prefix (which is a wider notion.)
     10
     11        * inspector/front-end/TextPrompt.js:
     12        (WebInspector.TextPrompt.prototype.complete):
     13
    1142013-02-12  Andrey Lushnikov  <lushnikov@chromium.org>
    215
  • trunk/Source/WebCore/inspector/front-end/TextPrompt.js

    r142610 r142611  
    372372
    373373        var selectionRange = selection.getRangeAt(0);
    374         var isEmptyInput = selectionRange.commonAncestorContainer === this._element; // this._element has no child Text nodes.
     374        var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this._completionStopCharacters, this._element, "backward");
     375        var isEmptyInput = wordPrefixRange.collapsed;
    375376
    376377        var shouldExit;
     
    396397        }
    397398
    398         var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this._completionStopCharacters, this._element, "backward");
    399399        this._waitingForCompletions = true;
    400400        this._loadCompletions(this.proxyElement, wordPrefixRange, force, this._completionsReady.bind(this, selection, auto, wordPrefixRange, !!reverse));
Note: See TracChangeset for help on using the changeset viewer.