Changeset 121918 in webkit


Ignore:
Timestamp:
Jul 5, 2012 12:44:04 PM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: move cursor to the current search match.
https://bugs.webkit.org/show_bug.cgi?id=90621

Reviewed by Vsevolod Vlasov.

After closing the search dialog, the cursor should be at the latest search match location.

  • inspector/front-end/TextEditor.js:

(WebInspector.TextEditor.prototype.markAndRevealRange):
(WebInspector.TextEditor.prototype._handleFocused):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121917 r121918  
     12012-07-05  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: move cursor to the current search match.
     4        https://bugs.webkit.org/show_bug.cgi?id=90621
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        After closing the search dialog, the cursor should be at the latest search match location.
     9
     10        * inspector/front-end/TextEditor.js:
     11        (WebInspector.TextEditor.prototype.markAndRevealRange):
     12        (WebInspector.TextEditor.prototype._handleFocused):
     13
    1142012-07-05  Behdad Esfahbod  <behdad@behdad.org>
    215
  • trunk/Source/WebCore/inspector/front-end/TextEditor.js

    r121750 r121918  
    159159    markAndRevealRange: function(range)
    160160    {
     161        if (range)
     162            this._lastMarkedRange = range;
    161163        this._mainPanel.markAndRevealRange(range);
    162164    },
     
    411413    _handleFocused: function()
    412414    {
     415        // Convert last marked range into a selection upon focus. This is needed to focus the search result.
     416        if (this._lastMarkedRange) {
     417            this._lastSelection = this._lastMarkedRange;
     418            delete this._lastMarkedRange;
     419        }
     420
    413421        if (this._lastSelection) {
    414422            // We do not restore selection after focus lost to avoid selection blinking. We restore only cursor position instead.
Note: See TracChangeset for help on using the changeset viewer.