Changeset 96597 in webkit
- Timestamp:
- Oct 4, 2011 9:11:59 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96596 r96597 1 2011-10-04 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: compile text editor. 4 https://bugs.webkit.org/show_bug.cgi?id=69339 5 6 Drive-by compilation for color, database and dom storage entities. 7 8 Reviewed by Yury Semikhatsky. 9 10 * inspector/Inspector.json: 11 * inspector/compile-front-end.sh: 12 * inspector/front-end/Color.js: 13 (WebInspector.Color.prototype._individualRGBValueToFloatValue): 14 * inspector/front-end/KeyboardShortcut.js: 15 (WebInspector.KeyboardShortcut.makeKey): 16 (WebInspector.KeyboardShortcut.makeKeyFromEvent): 17 (WebInspector.KeyboardShortcut.makeDescriptor): 18 * inspector/front-end/SourceCSSTokenizer.js: 19 * inspector/front-end/SourceCSSTokenizer.re2js: 20 * inspector/front-end/SourceHTMLTokenizer.js: 21 * inspector/front-end/SourceHTMLTokenizer.re2js: 22 * inspector/front-end/SourceJavaScriptTokenizer.js: 23 * inspector/front-end/SourceJavaScriptTokenizer.re2js: 24 * inspector/front-end/SourceTokenizer.js: 25 (WebInspector.SourceTokenizer.prototype._charAt): 26 (WebInspector.SourceTokenizer.prototype.createInitialCondition): 27 (WebInspector.SourceTokenizer.prototype.nextToken): 28 * inspector/front-end/TextEditorHighlighter.js: 29 (WebInspector.TextEditorHighlighter.prototype.highlight): 30 (WebInspector.TextEditorHighlighter.prototype._highlightLines): 31 * inspector/front-end/TextEditorModel.js: 32 * inspector/front-end/TextViewer.js: 33 (WebInspector.TextViewerDelegate.prototype.doubleClick): 34 (WebInspector.TextViewerDelegate.prototype.beforeTextChanged): 35 (WebInspector.TextViewerDelegate.prototype.afterTextChanged): 36 (WebInspector.TextViewerDelegate.prototype.commitEditing): 37 (WebInspector.TextViewerDelegate.prototype.cancelEditing): 38 (WebInspector.TextViewerDelegate.prototype.populateLineGutterContextMenu): 39 (WebInspector.TextViewerDelegate.prototype.populateTextAreaContextMenu): 40 (WebInspector.TextViewerDelegate.prototype.suggestedFileName): 41 (WebInspector.TextEditorMainPanel.prototype._enclosingLineRowOrSelf): 42 (WebInspector.TextEditorMainPanel.prototype._createLink): 43 (WebInspector.TextEditorMainPanel.prototype._applyDomUpdates): 44 (WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges): 45 * inspector/front-end/externs.js: 46 (WebInspector.completeURL): 47 (window.getComputedStyle): 48 (Event.prototype.initWebKitWheelEvent): 49 * inspector/front-end/utilities.js: 50 1 51 2011-10-04 Vsevolod Vlasov <vsevik@chromium.org> 2 52 -
trunk/Source/WebCore/inspector/Inspector.json
r96576 r96597 764 764 "id": "Database", 765 765 "type": "object", 766 "description": "Database object." 766 "description": "Database object.", 767 "hidden": true, 768 "properties": [ 769 { "name": "id", "type": "string", "description": "Database ID." }, 770 { "name": "domain", "type": "string", "description": "Database domain." }, 771 { "name": "name", "type": "string", "description": "Database name." }, 772 { "name": "version", "type": "string", "description": "Database version." } 773 ] 767 774 }, 768 775 { -
trunk/Source/WebCore/inspector/compile-front-end.sh
r96591 r96597 45 45 --js Source/WebCore/inspector/front-end/Settings.js \ 46 46 --js Source/WebCore/inspector/front-end/UserMetrics.js \ 47 --module jsmodule_sdk: 18:jsmodule_common \47 --module jsmodule_sdk:20:jsmodule_common \ 48 48 --js Source/WebCore/inspector/front-end/CompilerSourceMapping.js \ 49 49 --js Source/WebCore/inspector/front-end/CompilerSourceMappingProvider.js \ … … 52 52 --js Source/WebCore/inspector/front-end/CookieParser.js \ 53 53 --js Source/WebCore/inspector/front-end/BreakpointManager.js \ 54 --js Source/WebCore/inspector/front-end/Database.js \ 54 55 --js Source/WebCore/inspector/front-end/DOMAgent.js \ 56 --js Source/WebCore/inspector/front-end/DOMStorage.js \ 55 57 --js Source/WebCore/inspector/front-end/DebuggerModel.js \ 56 58 --js Source/WebCore/inspector/front-end/DebuggerPresentationModel.js \ … … 64 66 --js Source/WebCore/inspector/front-end/NetworkManager.js \ 65 67 --js Source/WebCore/inspector/front-end/UISourceCode.js \ 66 --module jsmodule_ui:2 2:jsmodule_common \68 --module jsmodule_ui:27:jsmodule_common \ 67 69 --js Source/WebCore/inspector/front-end/Checkbox.js \ 70 --js Source/WebCore/inspector/front-end/Color.js \ 68 71 --js Source/WebCore/inspector/front-end/ContextMenu.js \ 69 72 --js Source/WebCore/inspector/front-end/DataGrid.js \ … … 81 84 --js Source/WebCore/inspector/front-end/ShortcutsScreen.js \ 82 85 --js Source/WebCore/inspector/front-end/SoftContextMenu.js \ 86 --js Source/WebCore/inspector/front-end/SourceTokenizer.js \ 83 87 --js Source/WebCore/inspector/front-end/StatusBarButton.js \ 84 88 --js Source/WebCore/inspector/front-end/TabbedPane.js \ 89 --js Source/WebCore/inspector/front-end/TextEditorModel.js \ 90 --js Source/WebCore/inspector/front-end/TextEditorHighlighter.js \ 85 91 --js Source/WebCore/inspector/front-end/TextPrompt.js \ 92 --js Source/WebCore/inspector/front-end/TextViewer.js \ 86 93 --js Source/WebCore/inspector/front-end/Toolbar.js \ 87 94 --js Source/WebCore/inspector/front-end/UIUtils.js \ -
trunk/Source/WebCore/inspector/front-end/Color.js
r96543 r96597 28 28 */ 29 29 30 /** 31 * @constructor 32 */ 30 33 WebInspector.Color = function(str) 31 34 { … … 34 37 } 35 38 39 /** 40 * @param {number=} a 41 */ 36 42 WebInspector.Color.fromRGBA = function(r, g, b, a) 37 43 { … … 202 208 203 209 if (rgbValue.indexOf("%") === -1) { 204 var intValue = parseInt(rgbValue );210 var intValue = parseInt(rgbValue, 10); 205 211 return this._clamp(rgbValue, 0, 255); 206 212 } -
trunk/Source/WebCore/inspector/front-end/KeyboardShortcut.js
r96575 r96597 94 94 * It is useful for matching pressed keys. 95 95 * keyCode is the Code of the key, or a character "a-z" which is converted to a keyCode value. 96 * optModifiers is anOptional list of modifiers passed as additional paramerters.96 * @param {number=} modifiers Optional list of modifiers passed as additional paramerters. 97 97 */ 98 WebInspector.KeyboardShortcut.makeKey = function(keyCode, optModifiers)98 WebInspector.KeyboardShortcut.makeKey = function(keyCode, modifiers) 99 99 { 100 100 if (typeof keyCode === "string") 101 101 keyCode = keyCode.charCodeAt(0) - 32; 102 var modifiers = WebInspector.KeyboardShortcut.Modifiers.None; 103 for (var i = 1; i < arguments.length; i++) 104 modifiers |= arguments[i]; 102 modifiers = modifiers || WebInspector.KeyboardShortcut.Modifiers.None; 105 103 return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers); 106 } ;104 } 107 105 108 106 WebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent) … … 118 116 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta; 119 117 return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyboardEvent.keyCode, modifiers); 120 } ;118 } 121 119 122 WebInspector.KeyboardShortcut.makeDescriptor = function(key, optModifiers)120 WebInspector.KeyboardShortcut.makeDescriptor = function(key, modifiers) 123 121 { 124 var modifiers = 0;125 for (var i = 1; i < arguments.length; i++)126 modifiers |= arguments[i];127 128 122 return { 129 123 key: WebInspector.KeyboardShortcut.makeKey(typeof key === "string" ? key : key.code, modifiers), -
trunk/Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
r94754 r96597 42 42 // | sed 's|var\ yych|case 1: case 1: var yych|' 43 43 44 /** 45 * @constructor 46 * @extends {WebInspector.SourceTokenizer} 47 */ 44 48 WebInspector.SourceCSSTokenizer = function() 45 49 { -
trunk/Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
r91777 r96597 41 41 // | sed 's|var\ yych|case 1: var yych|' 42 42 43 /** 44 * @constructor 45 * @extends {WebInspector.SourceTokenizer} 46 */ 43 47 WebInspector.SourceCSSTokenizer = function() 44 48 { -
trunk/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js
r94754 r96597 42 42 // | sed 's|var\ yych|case 1: case 1: var yych|' 43 43 44 /** 45 * @constructor 46 * @extends {WebInspector.SourceTokenizer} 47 */ 44 48 WebInspector.SourceHTMLTokenizer = function() 45 49 { -
trunk/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
r86430 r96597 41 41 // | sed 's|var\ yych|case 1: var yych|' 42 42 43 /** 44 * @constructor 45 * @extends {WebInspector.SourceTokenizer} 46 */ 43 47 WebInspector.SourceHTMLTokenizer = function() 44 48 { -
trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
r94754 r96597 43 43 // | sed 's|var\ yych|case 1: case 1: var yych|' 44 44 45 /** 46 * @constructor 47 * @extends {WebInspector.SourceTokenizer} 48 */ 45 49 WebInspector.SourceJavaScriptTokenizer = function() 46 50 { -
trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
r86554 r96597 42 42 // | sed 's|var\ yych|case 1: var yych|' 43 43 44 /** 45 * @constructor 46 * @extends {WebInspector.SourceTokenizer} 47 */ 44 48 WebInspector.SourceJavaScriptTokenizer = function() 45 49 { -
trunk/Source/WebCore/inspector/front-end/SourceTokenizer.js
r86430 r96597 30 30 */ 31 31 32 /** 33 * @constructor 34 */ 32 35 WebInspector.SourceTokenizer = function() 33 36 { … … 62 65 { 63 66 return cursor < this._line.length ? this._line.charAt(cursor) : "\n"; 67 }, 68 69 createInitialCondition: function() 70 { 71 }, 72 73 nextToken: function(cursor) 74 { 64 75 } 65 76 } 66 77 67 78 /** 79 * @constructor 80 */ 68 81 WebInspector.SourceTokenizer.Registry = function() { 69 82 this._tokenizers = {}; -
trunk/Source/WebCore/inspector/front-end/TextEditorHighlighter.js
r86430 r96597 30 30 */ 31 31 32 /** 33 * @constructor 34 */ 32 35 WebInspector.TextEditorHighlighter = function(textModel, damageCallback) 33 36 { … … 51 54 }, 52 55 53 highlight: function(endLine, opt_forceRun) 56 /** 57 * @param {boolean=} forceRun 58 */ 59 highlight: function(endLine, forceRun) 54 60 { 55 61 // First check if we have work to do. … … 62 68 this._requestedEndLine = endLine; 63 69 64 if (this._highlightTimer && ! opt_forceRun) {70 if (this._highlightTimer && !forceRun) { 65 71 // There is a timer scheduled, it will catch the new job based on the new endLine set. 66 72 return; … … 70 76 var startLine = endLine; 71 77 while (startLine > 0) { 72 varstate = this._textModel.getAttribute(startLine - 1, "highlight");78 state = this._textModel.getAttribute(startLine - 1, "highlight"); 73 79 if (state && state.postConditionStringified) 74 80 break; … … 146 152 var tokensCount = 0; 147 153 for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { 148 varstate = this._selectHighlightState(lineNumber, postConditionStringified);154 state = this._selectHighlightState(lineNumber, postConditionStringified); 149 155 if (state.postConditionStringified) { 150 156 // This line is already highlighted. … … 194 200 // Advance the "pointer" to the last highlighted line within the given chunk. 195 201 for (; lineNumber < endLine; ++lineNumber) { 196 varstate = this._textModel.getAttribute(lineNumber, "highlight");202 state = this._textModel.getAttribute(lineNumber, "highlight"); 197 203 if (!state || !state.postConditionStringified) 198 204 break; -
trunk/Source/WebCore/inspector/front-end/TextEditorModel.js
r94754 r96597 29 29 */ 30 30 31 /** 32 * @constructor 33 */ 31 34 WebInspector.TextRange = function(startLine, startColumn, endLine, endColumn) 32 35 { … … 54 57 } 55 58 59 /** 60 * @constructor 61 */ 56 62 WebInspector.TextEditorModel = function() 57 63 { -
trunk/Source/WebCore/inspector/front-end/TextViewer.js
r96219 r96597 30 30 */ 31 31 32 /** 33 * @extends {WebInspector.View} 34 * @constructor 35 */ 32 36 WebInspector.TextViewer = function(textModel, platform, url, delegate) 33 37 { … … 324 328 WebInspector.TextViewer.prototype.__proto__ = WebInspector.View.prototype; 325 329 330 /** 331 * @interface 332 */ 326 333 WebInspector.TextViewerDelegate = function() 327 334 { … … 329 336 330 337 WebInspector.TextViewerDelegate.prototype = { 331 doubleClick: function(lineNumber) 332 { 333 // Should be implemented by subclasses. 334 }, 335 336 beforeTextChanged: function() 337 { 338 // Should be implemented by subclasses. 339 }, 340 341 afterTextChanged: function(oldRange, newRange) 342 { 343 // Should be implemented by subclasses. 344 }, 345 346 commitEditing: function() 347 { 348 // Should be implemented by subclasses. 349 }, 350 351 cancelEditing: function() 352 { 353 // Should be implemented by subclasses. 354 }, 355 356 populateLineGutterContextMenu: function(lineNumber, contextMenu) 357 { 358 // Should be implemented by subclasses. 359 }, 360 361 populateTextAreaContextMenu: function(contextMenu) 362 { 363 // Should be implemented by subclasses. 364 }, 365 366 suggestedFileName: function() 367 { 368 // Should be implemented by subclasses. 369 } 338 doubleClick: function(lineNumber) { }, 339 340 beforeTextChanged: function() { }, 341 342 afterTextChanged: function(oldRange, newRange) { }, 343 344 commitEditing: function() { }, 345 346 cancelEditing: function() { }, 347 348 populateLineGutterContextMenu: function(lineNumber, contextMenu) { }, 349 350 populateTextAreaContextMenu: function(contextMenu) { }, 351 352 suggestedFileName: function() { } 370 353 } 371 354 372 WebInspector.TextViewerDelegate.prototype.__proto__ = WebInspector.Object.prototype; 373 355 /** 356 * @constructor 357 */ 374 358 WebInspector.TextEditorChunkedPanel = function(textModel) 375 359 { … … 644 628 } 645 629 630 /** 631 * @constructor 632 * @extends {WebInspector.TextEditorChunkedPanel} 633 */ 646 634 WebInspector.TextEditorGutterPanel = function(textModel, syncDecorationsForLineListener, syncLineHeightListener) 647 635 { … … 728 716 WebInspector.TextEditorGutterPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype; 729 717 718 /** 719 * @constructor 720 */ 730 721 WebInspector.TextEditorGutterChunk = function(textViewer, startLine, endLine) 731 722 { … … 850 841 } 851 842 843 /** 844 * @constructor 845 * @extends {WebInspector.TextEditorChunkedPanel} 846 */ 852 847 WebInspector.TextEditorMainPanel = function(textModel, url, syncScrollListener, syncDecorationsForLineListener, enterTextChangeMode, exitTextChangeMode) 853 848 { … … 1223 1218 }, 1224 1219 1220 /** 1221 * @param {boolean=} restoreSelection 1222 */ 1225 1223 _paintLines: function(fromLine, toLine, restoreSelection) 1226 1224 { … … 1371 1369 }, 1372 1370 1371 /** 1372 * @param {boolean=} scrollIntoView 1373 */ 1373 1374 _restoreSelection: function(range, scrollIntoView) 1374 1375 { … … 1460 1461 if (lineRow) 1461 1462 return lineRow; 1462 for (var lineRow = element; lineRow; lineRow = lineRow.parentElement) { 1463 1464 for (lineRow = element; lineRow; lineRow = lineRow.parentElement) { 1463 1465 if (lineRow.parentElement === this._container) 1464 1466 return lineRow; … … 1504 1506 quote = null; 1505 1507 1506 var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, null, isExternal);1508 var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, undefined, isExternal); 1507 1509 var span = document.createElement("span"); 1508 1510 span.className = "webkit-html-attribute-value"; … … 1515 1517 }, 1516 1518 1519 /** 1520 * @param {boolean=} isExternal 1521 */ 1517 1522 _rewriteHref: function(hrefValue, isExternal) 1518 1523 { … … 1651 1656 lines[0] = line2.substring(startColumn); 1652 1657 1653 varline1 = this._textModel.line(endLine - 1);1654 varline2 = lines[lines.length - 1];1658 line1 = this._textModel.line(endLine - 1); 1659 line2 = lines[lines.length - 1]; 1655 1660 for (var i = 0; i < endColumn && i < line2.length; ++i) { 1656 1661 if (startLine === endLine - 1 && endColumn - i <= startColumn) … … 1778 1783 // Delete all DOM elements that were either controlled by the old chunks, or have just been inserted. 1779 1784 var firstUnmodifiedLineRow = null; 1780 varchunk = this._textChunks[lastChunkNumber + 1];1781 if (chunk) {1785 chunk = this._textChunks[lastChunkNumber + 1]; 1786 if (chunk) 1782 1787 firstUnmodifiedLineRow = chunk.expanded ? chunk.getExpandedLineRow(chunk.startLine) : chunk.element; 1783 } 1788 1784 1789 while (firstLineRow && firstLineRow !== firstUnmodifiedLineRow) { 1785 1790 var lineRow = firstLineRow; … … 1858 1863 WebInspector.TextEditorMainPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype; 1859 1864 1865 /** 1866 * @constructor 1867 */ 1860 1868 WebInspector.TextEditorMainChunk = function(textViewer, startLine, endLine) 1861 1869 { -
trunk/Source/WebCore/inspector/front-end/externs.js
r96591 r96597 62 62 63 63 /** 64 * @param {string} url 65 * @param {string} href 66 */ 67 WebInspector.completeURL = function(url, href) {} 68 69 /** 64 70 * @param {string} str 65 71 * @param {...*} varArgs … … 184 190 185 191 /** @param {Element} element */ 186 window.getComputedStyle = function(element) 187 { 188 } 192 window.getComputedStyle = function(element) {} 189 193 190 194 /** … … 192 196 */ 193 197 Event.prototype.isMetaOrCtrlForTest = false; 198 199 /** 200 * @param {...*} vararg 201 */ 202 Event.prototype.initWebKitWheelEvent = function(vararg) {} -
trunk/Source/WebCore/inspector/front-end/utilities.js
r96575 r96597 839 839 } 840 840 841 /** 842 * @param {Array.<Object>=} domChanges 843 */ 841 844 function highlightSearchResult(element, offset, length, domChanges) 842 845 {
Note: See TracChangeset
for help on using the changeset viewer.