Changeset 103682 in webkit
- Timestamp:
- Dec 26, 2011, 4:39:39 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r103681 r103682 1 2011-12-26 Alexander Pavlov <[email protected]> 2 3 Web Inspector: Implement "Go to Function" dialog for JavaScript 4 https://bugs.webkit.org/show_bug.cgi?id=75092 5 6 Reviewed by Pavel Feldman. 7 8 * English.lproj/localizedStrings.js: 9 * WebCore.gypi: 10 * WebCore.vcproj/WebCore.vcproj: 11 * inspector/compile-front-end.sh: 12 * inspector/front-end/JavaScriptOutlineDialog.js: Added. 13 (WebInspector.JavaScriptOutlineDialog.onMouseDown): 14 (WebInspector.JavaScriptOutlineDialog): 15 (WebInspector.JavaScriptOutlineDialog.didAddChunk): 16 (WebInspector.JavaScriptOutlineDialog.install): 17 (WebInspector.JavaScriptOutlineDialog._show): 18 (WebInspector.JavaScriptOutlineDialog.createShortcut): 19 (WebInspector.JavaScriptOutlineDialog.prototype._resizeWindow): 20 (WebInspector.JavaScriptOutlineDialog.prototype._appendItemElements): 21 (WebInspector.JavaScriptOutlineDialog.prototype._createSearchRegExp): 22 (WebInspector.JavaScriptOutlineDialog.prototype._filterFunctions): 23 (WebInspector.JavaScriptOutlineDialog.prototype._selectFirstItem): 24 (WebInspector.JavaScriptOutlineDialog.prototype._hide): 25 (WebInspector.JavaScriptOutlineDialog.prototype._onBlur): 26 (WebInspector.JavaScriptOutlineDialog.prototype._onKeyDown.previousItem): 27 (WebInspector.JavaScriptOutlineDialog.prototype._onKeyDown.nextItem): 28 (WebInspector.JavaScriptOutlineDialog.prototype._onKeyDown): 29 (WebInspector.JavaScriptOutlineDialog.prototype._scheduleFilter): 30 (WebInspector.JavaScriptOutlineDialog.prototype._updateSelection): 31 (WebInspector.JavaScriptOutlineDialog.prototype._onClick): 32 (WebInspector.JavaScriptOutlineDialog.prototype._onMouseMove): 33 (WebInspector.JavaScriptOutlineDialog.prototype._highlightFunctionLine): 34 * inspector/front-end/JavaScriptSourceFrame.js: 35 (WebInspector.JavaScriptSourceFrame.prototype.get uiSourceCode): 36 * inspector/front-end/ScriptsPanel.js: 37 (WebInspector.ScriptsPanel.prototype._didBuildOutlineChunk): 38 (WebInspector.ScriptsPanel.prototype._reset): 39 (WebInspector.ScriptsPanel.prototype.requestVisibleScriptOutline): 40 (WebInspector.ScriptsPanel.prototype._createEditorToolbar): 41 * inspector/front-end/WebKit.qrc: 42 * inspector/front-end/inspector.html: 43 * inspector/front-end/javaScriptOutlineDialog.css: Added. 44 (.js-outline-dialog): 45 (.js-outline-dialog > input): 46 (.js-outline-dialog > div.progress): 47 (.js-outline-dialog > div.container): 48 (.js-outline-dialog > .container > div.item): 49 (.js-outline-dialog > .container > div.item.selected): 50 1 51 2011-12-26 Pavel Feldman <[email protected]> 2 52 -
trunk/Source/WebCore/WebCore.gypi
r103625 r103682 6432 6432 'inspector/front-end/inspector.js', 6433 6433 'inspector/front-end/JavaScriptFormatter.js', 6434 'inspector/front-end/JavaScriptOutlineDialog.js', 6434 6435 'inspector/front-end/JavaScriptSourceFrame.js', 6435 6436 'inspector/front-end/KeyboardShortcut.js', … … 6515 6516 'inspector/front-end/WorkersSidebarPane.js', 6516 6517 'inspector/front-end/goToLineDialog.css', 6518 'inspector/front-end/javaScriptOutlineDialog.css', 6517 6519 'inspector/front-end/helpScreen.css', 6518 6520 'inspector/front-end/inspector.css', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r103555 r103682 71746 71746 </File> 71747 71747 <File 71748 RelativePath="..\inspector\front-end\JavaScriptOutlineDialog.js" 71749 > 71750 </File> 71751 <File 71752 RelativePath="..\inspector\front-end\javaScriptOutlineDialog.css" 71753 > 71754 </File> 71755 <File 71748 71756 RelativePath="..\inspector\front-end\JavaScriptSourceFrame.js" 71749 71757 > -
trunk/Source/WebCore/inspector/compile-front-end.sh
r103681 r103682 111 111 --js Source/WebCore/inspector/front-end/View.js \ 112 112 --js Source/WebCore/inspector/front-end/WelcomeView.js \ 113 --module jsmodule_components:1 5:jsmodule_sdk,jsmodule_ui \113 --module jsmodule_components:16:jsmodule_sdk,jsmodule_ui \ 114 114 --js Source/WebCore/inspector/front-end/ConsoleMessage.js \ 115 115 --js Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js \ … … 120 120 --js Source/WebCore/inspector/front-end/GoToLineDialog.js \ 121 121 --js Source/WebCore/inspector/front-end/JavaScriptContextManager.js \ 122 --js Source/WebCore/inspector/front-end/JavaScriptOutlineDialog.js \ 122 123 --js Source/WebCore/inspector/front-end/ObjectPopoverHelper.js \ 123 124 --js Source/WebCore/inspector/front-end/ObjectPropertiesSection.js \ -
trunk/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
r103541 r103682 54 54 55 55 WebInspector.JavaScriptSourceFrame.prototype = { 56 get uiSourceCode() 57 { 58 return this._uiSourceCode; 59 }, 60 56 61 // View events 57 62 willHide: function() -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r102756 r103682 43 43 } 44 44 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); 45 WebInspector.JavaScriptOutlineDialog.install(this, viewGetter.bind(this)); 45 46 46 47 this.editorToolbar = this._createEditorToolbar(); … … 121 122 helpSection.addKey(evaluateInConsoleShortcut.name, WebInspector.UIString("Evaluate selection in console")); 122 123 this.registerShortcut(evaluateInConsoleShortcut.key, this._evaluateSelectionInConsole.bind(this)); 124 125 var scriptOutlineShortcut = WebInspector.JavaScriptOutlineDialog.createShortcut(); 126 helpSection.addKey(scriptOutlineShortcut.name, WebInspector.UIString("Go to Function")); 123 127 124 128 var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel."); … … 219 223 if (!this.breakpointsActivated) 220 224 this._toggleBreakpointsClicked(); 225 }, 226 227 _didBuildOutlineChunk: function(event) 228 { 229 WebInspector.JavaScriptOutlineDialog.didAddChunk(event.data); 230 if (event.data.total === event.data.index) { 231 if (this._outlineWorker) { 232 this._outlineWorker.terminate(); 233 delete this._outlineWorker; 234 } 235 } 221 236 }, 222 237 … … 519 534 delete this._initialViewSelectionProcessed; 520 535 521 this.functionsSelectElement.removeChildren();522 536 this.visibleView = null; 523 537 … … 632 646 633 647 return sourceFrame; 648 }, 649 650 requestVisibleScriptOutline: function() 651 { 652 function contentCallback(mimeType, content) 653 { 654 if (this._outlineWorker) 655 this._outlineWorker.terminate(); 656 this._outlineWorker = new Worker("ScriptFormatterWorker.js"); 657 this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this); 658 const method = "outline"; 659 this._outlineWorker.postMessage({ method: method, params: { content: content, id: this.visibleView.uiSourceCode.id } }); 660 } 661 662 if (this.visibleView.uiSourceCode) 663 this.visibleView.uiSourceCode.requestContent(contentCallback.bind(this)); 634 664 }, 635 665 … … 1029 1059 editorToolbar.appendChild(this._filesSelectElement); 1030 1060 1031 this.functionsSelectElement = document.createElement("select");1032 this.functionsSelectElement.className = "status-bar-item";1033 this.functionsSelectElement.id = "scripts-functions";1034 1035 // FIXME: append the functions select element to the top status bar when it1036 // is implemented.1037 // editorToolbar.appendChild(this.functionsSelectElement);1038 1039 1061 return editorToolbar; 1040 1062 }, -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r103555 r103682 73 73 <file>JavaScriptContextManager.js</file> 74 74 <file>JavaScriptFormatter.js</file> 75 <file>JavaScriptOutlineDialog.js</file> 75 76 <file>JavaScriptSourceFrame.js</file> 76 77 <file>KeyboardShortcut.js</file> … … 165 166 <file>inspectorCommon.css</file> 166 167 <file>inspectorSyntaxHighlight.css</file> 168 <file>javaScriptOutlineDialog.css</file> 167 169 <file>networkLogView.css</file> 168 170 <file>networkPanel.css</file> -
trunk/Source/WebCore/inspector/front-end/inspector.html
r102671 r103682 114 114 <script type="text/javascript" src="SourceFrame.js"></script> 115 115 <script type="text/javascript" src="ResourceView.js"></script> 116 <script type="text/javascript" src="JavaScriptOutlineDialog.js"></script> 116 117 <script type="text/javascript" src="JavaScriptSourceFrame.js"></script> 117 118 <script type="text/javascript" src="SplitView.js"></script>
Note:
See TracChangeset
for help on using the changeset viewer.