Web Inspector: use last selection as complementary signal when applying DOM changes...
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2012 11:32:35 +0000 (11:32 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2012 11:32:35 +0000 (11:32 +0000)
commit13420fa61af577a8610e8912cfe7ddd4a1d71519
treed662081b4aedcd4428d63d51eeb5793df42539df
parent33c7fe14822bcc7ea64632e1d564d17fc856d2f4
Web Inspector: use last selection as complementary signal when applying DOM changes to the text model.
https://bugs.webkit.org/show_bug.cgi?id=101905

Reviewed by Vsevolod Vlasov.

Currently we use heuristics for detecting damaged model range upon DOM mutation.
This change adds signals from the last selection and keyboard events in order to
further improve the heuristics quality.

* inspector/front-end/DefaultTextEditor.js:
(WebInspector.DefaultTextEditor):
(WebInspector.DefaultTextEditor.EditInfo):
(WebInspector.DefaultTextEditor.prototype._handleTextInput):
(WebInspector.DefaultTextEditor.prototype._handleKeyDown):
(WebInspector.DefaultTextEditor.prototype.lastSelection):
(WebInspector.DefaultTextEditor.prototype.wasShown):
(WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
(WebInspector.TextEditorMainPanel.prototype._guessEditRangeBasedOnSelection):
(WebInspector.TextEditorMainPanel.prototype._guessEditRangeBasedOnDiff):
(WebInspector.TextEditorMainPanel.prototype._closingBlockOffset):
(WebInspector.TextEditorMainPanel.prototype._handleSelectionChange):
* inspector/front-end/TextEditorModel.js:
(WebInspector.TextRange.prototype.compareTo):
(WebInspector.TextRange.prototype.shift):
(WebInspector.TextEditorModel.endsWithBracketRegex.):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DefaultTextEditor.js
Source/WebCore/inspector/front-end/TextEditorModel.js