Changeset 96219 in webkit


Ignore:
Timestamp:
Sep 28, 2011 6:53:31 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

Web Inspector: live edit cursor always appears at the beginning of the file.
https://bugs.webkit.org/show_bug.cgi?id=68900

Reviewed by Pavel Feldman.

  • inspector/front-end/TextViewer.js:

(WebInspector.TextEditorMainPanel.prototype._updateSelectionOnStartEditing):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96215 r96219  
     12011-09-27  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Web Inspector: live edit cursor always appears at the beginning of the file.
     4        https://bugs.webkit.org/show_bug.cgi?id=68900
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/front-end/TextViewer.js:
     9        (WebInspector.TextEditorMainPanel.prototype._updateSelectionOnStartEditing):
     10
    1112011-09-28  Vsevolod Vlasov  <vsevik@chromium.org>
    212
  • trunk/Source/WebCore/inspector/front-end/TextViewer.js

    r94842 r96219  
    920920    _updateSelectionOnStartEditing: function()
    921921    {
    922         // focust() needs to go first for the case when the last selection was inside the editor and
     922        // focus() needs to go first for the case when the last selection was inside the editor and
    923923        // the "Edit" button was clicked. In this case we bail at the check below, but the
    924924        // editor does not receive the focus, thus "Esc" does not cancel editing until at least
     
    926926        this._container.focus();
    927927        var selection = window.getSelection();
    928         if (selection.rangeCount && this._container.isAncestor(selection.getRangeAt(0).commonAncestorContainer))
    929             return;
     928        if (selection.rangeCount) {
     929            var commonAncestorContainer = selection.getRangeAt(0).commonAncestorContainer;
     930            if (this._container === commonAncestorContainer || this._container.isAncestor(commonAncestorContainer))
     931                return;
     932        }
    930933
    931934        selection.removeAllRanges();
Note: See TracChangeset for help on using the changeset viewer.