Web Inspector: WebInspector.TextViewer should be renamed WebInspector.TextEditor
authorvsevik@chromium.org <vsevik@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 08:45:08 +0000 (08:45 +0000)
committervsevik@chromium.org <vsevik@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 08:45:08 +0000 (08:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89939

Patch by Jan Keromnes <janx@linux.com> on 2012-07-03
Reviewed by Vsevolod Vlasov.

PerformanceTests:

* inspector/first-open-scripts.html.broken:

Source/WebCore:

Fixed LayoutTests and PerformanceTests accordingly.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/AdvancedSearchController.js:
(WebInspector.SearchView):
* inspector/front-end/JavaScriptSourceFrame.js:
(WebInspector.JavaScriptSourceFrame):
(WebInspector.JavaScriptSourceFrame.prototype._onHidePopover):
(WebInspector.JavaScriptSourceFrame.prototype._addBreakpointDecoration):
(WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointDecoration):
(WebInspector.JavaScriptSourceFrame.prototype._editBreakpointCondition.finishEditing):
(WebInspector.JavaScriptSourceFrame.prototype._editBreakpointCondition):
(WebInspector.JavaScriptSourceFrame.prototype.setExecutionLine):
(WebInspector.JavaScriptSourceFrame.prototype.clearExecutionLine):
(WebInspector.JavaScriptSourceFrame.prototype.onTextEditorContentLoaded):
(WebInspector.JavaScriptSourceFrame.prototype.toggleBreakpointOnCurrentLine):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame):
(WebInspector.SourceFrame.prototype.wasShown):
(WebInspector.SourceFrame.prototype.willHide):
(WebInspector.SourceFrame.prototype.defaultFocusedElement):
(WebInspector.SourceFrame.prototype.get textEditor):
(WebInspector.SourceFrame.prototype.clearMessages):
(WebInspector.SourceFrame.prototype.highlightLine):
(WebInspector.SourceFrame.prototype._clearLineHighlight):
(WebInspector.SourceFrame.prototype.revealLine):
(WebInspector.SourceFrame.prototype.setSelection):
(WebInspector.SourceFrame.prototype.setContent):
(WebInspector.SourceFrame.prototype.onTextEditorContentLoaded):
(WebInspector.SourceFrame.prototype._setTextEditorDecorations):
(WebInspector.SourceFrame.prototype.searchCanceled):
(WebInspector.SourceFrame.prototype.jumpToSearchResult):
(WebInspector.SourceFrame.prototype.addMessageToSource):
(WebInspector.SourceFrame.prototype.removeMessageFromSource):
(WebInspector.SourceFrame.prototype.inheritScrollPositions):
(WebInspector.TextEditorDelegateForSourceFrame):
* inspector/front-end/TextViewer.js: Removed.
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
* inspector/front-end/textViewer.css: Removed.

Source/WebKit/blackberry:

* WebCoreSupport/inspectorBB.html:

LayoutTests:

* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest):
* http/tests/inspector/live-edit-test.js:
(initialize_LiveEditTest.InspectorTest.replaceInSource):
(initialize_LiveEditTest):
* http/tests/inspector/resources-test.js:
(initialize_ResourceTest.InspectorTest.showResource.showResourceCallback):
(initialize_ResourceTest.InspectorTest.showResource):
* inspector/debugger/pause-in-inline-script.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121746 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/debugger-test.js
LayoutTests/http/tests/inspector/live-edit-test.js
LayoutTests/http/tests/inspector/resources-test.js
LayoutTests/inspector/debugger/pause-in-inline-script.html
PerformanceTests/ChangeLog
PerformanceTests/inspector/first-open-scripts.html.broken
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/inspector/compile-front-end.py
Source/WebCore/inspector/front-end/AdvancedSearchController.js
Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
Source/WebCore/inspector/front-end/SourceFrame.js
Source/WebCore/inspector/front-end/TextEditor.js [moved from Source/WebCore/inspector/front-end/TextViewer.js with 98% similarity]
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/inspector.html
Source/WebCore/inspector/front-end/textEditor.css [moved from Source/WebCore/inspector/front-end/textViewer.css with 100% similarity]
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/inspectorBB.html

index 608eb25..dfac56a 100644 (file)
@@ -1,3 +1,20 @@
+2012-07-03  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: WebInspector.TextViewer should be renamed WebInspector.TextEditor
+        https://bugs.webkit.org/show_bug.cgi?id=89939
+
+        Reviewed by Vsevolod Vlasov.
+
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest):
+        * http/tests/inspector/live-edit-test.js:
+        (initialize_LiveEditTest.InspectorTest.replaceInSource):
+        (initialize_LiveEditTest):
+        * http/tests/inspector/resources-test.js:
+        (initialize_ResourceTest.InspectorTest.showResource.showResourceCallback):
+        (initialize_ResourceTest.InspectorTest.showResource):
+        * inspector/debugger/pause-in-inline-script.html:
+
 2012-07-03  Zan Dobersek  <zandobersek@gmail.com>
 
         Unreviewed GTK gardening, updating baselines after r121697 and r121728
index 6d7493f..6ddab3f 100644 (file)
@@ -163,7 +163,7 @@ InspectorTest.showScriptSourceOnScriptsPanel = function(panel, scriptName, callb
             if (sourceFrame.loaded)
                 callback(sourceFrame);
             else
-                InspectorTest.addSniffer(sourceFrame, "onTextViewerContentLoaded", callback.bind(null, sourceFrame));
+                InspectorTest.addSniffer(sourceFrame, "onTextEditorContentLoaded", callback.bind(null, sourceFrame));
             return;
         }
     }
index 1ecb148..37c63c9 100644 (file)
@@ -2,7 +2,7 @@ var initialize_LiveEditTest = function() {
 
 InspectorTest.replaceInSource = function(sourceFrame, string, replacement, callback)
 {
-    sourceFrame._textViewer._mainPanel.setReadOnly(false);
+    sourceFrame._textEditor._mainPanel.setReadOnly(false);
     sourceFrame.beforeTextChanged();
     var oldRange, newRange;
     var lines = sourceFrame._textModel._lines;
@@ -18,7 +18,7 @@ InspectorTest.replaceInSource = function(sourceFrame, string, replacement, callb
         break;
     }
     sourceFrame.afterTextChanged(oldRange, newRange);
-    sourceFrame._textViewer._commitEditing();
+    sourceFrame._textEditor._commitEditing();
 }
 
 };
index 9c09734..51442e3 100644 (file)
@@ -77,7 +77,7 @@ InspectorTest.showResource = function(resourceURL, callback)
         if (sourceFrame.loaded)
             callbackWrapper(sourceFrame);
         else
-            InspectorTest.addSniffer(sourceFrame, "onTextViewerContentLoaded", callbackWrapper.bind(null, sourceFrame));
+            InspectorTest.addSniffer(sourceFrame, "onTextEditorContentLoaded", callbackWrapper.bind(null, sourceFrame));
     }
     InspectorTest.runAfterResourcesAreFinished([resourceURL], showResourceCallback);
 }
index 38946a5..777489e 100644 (file)
@@ -56,7 +56,7 @@ var test = function()
                 if (sourceFrame.loaded)
                     didShowScript(sourceFrame);
                 else
-                    InspectorTest.addSniffer(sourceFrame, "onTextViewerContentLoaded", didShowScript.bind(null, sourceFrame));
+                    InspectorTest.addSniffer(sourceFrame, "onTextEditorContentLoaded", didShowScript.bind(null, sourceFrame));
                 return;
             }
         }
index d0b3119..ef35dae 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-03  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: WebInspector.TextViewer should be renamed WebInspector.TextEditor
+        https://bugs.webkit.org/show_bug.cgi?id=89939
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/first-open-scripts.html.broken:
+
 2012-06-22  Philip Rogers  <pdr@google.com>
 
         Make SvgCubics performance test more consistent
index df1a566..357dd3d 100644 (file)
@@ -21,9 +21,9 @@ function test()
         WebInspector.showPanel("audits");
         var showPanelTimerCookie = timer.start("first-open-scripts");
         WebInspector.showPanel("scripts");
-        var count = WebInspector.panels.scripts.visibleView._textViewer._mainPanel._textChunks.length;
-        WebInspector.panels.scripts.visibleView._textViewer._mainPanel._expandChunks(0, count);
-        WebInspector.panels.scripts.visibleView._textViewer._mainPanel._paintScheduledLines();
+        var count = WebInspector.panels.scripts.visibleView._textEditor._mainPanel._textChunks.length;
+        WebInspector.panels.scripts.visibleView._textEditor._mainPanel._expandChunks(0, count);
+        WebInspector.panels.scripts.visibleView._textEditor._mainPanel._paintScheduledLines();
         timer.finish(showPanelTimerCookie);
         timer.done("first-open");
     }
index 809bf2f..0ca699a 100644 (file)
@@ -1,3 +1,53 @@
+2012-07-03  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: WebInspector.TextViewer should be renamed WebInspector.TextEditor
+        https://bugs.webkit.org/show_bug.cgi?id=89939
+
+        Reviewed by Vsevolod Vlasov.
+
+        Fixed LayoutTests and PerformanceTests accordingly.
+
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/compile-front-end.py:
+        * inspector/front-end/AdvancedSearchController.js:
+        (WebInspector.SearchView):
+        * inspector/front-end/JavaScriptSourceFrame.js:
+        (WebInspector.JavaScriptSourceFrame):
+        (WebInspector.JavaScriptSourceFrame.prototype._onHidePopover):
+        (WebInspector.JavaScriptSourceFrame.prototype._addBreakpointDecoration):
+        (WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointDecoration):
+        (WebInspector.JavaScriptSourceFrame.prototype._editBreakpointCondition.finishEditing):
+        (WebInspector.JavaScriptSourceFrame.prototype._editBreakpointCondition):
+        (WebInspector.JavaScriptSourceFrame.prototype.setExecutionLine):
+        (WebInspector.JavaScriptSourceFrame.prototype.clearExecutionLine):
+        (WebInspector.JavaScriptSourceFrame.prototype.onTextEditorContentLoaded):
+        (WebInspector.JavaScriptSourceFrame.prototype.toggleBreakpointOnCurrentLine):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame):
+        (WebInspector.SourceFrame.prototype.wasShown):
+        (WebInspector.SourceFrame.prototype.willHide):
+        (WebInspector.SourceFrame.prototype.defaultFocusedElement):
+        (WebInspector.SourceFrame.prototype.get textEditor):
+        (WebInspector.SourceFrame.prototype.clearMessages):
+        (WebInspector.SourceFrame.prototype.highlightLine):
+        (WebInspector.SourceFrame.prototype._clearLineHighlight):
+        (WebInspector.SourceFrame.prototype.revealLine):
+        (WebInspector.SourceFrame.prototype.setSelection):
+        (WebInspector.SourceFrame.prototype.setContent):
+        (WebInspector.SourceFrame.prototype.onTextEditorContentLoaded):
+        (WebInspector.SourceFrame.prototype._setTextEditorDecorations):
+        (WebInspector.SourceFrame.prototype.searchCanceled):
+        (WebInspector.SourceFrame.prototype.jumpToSearchResult):
+        (WebInspector.SourceFrame.prototype.addMessageToSource):
+        (WebInspector.SourceFrame.prototype.removeMessageFromSource):
+        (WebInspector.SourceFrame.prototype.inheritScrollPositions):
+        (WebInspector.TextEditorDelegateForSourceFrame):
+        * inspector/front-end/TextViewer.js: Removed.
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/textViewer.css: Removed.
+
 2012-07-03  Charles Wei  <charles.wei@torchmobile.com.cn>
 
         IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
index ab7a451..4ca8308 100644 (file)
             'inspector/front-end/TabbedEditorContainer.js',
             'inspector/front-end/TabbedPane.js',
             'inspector/front-end/TestController.js',
+            'inspector/front-end/TextEditor.js',
             'inspector/front-end/TextEditorHighlighter.js',
             'inspector/front-end/TextEditorModel.js',
             'inspector/front-end/TextPrompt.js',
-            'inspector/front-end/TextViewer.js',
             'inspector/front-end/TimelineFrameController.js',
             'inspector/front-end/TimelineManager.js',
             'inspector/front-end/TimelineModel.js',
             'inspector/front-end/scriptsPanel.css',
             'inspector/front-end/splitView.css',
             'inspector/front-end/tabbedPane.css',
+            'inspector/front-end/textEditor.css',
             'inspector/front-end/textPrompt.css',
-            'inspector/front-end/textViewer.css',
             'inspector/front-end/timelinePanel.css',
         ],
         'webinspector_uglifyjs_files': [
index e776c49..e3d7b6c 100755 (executable)
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\TextEditorHighlighter.js"
+                                       RelativePath="..\inspector\front-end\textEditor.css"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\TextEditorModel.js"
+                                       RelativePath="..\inspector\front-end\TextEditor.js"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\textPrompt.css"
+                                       RelativePath="..\inspector\front-end\TextEditorHighlighter.js"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\TextPrompt.js"
+                                       RelativePath="..\inspector\front-end\TextEditorModel.js"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\textViewer.css"
+                                       RelativePath="..\inspector\front-end\textPrompt.css"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\inspector\front-end\TextViewer.js"
+                                       RelativePath="..\inspector\front-end\TextPrompt.js"
                                        >
                                </File>
                                <File
index 525638d..d40d9f0 100755 (executable)
@@ -141,10 +141,10 @@ modules = [
             "SplitView.js",
             "StatusBarButton.js",
             "TabbedPane.js",
-            "TextEditorModel.js",
+            "TextEditor.js",
             "TextEditorHighlighter.js",
+            "TextEditorModel.js",
             "TextPrompt.js",
-            "TextViewer.js",
             "Toolbar.js",
             "UIUtils.js",
             "View.js",
index d7ec214..b82f774 100644 (file)
@@ -172,7 +172,7 @@ WebInspector.AdvancedSearchController.prototype = {
 WebInspector.SearchView = function(controller)
 {
     WebInspector.View.call(this);
-    this.registerRequiredCSS("textViewer.css");
+    this.registerRequiredCSS("textEditor.css");
     
     this._controller = controller;
 
index f59b09c..e8f02c3 100644 (file)
@@ -46,11 +46,11 @@ WebInspector.JavaScriptSourceFrame = function(scriptsPanel, javaScriptSource)
 
     WebInspector.SourceFrame.call(this, javaScriptSource);
 
-    this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.textViewer.element,
+    this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.textEditor.element,
             this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), this._onHidePopover.bind(this), true);
 
-    this.textViewer.element.addEventListener("mousedown", this._onMouseDown.bind(this), true);
-    this.textViewer.element.addEventListener("keydown", this._onKeyDown.bind(this), true);
+    this.textEditor.element.addEventListener("mousedown", this._onMouseDown.bind(this), true);
+    this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(this), true);
 
     this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this);
     this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this);
@@ -286,7 +286,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
         if (!highlightElement)
             return;
         // FIXME: the text editor should maintain highlight on its own. The check below is a workaround for
-        // the case when highlight element is detached from DOM by the TextViewer when re-building the DOM.
+        // the case when highlight element is detached from DOM by the TextEditor when re-building the DOM.
         var parentElement = highlightElement.parentElement;
         if (parentElement) {
             var child = highlightElement.firstChild;
@@ -335,27 +335,27 @@ WebInspector.JavaScriptSourceFrame.prototype = {
         };
         this.textModel.setAttribute(lineNumber, "breakpoint", breakpoint);
 
-        this.textViewer.beginUpdates();
-        this.textViewer.addDecoration(lineNumber, "webkit-breakpoint");
+        this.textEditor.beginUpdates();
+        this.textEditor.addDecoration(lineNumber, "webkit-breakpoint");
         if (!enabled || (mutedWhileEditing && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()))
-            this.textViewer.addDecoration(lineNumber, "webkit-breakpoint-disabled");
+            this.textEditor.addDecoration(lineNumber, "webkit-breakpoint-disabled");
         else
-            this.textViewer.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
+            this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
         if (!!condition)
-            this.textViewer.addDecoration(lineNumber, "webkit-breakpoint-conditional");
+            this.textEditor.addDecoration(lineNumber, "webkit-breakpoint-conditional");
         else
-            this.textViewer.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
-        this.textViewer.endUpdates();
+            this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
+        this.textEditor.endUpdates();
     },
 
     _removeBreakpointDecoration: function(lineNumber)
     {
         this.textModel.removeAttribute(lineNumber, "breakpoint");
-        this.textViewer.beginUpdates();
-        this.textViewer.removeDecoration(lineNumber, "webkit-breakpoint");
-        this.textViewer.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
-        this.textViewer.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
-        this.textViewer.endUpdates();
+        this.textEditor.beginUpdates();
+        this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint");
+        this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-disabled");
+        this.textEditor.removeDecoration(lineNumber, "webkit-breakpoint-conditional");
+        this.textEditor.endUpdates();
     },
 
     _onMouseDown: function(event)
@@ -391,11 +391,11 @@ WebInspector.JavaScriptSourceFrame.prototype = {
     _editBreakpointCondition: function(lineNumber, breakpoint)
     {
         this._conditionElement = this._createConditionElement(lineNumber);
-        this.textViewer.addDecoration(lineNumber, this._conditionElement);
+        this.textEditor.addDecoration(lineNumber, this._conditionElement);
 
         function finishEditing(committed, element, newText)
         {
-            this.textViewer.removeDecoration(lineNumber, this._conditionElement);
+            this.textEditor.removeDecoration(lineNumber, this._conditionElement);
             delete this._conditionEditorElement;
             delete this._conditionElement;
             if (breakpoint)
@@ -438,7 +438,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
     {
         this._executionLineNumber = lineNumber;
         if (this.loaded) {
-            this.textViewer.addDecoration(lineNumber, "webkit-execution-line");
+            this.textEditor.addDecoration(lineNumber, "webkit-execution-line");
             this.revealLine(this._executionLineNumber);
         }
         if (this.canEditSource())
@@ -448,7 +448,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
     clearExecutionLine: function()
     {
         if (this.loaded && typeof this._executionLineNumber === "number")
-            this.textViewer.removeDecoration(this._executionLineNumber, "webkit-execution-line");
+            this.textEditor.removeDecoration(this._executionLineNumber, "webkit-execution-line");
         delete this._executionLineNumber;
     },
 
@@ -516,7 +516,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
         this.clearMessages();
     },
 
-    onTextViewerContentLoaded: function()
+    onTextEditorContentLoaded: function()
     {
         if (typeof this._executionLineNumber === "number")
             this.setExecutionLine(this._executionLineNumber);
@@ -552,7 +552,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
 
     toggleBreakpointOnCurrentLine: function()
     {
-        var selection = this.textViewer.selection();
+        var selection = this.textEditor.selection();
         if (!selection)
             return;
         this._toggleBreakpoint(selection.startLine, false);
index e6be6f7..37ac1ef 100644 (file)
@@ -43,8 +43,8 @@ WebInspector.SourceFrame = function(contentProvider)
 
     this._textModel = new WebInspector.TextEditorModel();
 
-    var textViewerDelegate = new WebInspector.TextViewerDelegateForSourceFrame(this);
-    this._textViewer = new WebInspector.TextViewer(this._textModel, this._url, textViewerDelegate);
+    var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(this);
+    this._textEditor = new WebInspector.TextEditor(this._textModel, this._url, textEditorDelegate);
 
     this._currentSearchResultIndex = -1;
     this._searchResults = [];
@@ -53,7 +53,7 @@ WebInspector.SourceFrame = function(contentProvider)
     this._rowMessages = {};
     this._messageBubbles = {};
 
-    this._textViewer.setReadOnly(!this.canEditSource());
+    this._textEditor.setReadOnly(!this.canEditSource());
 }
 
 WebInspector.SourceFrame.createSearchRegex = function(query)
@@ -79,14 +79,14 @@ WebInspector.SourceFrame.prototype = {
     wasShown: function()
     {
         this._ensureContentLoaded();
-        this._textViewer.show(this.element);
+        this._textEditor.show(this.element);
     },
 
     willHide: function()
     {
         WebInspector.View.prototype.willHide.call(this);
         if (this.loaded)
-            this._textViewer.freeCachedElements();
+            this._textEditor.freeCachedElements();
 
         this._clearLineHighlight();
         this._clearLineToReveal();
@@ -94,7 +94,7 @@ WebInspector.SourceFrame.prototype = {
 
     defaultFocusedElement: function()
     {
-        return this._textViewer.defaultFocusedElement();
+        return this._textEditor.defaultFocusedElement();
     },
 
     get loaded()
@@ -107,9 +107,9 @@ WebInspector.SourceFrame.prototype = {
         return true;
     },
 
-    get textViewer()
+    get textEditor()
     {
-        return this._textViewer;
+        return this._textEditor;
     },
 
     _ensureContentLoaded: function()
@@ -138,7 +138,7 @@ WebInspector.SourceFrame.prototype = {
         this._rowMessages = {};
         this._messageBubbles = {};
 
-        this._textViewer.doResize();
+        this._textEditor.doResize();
     },
 
     get textModel()
@@ -155,7 +155,7 @@ WebInspector.SourceFrame.prototype = {
     {
         this._clearLineToReveal();
         if (this.loaded)
-            this._textViewer.highlightLine(line);
+            this._textEditor.highlightLine(line);
         else
             this._lineToHighlight = line;
     },
@@ -163,7 +163,7 @@ WebInspector.SourceFrame.prototype = {
     _clearLineHighlight: function()
     {
         if (this.loaded)
-            this._textViewer.clearLineHighlight();
+            this._textEditor.clearLineHighlight();
         else
             delete this._lineToHighlight;
     },
@@ -172,7 +172,7 @@ WebInspector.SourceFrame.prototype = {
     {
         this._clearLineHighlight();
         if (this.loaded)
-            this._textViewer.revealLine(line);
+            this._textEditor.revealLine(line);
         else
             this._lineToReveal = line;
     },
@@ -183,7 +183,7 @@ WebInspector.SourceFrame.prototype = {
     setSelection: function(textRange)
     {
         if (this.loaded)
-            this._textViewer.setSelection(textRange);
+            this._textEditor.setSelection(textRange);
         else
             this._selectionToSet = textRange;
     },
@@ -210,14 +210,14 @@ WebInspector.SourceFrame.prototype = {
      */
     setContent: function(content, contentEncoded, mimeType)
     {
-        this._textViewer.mimeType = mimeType;
+        this._textEditor.mimeType = mimeType;
 
         this._loaded = true;
         this._textModel.setText(content || "");
 
-        this._textViewer.beginUpdates();
+        this._textEditor.beginUpdates();
 
-        this._setTextViewerDecorations();
+        this._setTextEditorDecorations();
 
         if (typeof this._lineToHighlight === "number") {
             this.highlightLine(this._lineToHighlight);
@@ -239,25 +239,25 @@ WebInspector.SourceFrame.prototype = {
             delete this._delayedFindSearchMatches;
         }
 
-        this.onTextViewerContentLoaded();
+        this.onTextEditorContentLoaded();
 
-        this._textViewer.endUpdates();
+        this._textEditor.endUpdates();
     },
 
-    onTextViewerContentLoaded: function() {},
+    onTextEditorContentLoaded: function() {},
 
-    _setTextViewerDecorations: function()
+    _setTextEditorDecorations: function()
     {
         this._rowMessages = {};
         this._messageBubbles = {};
 
-        this._textViewer.beginUpdates();
+        this._textEditor.beginUpdates();
 
         this._addExistingMessagesToSource();
 
-        this._textViewer.doResize();
+        this._textEditor.doResize();
 
-        this._textViewer.endUpdates();
+        this._textEditor.endUpdates();
     },
 
     performSearch: function(query, callback)
@@ -292,7 +292,7 @@ WebInspector.SourceFrame.prototype = {
 
         this._currentSearchResultIndex = -1;
         this._searchResults = [];
-        this._textViewer.markAndRevealRange(null);
+        this._textEditor.markAndRevealRange(null);
     },
 
     hasSearchResults: function()
@@ -340,7 +340,7 @@ WebInspector.SourceFrame.prototype = {
         if (!this.loaded || !this._searchResults.length)
             return;
         this._currentSearchResultIndex = (index + this._searchResults.length) % this._searchResults.length;
-        this._textViewer.markAndRevealRange(this._searchResults[this._currentSearchResultIndex]);
+        this._textEditor.markAndRevealRange(this._searchResults[this._currentSearchResultIndex]);
     },
 
     _collectRegexMatches: function(regexObject)
@@ -381,7 +381,7 @@ WebInspector.SourceFrame.prototype = {
             messageBubbleElement = document.createElement("div");
             messageBubbleElement.className = "webkit-html-message-bubble";
             this._messageBubbles[lineNumber] = messageBubbleElement;
-            this._textViewer.addDecoration(lineNumber, messageBubbleElement);
+            this._textEditor.addDecoration(lineNumber, messageBubbleElement);
         }
 
         var rowMessages = this._rowMessages[lineNumber];
@@ -463,7 +463,7 @@ WebInspector.SourceFrame.prototype = {
             if (!rowMessages.length)
                 delete this._rowMessages[lineNumber];
             if (!messageBubbleElement.childElementCount) {
-                this._textViewer.removeDecoration(lineNumber, messageBubbleElement);
+                this._textEditor.removeDecoration(lineNumber, messageBubbleElement);
                 delete this._messageBubbles[lineNumber];
             }
             break;
@@ -480,7 +480,7 @@ WebInspector.SourceFrame.prototype = {
 
     inheritScrollPositions: function(sourceFrame)
     {
-        this._textViewer.inheritScrollPositions(sourceFrame._textViewer);
+        this._textEditor.inheritScrollPositions(sourceFrame._textEditor);
     },
 
     /**
@@ -503,15 +503,15 @@ WebInspector.SourceFrame.prototype.__proto__ = WebInspector.View.prototype;
 
 
 /**
- * @implements {WebInspector.TextViewerDelegate}
+ * @implements {WebInspector.TextEditorDelegate}
  * @constructor
  */
-WebInspector.TextViewerDelegateForSourceFrame = function(sourceFrame)
+WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame)
 {
     this._sourceFrame = sourceFrame;
 }
 
-WebInspector.TextViewerDelegateForSourceFrame.prototype = {
+WebInspector.TextEditorDelegateForSourceFrame.prototype = {
     beforeTextChanged: function()
     {
         this._sourceFrame.beforeTextChanged();
@@ -538,4 +538,4 @@ WebInspector.TextViewerDelegateForSourceFrame.prototype = {
     }
 }
 
-WebInspector.TextViewerDelegateForSourceFrame.prototype.__proto__ = WebInspector.TextViewerDelegate.prototype;
+WebInspector.TextEditorDelegateForSourceFrame.prototype.__proto__ = WebInspector.TextEditorDelegate.prototype;
  * @constructor
  * @param {WebInspector.TextEditorModel} textModel
  * @param {?string} url
- * @param {WebInspector.TextViewerDelegate} delegate
+ * @param {WebInspector.TextEditorDelegate} delegate
  */
-WebInspector.TextViewer = function(textModel, url, delegate)
+WebInspector.TextEditor = function(textModel, url, delegate)
 {
     WebInspector.View.call(this);
-    this.registerRequiredCSS("textViewer.css");
+    this.registerRequiredCSS("textEditor.css");
 
     this._textModel = textModel;
     this._textModel.addEventListener(WebInspector.TextEditorModel.Events.TextChanged, this._textChanged, this);
@@ -77,7 +77,7 @@ WebInspector.TextViewer = function(textModel, url, delegate)
     this._registerShortcuts();
 }
 
-WebInspector.TextViewer.prototype = {
+WebInspector.TextEditor.prototype = {
     /**
      * @param {string} mimeType
      */
@@ -189,12 +189,12 @@ WebInspector.TextViewer.prototype = {
     },
 
     /**
-     * @param {WebInspector.TextViewer} textViewer
+     * @param {WebInspector.TextEditor} textEditor
      */
-    inheritScrollPositions: function(textViewer)
+    inheritScrollPositions: function(textEditor)
     {
-        this._mainPanel.element._scrollTop = textViewer._mainPanel.element.scrollTop;
-        this._mainPanel.element._scrollLeft = textViewer._mainPanel.element.scrollLeft;
+        this._mainPanel.element._scrollTop = textEditor._mainPanel.element.scrollTop;
+        this._mainPanel.element._scrollLeft = textEditor._mainPanel.element.scrollLeft;
     },
 
     beginUpdates: function()
@@ -384,16 +384,16 @@ WebInspector.TextViewer.prototype = {
     }
 }
 
-WebInspector.TextViewer.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.TextEditor.prototype.__proto__ = WebInspector.View.prototype;
 
 /**
  * @interface
  */
-WebInspector.TextViewerDelegate = function()
+WebInspector.TextEditorDelegate = function()
 {
 }
 
-WebInspector.TextViewerDelegate.prototype = {
+WebInspector.TextEditorDelegate.prototype = {
     beforeTextChanged: function() { },
 
     /**
@@ -899,10 +899,10 @@ WebInspector.TextEditorGutterPanel.prototype.__proto__ = WebInspector.TextEditor
 /**
  * @constructor
  */
-WebInspector.TextEditorGutterChunk = function(textViewer, startLine, endLine)
+WebInspector.TextEditorGutterChunk = function(textEditor, startLine, endLine)
 {
-    this._textViewer = textViewer;
-    this._textModel = textViewer._textModel;
+    this._textEditor = textEditor;
+    this._textModel = textEditor._textModel;
 
     this.startLine = startLine;
     endLine = Math.min(this._textModel.linesCount, endLine);
@@ -938,10 +938,10 @@ WebInspector.TextEditorGutterChunk.prototype = {
      */
     addDecoration: function(decoration)
     {
-        this._textViewer.beginDomUpdates();
+        this._textEditor.beginDomUpdates();
         if (typeof decoration === "string")
             this.element.addStyleClass(decoration);
-        this._textViewer.endDomUpdates();
+        this._textEditor.endDomUpdates();
     },
 
     /**
@@ -949,10 +949,10 @@ WebInspector.TextEditorGutterChunk.prototype = {
      */
     removeDecoration: function(decoration)
     {
-        this._textViewer.beginDomUpdates();
+        this._textEditor.beginDomUpdates();
         if (typeof decoration === "string")
             this.element.removeStyleClass(decoration);
-        this._textViewer.endDomUpdates();
+        this._textEditor.endDomUpdates();
     },
 
     /**
@@ -966,7 +966,7 @@ WebInspector.TextEditorGutterChunk.prototype = {
     set expanded(expanded)
     {
         if (this.linesCount === 1)
-            this._textViewer._syncDecorationsForLineListener(this.startLine);
+            this._textEditor._syncDecorationsForLineListener(this.startLine);
 
         if (this._expanded === expanded)
             return;
@@ -976,7 +976,7 @@ WebInspector.TextEditorGutterChunk.prototype = {
         if (this.linesCount === 1)
             return;
 
-        this._textViewer.beginDomUpdates();
+        this._textEditor.beginDomUpdates();
 
         if (expanded) {
             this._expandedLineRows = [];
@@ -987,7 +987,7 @@ WebInspector.TextEditorGutterChunk.prototype = {
                 this._expandedLineRows.push(lineRow);
             }
             parentElement.removeChild(this.element);
-            this._textViewer._syncLineHeightListener(this._expandedLineRows[0]);
+            this._textEditor._syncLineHeightListener(this._expandedLineRows[0]);
         } else {
             var elementInserted = false;
             for (var i = 0; i < this._expandedLineRows.length; ++i) {
@@ -1000,12 +1000,12 @@ WebInspector.TextEditorGutterChunk.prototype = {
                     }
                     parentElement.removeChild(lineRow);
                 }
-                this._textViewer._cachedRows.push(lineRow);
+                this._textEditor._cachedRows.push(lineRow);
             }
             delete this._expandedLineRows;
         }
 
-        this._textViewer.endDomUpdates();
+        this._textEditor.endDomUpdates();
     },
 
     /**
@@ -1014,8 +1014,8 @@ WebInspector.TextEditorGutterChunk.prototype = {
     get height()
     {
         if (!this._expandedLineRows)
-            return this._textViewer._totalHeight(this.element);
-        return this._textViewer._totalHeight(this._expandedLineRows[0], this._expandedLineRows[this._expandedLineRows.length - 1]);
+            return this._textEditor._totalHeight(this.element);
+        return this._textEditor._totalHeight(this._expandedLineRows[0], this._expandedLineRows[this._expandedLineRows.length - 1]);
     },
 
     /**
@@ -1032,7 +1032,7 @@ WebInspector.TextEditorGutterChunk.prototype = {
      */
     _createRow: function(lineNumber)
     {
-        var lineRow = this._textViewer._cachedRows.pop() || document.createElement("div");
+        var lineRow = this._textEditor._cachedRows.pop() || document.createElement("div");
         lineRow.lineNumber = lineNumber;
         lineRow.className = "webkit-line-number";
         lineRow.textContent = lineNumber + 1;
@@ -1780,7 +1780,7 @@ WebInspector.TextEditorMainPanel.prototype = {
         var selection = window.getSelection();
         if (!selection.rangeCount)
             return null;
-        // Selection may be outside of the viewer.
+        // Selection may be outside of the editor.
         if (!this._container.isAncestor(selection.anchorNode) || !this._container.isAncestor(selection.focusNode))
             return null;
         var start = this._selectionToPosition(selection.anchorNode, selection.anchorOffset);
index 66fb301..83a3a8e 100644 (file)
     <file>TabbedEditorContainer.js</file>
     <file>TabbedPane.js</file>
     <file>TestController.js</file>
+    <file>TextEditor.js</file>
     <file>TextEditorHighlighter.js</file>
     <file>TextEditorModel.js</file>
     <file>TextPrompt.js</file>
-    <file>TextViewer.js</file>
     <file>TimelineFrameController.js</file>
     <file>TimelineManager.js</file>
     <file>TimelineModel.js</file>
     <file>scriptsPanel.css</file>
     <file>splitView.css</file>
     <file>tabbedPane.css</file>
+    <file>textEditor.css</file>
     <file>textPrompt.css</file>
-    <file>textViewer.css</file>
     <file>timelinePanel.css</file>
     <file>Images/applicationCache.png</file>
     <file>Images/back.png</file>
index 8df5f20..d392df0 100644 (file)
@@ -120,7 +120,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="ElementsPanel.js"></script>
     <script type="text/javascript" src="NetworkPanel.js"></script>
     <script type="text/javascript" src="InjectedFakeWorker.js"></script>
-    <script type="text/javascript" src="TextViewer.js"></script>
+    <script type="text/javascript" src="TextEditor.js"></script>
     <script type="text/javascript" src="SourceFrame.js"></script>
     <script type="text/javascript" src="ResourceView.js"></script>
     <script type="text/javascript" src="RequestView.js"></script>
index b250486..4bcc456 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-03  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: WebInspector.TextViewer should be renamed WebInspector.TextEditor
+        https://bugs.webkit.org/show_bug.cgi?id=89939
+
+        Reviewed by Vsevolod Vlasov.
+
+        * WebCoreSupport/inspectorBB.html:
+
 2012-07-02  Xiaobo Wang  <xbwang@torchmobile.com.cn>
 
         [BlackBerry] Use PUBLIC_BUILD to enable/disable DRT
index 5f69219..79828d9 100644 (file)
@@ -39,7 +39,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         <link rel="stylesheet" type="text/css" href="networkPanel.css">
         <link rel="stylesheet" type="text/css" href="helpScreen.css">
         <link rel="stylesheet" type="text/css" href="popover.css">
-        <link rel="stylesheet" type="text/css" href="textViewer.css">
+        <link rel="stylesheet" type="text/css" href="textEditor.css">
         <script type="text/javascript" src="javascript.js"></script>
     </head>
     <body class="detached">