Web Inspector: do not re-create RawSourceCode when toggling pretty-print mode.
authorpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 16:42:00 +0000 (16:42 +0000)
committerpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 16:42:00 +0000 (16:42 +0000)
commit8441619d51dc7f406538374fb09baedf951fc969
treee51d691c19391ff43de59f37e5f748dd56f8983d
parent4ec7b0cff878a4bd38a51131d4b4b087fb43c2d7
Web Inspector: do not re-create RawSourceCode when toggling pretty-print mode.
https://bugs.webkit.org/show_bug.cgi?id=67647

1) Implement RawSourceCode.setFormatted that allows toggling pretty-print mode on the fly without resetting everything.
2) Add RawSourceCode unit tests.
3) Remove source mapping listeners and console messages from presentation model (they live in RawSourceCode now).

Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: inspector/debugger/raw-source-code.html

* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel):
(WebInspector.DebuggerPresentationModel.prototype.linkifyLocation):
(WebInspector.DebuggerPresentationModel.prototype._addScript):
(WebInspector.DebuggerPresentationModel.prototype._sourceMappingUpdated):
(WebInspector.DebuggerPresentationModel.prototype.setFormatSource):
(WebInspector.DebuggerPresentationModel.prototype._createRawSourceCodeId):
(WebInspector.DebuggerPresentationModel.prototype._debuggerReset):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._toggleFormatSource):
* inspector/front-end/SourceFile.js:
(WebInspector.RawSourceCode):
(WebInspector.RawSourceCode.prototype.get uiSourceCode):
(WebInspector.RawSourceCode.prototype.setFormatted):
(WebInspector.RawSourceCode.prototype.rawLocationToUILocation):
(WebInspector.RawSourceCode.prototype._saveSourceMapping):

LayoutTests:

* inspector/debugger/raw-source-code-expected.txt: Added.
* inspector/debugger/raw-source-code.html: Added.
* inspector/debugger/script-formatter.html:
* inspector/debugger/source-file.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/debugger/raw-source-code-expected.txt [new file with mode: 0644]
LayoutTests/inspector/debugger/raw-source-code.html [new file with mode: 0644]
LayoutTests/inspector/debugger/script-formatter.html
LayoutTests/inspector/debugger/source-file.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebCore/inspector/front-end/SourceFile.js