Web Inspector: compile text editor.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 16:11:59 +0000 (16:11 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 16:11:59 +0000 (16:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69339

Drive-by compilation for color, database and dom storage entities.

Reviewed by Yury Semikhatsky.

* inspector/Inspector.json:
* inspector/compile-front-end.sh:
* inspector/front-end/Color.js:
(WebInspector.Color.prototype._individualRGBValueToFloatValue):
* inspector/front-end/KeyboardShortcut.js:
(WebInspector.KeyboardShortcut.makeKey):
(WebInspector.KeyboardShortcut.makeKeyFromEvent):
(WebInspector.KeyboardShortcut.makeDescriptor):
* inspector/front-end/SourceCSSTokenizer.js:
* inspector/front-end/SourceCSSTokenizer.re2js:
* inspector/front-end/SourceHTMLTokenizer.js:
* inspector/front-end/SourceHTMLTokenizer.re2js:
* inspector/front-end/SourceJavaScriptTokenizer.js:
* inspector/front-end/SourceJavaScriptTokenizer.re2js:
* inspector/front-end/SourceTokenizer.js:
(WebInspector.SourceTokenizer.prototype._charAt):
(WebInspector.SourceTokenizer.prototype.createInitialCondition):
(WebInspector.SourceTokenizer.prototype.nextToken):
* inspector/front-end/TextEditorHighlighter.js:
(WebInspector.TextEditorHighlighter.prototype.highlight):
(WebInspector.TextEditorHighlighter.prototype._highlightLines):
* inspector/front-end/TextEditorModel.js:
* inspector/front-end/TextViewer.js:
(WebInspector.TextViewerDelegate.prototype.doubleClick):
(WebInspector.TextViewerDelegate.prototype.beforeTextChanged):
(WebInspector.TextViewerDelegate.prototype.afterTextChanged):
(WebInspector.TextViewerDelegate.prototype.commitEditing):
(WebInspector.TextViewerDelegate.prototype.cancelEditing):
(WebInspector.TextViewerDelegate.prototype.populateLineGutterContextMenu):
(WebInspector.TextViewerDelegate.prototype.populateTextAreaContextMenu):
(WebInspector.TextViewerDelegate.prototype.suggestedFileName):
(WebInspector.TextEditorMainPanel.prototype._enclosingLineRowOrSelf):
(WebInspector.TextEditorMainPanel.prototype._createLink):
(WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
(WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges):
* inspector/front-end/externs.js:
(WebInspector.completeURL):
(window.getComputedStyle):
(Event.prototype.initWebKitWheelEvent):
* inspector/front-end/utilities.js:

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/compile-front-end.sh
Source/WebCore/inspector/front-end/Color.js
Source/WebCore/inspector/front-end/KeyboardShortcut.js
Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js
Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
Source/WebCore/inspector/front-end/SourceTokenizer.js
Source/WebCore/inspector/front-end/TextEditorHighlighter.js
Source/WebCore/inspector/front-end/TextEditorModel.js
Source/WebCore/inspector/front-end/TextViewer.js
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/utilities.js

index 0c00c5f..3718b18 100644 (file)
@@ -1,3 +1,53 @@
+2011-10-04  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: compile text editor.
+        https://bugs.webkit.org/show_bug.cgi?id=69339
+
+        Drive-by compilation for color, database and dom storage entities.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/Inspector.json:
+        * inspector/compile-front-end.sh:
+        * inspector/front-end/Color.js:
+        (WebInspector.Color.prototype._individualRGBValueToFloatValue):
+        * inspector/front-end/KeyboardShortcut.js:
+        (WebInspector.KeyboardShortcut.makeKey):
+        (WebInspector.KeyboardShortcut.makeKeyFromEvent):
+        (WebInspector.KeyboardShortcut.makeDescriptor):
+        * inspector/front-end/SourceCSSTokenizer.js:
+        * inspector/front-end/SourceCSSTokenizer.re2js:
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+        * inspector/front-end/SourceJavaScriptTokenizer.js:
+        * inspector/front-end/SourceJavaScriptTokenizer.re2js:
+        * inspector/front-end/SourceTokenizer.js:
+        (WebInspector.SourceTokenizer.prototype._charAt):
+        (WebInspector.SourceTokenizer.prototype.createInitialCondition):
+        (WebInspector.SourceTokenizer.prototype.nextToken):
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter.prototype.highlight):
+        (WebInspector.TextEditorHighlighter.prototype._highlightLines):
+        * inspector/front-end/TextEditorModel.js:
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewerDelegate.prototype.doubleClick):
+        (WebInspector.TextViewerDelegate.prototype.beforeTextChanged):
+        (WebInspector.TextViewerDelegate.prototype.afterTextChanged):
+        (WebInspector.TextViewerDelegate.prototype.commitEditing):
+        (WebInspector.TextViewerDelegate.prototype.cancelEditing):
+        (WebInspector.TextViewerDelegate.prototype.populateLineGutterContextMenu):
+        (WebInspector.TextViewerDelegate.prototype.populateTextAreaContextMenu):
+        (WebInspector.TextViewerDelegate.prototype.suggestedFileName):
+        (WebInspector.TextEditorMainPanel.prototype._enclosingLineRowOrSelf):
+        (WebInspector.TextEditorMainPanel.prototype._createLink):
+        (WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
+        (WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges):
+        * inspector/front-end/externs.js:
+        (WebInspector.completeURL):
+        (window.getComputedStyle):
+        (Event.prototype.initWebKitWheelEvent):
+        * inspector/front-end/utilities.js:
+
 2011-10-04  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Timeline panel shortcut for filtering short records should have shorter description.
index cae0679..96f1f3f 100644 (file)
             {
                 "id": "Database",
                 "type": "object",
-                "description": "Database object."
+                "description": "Database object.",
+                "hidden": true,
+                "properties": [
+                    { "name": "id", "type": "string", "description": "Database ID." },
+                    { "name": "domain", "type": "string", "description": "Database domain." },
+                    { "name": "name", "type": "string", "description": "Database name." },
+                    { "name": "version", "type": "string", "description": "Database version." }
+                ]
             },
             {
                 "id": "Error",
index 82f321b..71fd91a 100755 (executable)
@@ -44,14 +44,16 @@ java -jar ~/closure/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --warn
         --js Source/WebCore/inspector/front-end/Object.js \
         --js Source/WebCore/inspector/front-end/Settings.js \
         --js Source/WebCore/inspector/front-end/UserMetrics.js \
-    --module jsmodule_sdk:18:jsmodule_common \
+    --module jsmodule_sdk:20:jsmodule_common \
         --js Source/WebCore/inspector/front-end/CompilerSourceMapping.js \
         --js Source/WebCore/inspector/front-end/CompilerSourceMappingProvider.js \
         --js Source/WebCore/inspector/front-end/ConsoleModel.js \
         --js Source/WebCore/inspector/front-end/ContentProviders.js \
         --js Source/WebCore/inspector/front-end/CookieParser.js \
         --js Source/WebCore/inspector/front-end/BreakpointManager.js \
+        --js Source/WebCore/inspector/front-end/Database.js \
         --js Source/WebCore/inspector/front-end/DOMAgent.js \
+        --js Source/WebCore/inspector/front-end/DOMStorage.js \
         --js Source/WebCore/inspector/front-end/DebuggerModel.js \
         --js Source/WebCore/inspector/front-end/DebuggerPresentationModel.js \
         --js Source/WebCore/inspector/front-end/Script.js \
@@ -63,8 +65,9 @@ java -jar ~/closure/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --warn
         --js Source/WebCore/inspector/front-end/Resource.js \
         --js Source/WebCore/inspector/front-end/NetworkManager.js \
         --js Source/WebCore/inspector/front-end/UISourceCode.js \
-    --module jsmodule_ui:22:jsmodule_common \
+    --module jsmodule_ui:27:jsmodule_common \
         --js Source/WebCore/inspector/front-end/Checkbox.js \
+        --js Source/WebCore/inspector/front-end/Color.js \
         --js Source/WebCore/inspector/front-end/ContextMenu.js \
         --js Source/WebCore/inspector/front-end/DataGrid.js \
         --js Source/WebCore/inspector/front-end/Drawer.js \
@@ -80,9 +83,13 @@ java -jar ~/closure/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --warn
         --js Source/WebCore/inspector/front-end/SidebarPane.js \
         --js Source/WebCore/inspector/front-end/ShortcutsScreen.js \
         --js Source/WebCore/inspector/front-end/SoftContextMenu.js \
+        --js Source/WebCore/inspector/front-end/SourceTokenizer.js \
         --js Source/WebCore/inspector/front-end/StatusBarButton.js \
         --js Source/WebCore/inspector/front-end/TabbedPane.js \
+        --js Source/WebCore/inspector/front-end/TextEditorModel.js \
+        --js Source/WebCore/inspector/front-end/TextEditorHighlighter.js \
         --js Source/WebCore/inspector/front-end/TextPrompt.js \
+        --js Source/WebCore/inspector/front-end/TextViewer.js \
         --js Source/WebCore/inspector/front-end/Toolbar.js \
         --js Source/WebCore/inspector/front-end/UIUtils.js \
         --js Source/WebCore/inspector/front-end/View.js \
index b058671..62588df 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.Color = function(str)
 {
     this.value = str;
     this._parse();
 }
 
+/**
+ * @param {number=} a
+ */
 WebInspector.Color.fromRGBA = function(r, g, b, a)
 {
     return new WebInspector.Color("rgba(" + r + "," + g + "," + b + "," + (typeof a === "undefined" ? 1 : a) + ")");
@@ -201,7 +207,7 @@ WebInspector.Color.prototype = {
             return this._clamp(rgbValue, 0, 255);
 
         if (rgbValue.indexOf("%") === -1) {
-            var intValue = parseInt(rgbValue);
+            var intValue = parseInt(rgbValue, 10);
             return this._clamp(rgbValue, 0, 255);
         }
 
index fc4f970..b13e8da 100644 (file)
@@ -93,17 +93,15 @@ WebInspector.KeyboardShortcut.Keys = {
  * Creates a number encoding keyCode in the lower 8 bits and modifiers mask in the higher 8 bits.
  * It is useful for matching pressed keys.
  * keyCode is the Code of the key, or a character "a-z" which is converted to a keyCode value.
- * optModifiers is an Optional list of modifiers passed as additional paramerters.
+ * @param {number=} modifiers Optional list of modifiers passed as additional paramerters.
  */
-WebInspector.KeyboardShortcut.makeKey = function(keyCode, optModifiers)
+WebInspector.KeyboardShortcut.makeKey = function(keyCode, modifiers)
 {
     if (typeof keyCode === "string")
         keyCode = keyCode.charCodeAt(0) - 32;
-    var modifiers = WebInspector.KeyboardShortcut.Modifiers.None;
-    for (var i = 1; i < arguments.length; i++)
-        modifiers |= arguments[i];
+    modifiers = modifiers || WebInspector.KeyboardShortcut.Modifiers.None;
     return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers);
-};
+}
 
 WebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent)
 {
@@ -117,14 +115,10 @@ WebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent)
     if (keyboardEvent.metaKey)
         modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta;
     return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyboardEvent.keyCode, modifiers);
-};
+}
 
-WebInspector.KeyboardShortcut.makeDescriptor = function(key, optModifiers)
+WebInspector.KeyboardShortcut.makeDescriptor = function(key, modifiers)
 {
-    var modifiers = 0;
-    for (var i = 1; i < arguments.length; i++)
-        modifiers |= arguments[i];
-
     return {
         key: WebInspector.KeyboardShortcut.makeKey(typeof key === "string" ? key : key.code, modifiers),
         name: WebInspector.KeyboardShortcut.shortcutToString(key, modifiers)
index 425c8c1..a001e83 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceCSSTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index 414f70e..2565e49 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceCSSTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index f69cbfc..5ad332a 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceHTMLTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index efd9900..5d5550b 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceHTMLTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index 11cedc7..06cf8f6 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceJavaScriptTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index ba6556b..60bf8cf 100644 (file)
 // | sed 's|unsigned\ int|var|' \
 // | sed 's|var\ yych|case 1: var yych|'
 
+/**
+ * @constructor
+ * @extends {WebInspector.SourceTokenizer}
+ */
 WebInspector.SourceJavaScriptTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
index e74be61..7a8a6ac 100644 (file)
@@ -29,6 +29,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.SourceTokenizer = function()
 {
 }
@@ -61,10 +64,20 @@ WebInspector.SourceTokenizer.prototype = {
     _charAt: function(cursor)
     {
         return cursor < this._line.length ? this._line.charAt(cursor) : "\n";
+    },
+
+    createInitialCondition: function()
+    {
+    },
+
+    nextToken: function(cursor)
+    {
     }
 }
 
-
+/**
+ * @constructor
+ */
 WebInspector.SourceTokenizer.Registry = function() {
     this._tokenizers = {};
     this._tokenizerConstructors = {
index e52f878..08ac2f3 100644 (file)
@@ -29,6 +29,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.TextEditorHighlighter = function(textModel, damageCallback)
 {
     this._textModel = textModel;
@@ -50,7 +53,10 @@ WebInspector.TextEditorHighlighter.prototype = {
         this._highlightChunkLimit = highlightChunkLimit;
     },
 
-    highlight: function(endLine, opt_forceRun)
+    /**
+     * @param {boolean=} forceRun
+     */
+    highlight: function(endLine, forceRun)
     {
         // First check if we have work to do.
         var state = this._textModel.getAttribute(endLine - 1, "highlight");
@@ -61,7 +67,7 @@ WebInspector.TextEditorHighlighter.prototype = {
 
         this._requestedEndLine = endLine;
 
-        if (this._highlightTimer && !opt_forceRun) {
+        if (this._highlightTimer && !forceRun) {
             // There is a timer scheduled, it will catch the new job based on the new endLine set.
             return;
         }
@@ -69,7 +75,7 @@ WebInspector.TextEditorHighlighter.prototype = {
         // We will be highlighting. First rewind to the last highlighted line to gain proper highlighter context.
         var startLine = endLine;
         while (startLine > 0) {
-            var state = this._textModel.getAttribute(startLine - 1, "highlight");
+            state = this._textModel.getAttribute(startLine - 1, "highlight");
             if (state && state.postConditionStringified)
                 break;
             startLine--;
@@ -145,7 +151,7 @@ WebInspector.TextEditorHighlighter.prototype = {
 
         var tokensCount = 0;
         for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) {
-            var state = this._selectHighlightState(lineNumber, postConditionStringified);
+            state = this._selectHighlightState(lineNumber, postConditionStringified);
             if (state.postConditionStringified) {
                 // This line is already highlighted.
                 postConditionStringified = state.postConditionStringified;
@@ -193,7 +199,7 @@ WebInspector.TextEditorHighlighter.prototype = {
 
                 // Advance the "pointer" to the last highlighted line within the given chunk.
                 for (; lineNumber < endLine; ++lineNumber) {
-                    var state = this._textModel.getAttribute(lineNumber, "highlight");
+                    state = this._textModel.getAttribute(lineNumber, "highlight");
                     if (!state || !state.postConditionStringified)
                         break;
                 }
index 6a09346..460c44e 100644 (file)
@@ -28,6 +28,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @constructor
+ */
 WebInspector.TextRange = function(startLine, startColumn, endLine, endColumn)
 {
     this.startLine = startLine;
@@ -53,6 +56,9 @@ WebInspector.TextRange.prototype = {
     }
 }
 
+/**
+ * @constructor
+ */
 WebInspector.TextEditorModel = function()
 {
     this._lines = [""];
index c39fd4e..325e638 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @extends {WebInspector.View}
+ * @constructor
+ */
 WebInspector.TextViewer = function(textModel, platform, url, delegate)
 {
     WebInspector.View.call(this);
@@ -323,54 +327,34 @@ WebInspector.TextViewer.prototype = {
 
 WebInspector.TextViewer.prototype.__proto__ = WebInspector.View.prototype;
 
+/**
+ * @interface
+ */
 WebInspector.TextViewerDelegate = function()
 {
 }
 
 WebInspector.TextViewerDelegate.prototype = {
-    doubleClick: function(lineNumber)
-    {
-        // Should be implemented by subclasses.
-    },
+    doubleClick: function(lineNumber) { },
 
-    beforeTextChanged: function()
-    {
-        // Should be implemented by subclasses.
-    },
+    beforeTextChanged: function() { },
 
-    afterTextChanged: function(oldRange, newRange)
-    {
-        // Should be implemented by subclasses.
-    },
+    afterTextChanged: function(oldRange, newRange) { },
 
-    commitEditing: function()
-    {
-        // Should be implemented by subclasses.
-    },
+    commitEditing: function() { },
 
-    cancelEditing: function()
-    {
-        // Should be implemented by subclasses.
-    },
+    cancelEditing: function() { },
 
-    populateLineGutterContextMenu: function(lineNumber, contextMenu)
-    {
-        // Should be implemented by subclasses.
-    },
+    populateLineGutterContextMenu: function(lineNumber, contextMenu) { },
 
-    populateTextAreaContextMenu: function(contextMenu)
-    {
-        // Should be implemented by subclasses.
-    },
+    populateTextAreaContextMenu: function(contextMenu) { },
 
-    suggestedFileName: function()
-    {
-        // Should be implemented by subclasses.
-    }
+    suggestedFileName: function() { }
 }
 
-WebInspector.TextViewerDelegate.prototype.__proto__ = WebInspector.Object.prototype;
-
+/**
+ * @constructor
+ */
 WebInspector.TextEditorChunkedPanel = function(textModel)
 {
     this._textModel = textModel;
@@ -643,6 +627,10 @@ WebInspector.TextEditorChunkedPanel.prototype = {
     }
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.TextEditorChunkedPanel}
+ */
 WebInspector.TextEditorGutterPanel = function(textModel, syncDecorationsForLineListener, syncLineHeightListener)
 {
     WebInspector.TextEditorChunkedPanel.call(this, textModel);
@@ -727,6 +715,9 @@ WebInspector.TextEditorGutterPanel.prototype = {
 
 WebInspector.TextEditorGutterPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype;
 
+/**
+ * @constructor
+ */
 WebInspector.TextEditorGutterChunk = function(textViewer, startLine, endLine)
 {
     this._textViewer = textViewer;
@@ -849,6 +840,10 @@ WebInspector.TextEditorGutterChunk.prototype = {
     }
 }
 
+/**
+ * @constructor
+ * @extends {WebInspector.TextEditorChunkedPanel}
+ */
 WebInspector.TextEditorMainPanel = function(textModel, url, syncScrollListener, syncDecorationsForLineListener, enterTextChangeMode, exitTextChangeMode)
 {
     WebInspector.TextEditorChunkedPanel.call(this, textModel);
@@ -1222,6 +1217,9 @@ WebInspector.TextEditorMainPanel.prototype = {
         this._paintLinesOperationsRefreshValue = Number.constrain(value, 150, 1500);
     },
 
+    /**
+     * @param {boolean=} restoreSelection
+     */
     _paintLines: function(fromLine, toLine, restoreSelection)
     {
         this._paintLineChunks([ { startLine: fromLine, endLine: toLine } ], restoreSelection);
@@ -1370,6 +1368,9 @@ WebInspector.TextEditorMainPanel.prototype = {
             return new WebInspector.TextRange(end.line, end.column, start.line, start.column);
     },
 
+    /**
+     * @param {boolean=} scrollIntoView
+     */
     _restoreSelection: function(range, scrollIntoView)
     {
         if (!range)
@@ -1459,7 +1460,8 @@ WebInspector.TextEditorMainPanel.prototype = {
         var lineRow = element.enclosingNodeOrSelfWithClass("webkit-line-content");
         if (lineRow)
             return lineRow;
-        for (var lineRow = element; lineRow; lineRow = lineRow.parentElement) {
+
+        for (lineRow = element; lineRow; lineRow = lineRow.parentElement) {
             if (lineRow.parentElement === this._container)
                 return lineRow;
         }
@@ -1503,7 +1505,7 @@ WebInspector.TextEditorMainPanel.prototype = {
         else
             quote = null;
 
-        var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, null, isExternal);
+        var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, undefined, isExternal);
         var span = document.createElement("span");
         span.className = "webkit-html-attribute-value";
         if (quote)
@@ -1514,6 +1516,9 @@ WebInspector.TextEditorMainPanel.prototype = {
         return span;
     },
 
+    /**
+     * @param {boolean=} isExternal
+     */
     _rewriteHref: function(hrefValue, isExternal)
     {
         if (!this._url || !hrefValue || hrefValue.indexOf("://") > 0)
@@ -1650,8 +1655,8 @@ WebInspector.TextEditorMainPanel.prototype = {
                 ++startColumn;
             lines[0] = line2.substring(startColumn);
 
-            var line1 = this._textModel.line(endLine - 1);
-            var line2 = lines[lines.length - 1];
+            line1 = this._textModel.line(endLine - 1);
+            line2 = lines[lines.length - 1];
             for (var i = 0; i < endColumn && i < line2.length; ++i) {
                 if (startLine === endLine - 1 && endColumn - i <= startColumn)
                     break;
@@ -1777,10 +1782,10 @@ WebInspector.TextEditorMainPanel.prototype = {
 
         // Delete all DOM elements that were either controlled by the old chunks, or have just been inserted.
         var firstUnmodifiedLineRow = null;
-        var chunk = this._textChunks[lastChunkNumber + 1];
-        if (chunk) {
+        chunk = this._textChunks[lastChunkNumber + 1];
+        if (chunk)
             firstUnmodifiedLineRow = chunk.expanded ? chunk.getExpandedLineRow(chunk.startLine) : chunk.element;
-        }
+
         while (firstLineRow && firstLineRow !== firstUnmodifiedLineRow) {
             var lineRow = firstLineRow;
             firstLineRow = firstLineRow.nextSibling;
@@ -1857,6 +1862,9 @@ WebInspector.TextEditorMainPanel.prototype = {
 
 WebInspector.TextEditorMainPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype;
 
+/**
+ * @constructor
+ */
 WebInspector.TextEditorMainChunk = function(textViewer, startLine, endLine)
 {
     this._textViewer = textViewer;
index 1bb23f1..a93dfde 100644 (file)
@@ -61,6 +61,12 @@ WebInspector.formatLinkText = function(url, lineNumber) {}
 WebInspector.displayNameForURL = function(url) {}
 
 /**
+ * @param {string} url
+ * @param {string} href
+ */
+WebInspector.completeURL = function(url, href) {}
+
+/**
  * @param {string} str
  * @param {...*} varArgs
  */
@@ -183,11 +189,14 @@ WebInspector.previousFocusElement = null;
 WebInspector.platformFlavor = "";
 
 /** @param {Element} element */
-window.getComputedStyle = function(element)
-{
-}
+window.getComputedStyle = function(element) {}
 
 /**
  * @type {boolean}
  */
 Event.prototype.isMetaOrCtrlForTest = false;
+
+/**
+ * @param {...*} vararg
+ */
+Event.prototype.initWebKitWheelEvent = function(vararg) {}
index a3bd0d9..505bf97 100644 (file)
@@ -838,6 +838,9 @@ function isEnterKey(event) {
     return event.keyCode !== 229 && event.keyIdentifier === "Enter";
 }
 
+/**
+ * @param {Array.<Object>=} domChanges
+ */
 function highlightSearchResult(element, offset, length, domChanges)
 {
     var result = highlightSearchResults(element, [{offset: offset, length: length }], domChanges);