Changeset 121984 in webkit
- Timestamp:
- Jul 6, 2012 10:19:25 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r121983 r121984 1 2012-07-06 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: get rid of this._lastMarkedRange in TextEditor. 4 https://bugs.webkit.org/show_bug.cgi?id=90691 5 6 Reviewed by Vsevolod Vlasov. 7 8 We don't need it, should use setSelection instead. 9 10 * inspector/front-end/TextEditor.js: 11 (WebInspector.TextEditor.prototype.markAndRevealRange): 12 (WebInspector.TextEditor.prototype._handleSelectionChange): 13 (WebInspector.TextEditor.prototype.setSelection): 14 (WebInspector.TextEditor.prototype._handleFocused): 15 1 16 2012-07-06 Vsevolod Vlasov <vsevik@chromium.org> 2 17 -
trunk/Source/WebCore/inspector/front-end/TextEditor.js
r121981 r121984 160 160 { 161 161 if (range) 162 this. _lastMarkedRange = range;162 this.setSelection(range); 163 163 this._mainPanel.markAndRevealRange(range); 164 164 }, … … 380 380 { 381 381 var textRange = this._mainPanel._getSelection(); 382 if (textRange) 383 this._lastSelection = textRange; 382 if (textRange) { 383 // We do not restore selection after focus lost to avoid selection blinking. We restore only cursor position instead. 384 // FIXME: consider adding selection decoration to blurred editor. 385 this._lastSelection = WebInspector.TextRange.createFromLocation(textRange.endLine, textRange.endColumn); 386 } 384 387 this._delegate.selectionChanged(textRange); 385 388 }, … … 407 410 { 408 411 this._lastSelection = textRange; 409 this._mainPanel._restoreSelection(textRange); 412 if (this.element.isAncestor(document.activeElement)) 413 this._mainPanel._restoreSelection(textRange); 410 414 }, 411 415 … … 421 425 _handleFocused: function() 422 426 { 423 // Convert last marked range into a selection upon focus. This is needed to focus the search result. 424 if (this._lastMarkedRange) { 425 this.setSelection(this._lastMarkedRange); 426 delete this._lastMarkedRange; 427 return; 428 } 429 430 if (this._lastSelection) { 431 // We do not restore selection after focus lost to avoid selection blinking. We restore only cursor position instead. 432 // FIXME: consider adding selection decoration to blurred editor. 433 var newSelection = WebInspector.TextRange.createFromLocation(this._lastSelection.endLine, this._lastSelection.endColumn); 434 this.setSelection(newSelection); 435 } 427 if (this._lastSelection) 428 this.setSelection(this._lastSelection); 436 429 }, 437 430
Note: See TracChangeset
for help on using the changeset viewer.