Changeset 182054 in webkit
- Timestamp:
- Mar 27, 2015 12:26:27 AM (9 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r182053 r182054 1 2015-03-26 Timothy Hatcher <timothy@apple.com> 2 3 Web Inspector: Convert TextEditor classes to ES6 4 https://bugs.webkit.org/show_bug.cgi?id=143127 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Views/CSSStyleDeclarationTextEditor.js: 9 Removed a comment about const, we can't use it in strict mode / classes. 10 11 * UserInterface/Views/SourceCodeTextEditor.js: 12 * UserInterface/Views/TextEditor.js: 13 Converted to ES6 classes. 14 1 15 2015-03-26 Nikita Vasilyev <nvasilyev@apple.com> 2 16 -
trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
r181912 r182054 297 297 // undo, redo and paste are atomic and work better with a zero delay. CodeMirror identifies changes that 298 298 // get coalesced in the undo stack with a "+" prefix on the origin. Use that to set the delay for our coalescing. 299 // FIXME: use const or let300 299 var delay = change.origin && change.origin.charAt(0) === "+" ? WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0; 301 300 … … 338 337 if (!this._codeMirror.getOption("readOnly")) { 339 338 // Matches a comment like: /* -webkit-foo: bar; */ 340 // FIXME: use const or let341 339 var commentedPropertyRegex = /\/\*\s*[-\w]+\s*:\s*[^;]+;?\s*\*\//g; 342 340 -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r182047 r182054 24 24 */ 25 25 26 WebInspector.SourceCodeTextEditor = function(sourceCode)26 WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspector.TextEditor 27 27 { 28 console.assert(sourceCode instanceof WebInspector.SourceCode); 29 30 this._sourceCode = sourceCode; 31 this._breakpointMap = {}; 32 this._issuesLineNumberMap = new Map; 33 this._widgetMap = new Map; 34 this._contentPopulated = false; 35 this._invalidLineNumbers = {0: true}; 36 this._ignoreContentDidChange = 0; 37 38 WebInspector.TextEditor.call(this, null, null, this); 39 40 this._typeTokenScrollHandler = null; 41 this._typeTokenAnnotator = null; 42 this._basicBlockAnnotator = null; 43 44 this._isProbablyMinified = false; 45 46 // FIXME: Currently this just jumps between resources and related source map resources. It doesn't "jump to symbol" yet. 47 this._updateTokenTrackingControllerState(); 48 49 this.element.classList.add(WebInspector.SourceCodeTextEditor.StyleClassName); 50 51 if (this._supportsDebugging) { 52 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointStatusDidChange, this); 53 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointStatusDidChange, this); 54 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointStatusDidChange, this); 55 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this); 56 57 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange, this._breakpointsEnabledDidChange, this); 58 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this); 59 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this); 60 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this); 61 62 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this); 63 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this); 64 if (WebInspector.debuggerManager.activeCallFrame) 65 this._debuggerDidPause(); 66 67 this._activeCallFrameDidChange(); 68 } 69 70 WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this); 71 72 if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0) 73 WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); 74 else 75 this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this); 76 77 sourceCode.requestContent().then(this._contentAvailable.bind(this)); 78 79 // FIXME: Cmd+L shorcut doesn't actually work. 80 new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command, "L", this.showGoToLineDialog.bind(this), this.element); 81 new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "G", this.showGoToLineDialog.bind(this), this.element); 82 }; 83 84 // FIXME: Move to a WebInspector.Object subclass and we can remove this. 85 WebInspector.Object.deprecatedAddConstructorFunctions(WebInspector.SourceCodeTextEditor); 86 87 WebInspector.SourceCodeTextEditor.StyleClassName = "source-code"; 88 WebInspector.SourceCodeTextEditor.LineErrorStyleClassName = "error"; 89 WebInspector.SourceCodeTextEditor.LineWarningStyleClassName = "warning"; 90 WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName = "debugger-popover-content"; 91 WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName = "hovered-expression-highlight"; 92 WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken = 500; 93 WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease = 1000; 94 WebInspector.SourceCodeTextEditor.DurationToUpdateTypeTokensAfterScrolling = 100; 95 WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength = 500; 96 WebInspector.SourceCodeTextEditor.WidgetContainsMultipleIssuesSymbol = Symbol("source-code-widget-contains-multiple-issues"); 97 98 WebInspector.SourceCodeTextEditor.Event = { 99 ContentWillPopulate: "source-code-text-editor-content-will-populate", 100 ContentDidPopulate: "source-code-text-editor-content-did-populate" 101 }; 102 103 WebInspector.SourceCodeTextEditor.prototype = { 104 constructor: WebInspector.SourceCodeTextEditor, 28 constructor(sourceCode) 29 { 30 console.assert(sourceCode instanceof WebInspector.SourceCode); 31 32 super(); 33 34 this.delegate = this; 35 36 this._sourceCode = sourceCode; 37 this._breakpointMap = {}; 38 this._issuesLineNumberMap = new Map; 39 this._widgetMap = new Map; 40 this._contentPopulated = false; 41 this._invalidLineNumbers = {0: true}; 42 this._ignoreContentDidChange = 0; 43 44 this._typeTokenScrollHandler = null; 45 this._typeTokenAnnotator = null; 46 this._basicBlockAnnotator = null; 47 48 this._isProbablyMinified = false; 49 50 // FIXME: Currently this just jumps between resources and related source map resources. It doesn't "jump to symbol" yet. 51 this._updateTokenTrackingControllerState(); 52 53 this.element.classList.add("source-code"); 54 55 if (this._supportsDebugging) { 56 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointStatusDidChange, this); 57 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointStatusDidChange, this); 58 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointStatusDidChange, this); 59 WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this); 60 61 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointsEnabledDidChange, this._breakpointsEnabledDidChange, this); 62 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this); 63 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this); 64 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this); 65 66 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this); 67 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this); 68 if (WebInspector.debuggerManager.activeCallFrame) 69 this._debuggerDidPause(); 70 71 this._activeCallFrameDidChange(); 72 } 73 74 WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this); 75 76 if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0) 77 WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); 78 else 79 this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this); 80 81 sourceCode.requestContent().then(this._contentAvailable.bind(this)); 82 83 // FIXME: Cmd+L shorcut doesn't actually work. 84 new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command, "L", this.showGoToLineDialog.bind(this), this.element); 85 new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "G", this.showGoToLineDialog.bind(this), this.element); 86 } 105 87 106 88 // Public … … 109 91 { 110 92 return this._sourceCode; 111 } ,112 113 shown : function()93 } 94 95 shown() 114 96 { 115 97 WebInspector.TextEditor.prototype.shown.call(this); … … 126 108 this._setTypeTokenAnnotatorEnabledState(false); 127 109 } 128 } ,129 130 hidden : function()110 } 111 112 hidden() 131 113 { 132 114 WebInspector.TextEditor.prototype.hidden.call(this); … … 142 124 if (this._basicBlockAnnotator) 143 125 this._basicBlockAnnotator.pause(); 144 } ,145 146 close : function()126 } 127 128 close() 147 129 { 148 130 if (this._supportsDebugging) { … … 167 149 WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); 168 150 this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this); 169 } ,170 171 canBeFormatted : function()151 } 152 153 canBeFormatted() 172 154 { 173 155 // Currently we assume that source map resources are formatted how the author wants it. … … 179 161 180 162 return WebInspector.TextEditor.prototype.canBeFormatted.call(this); 181 } ,182 183 canShowTypeAnnotations : function()163 } 164 165 canShowTypeAnnotations() 184 166 { 185 167 return !!this._typeTokenAnnotator; 186 } ,187 188 customPerformSearch : function(query)168 } 169 170 customPerformSearch(query) 189 171 { 190 172 function searchResultCallback(error, matches) … … 234 216 DebuggerAgent.searchInContent(this._sourceCode.id, query, false, false, searchResultCallback.bind(this)); 235 217 return true; 236 } ,237 238 showGoToLineDialog : function()218 } 219 220 showGoToLineDialog() 239 221 { 240 222 if (!this._goToLineDialog) { … … 244 226 245 227 this._goToLineDialog.present(this.element); 246 } ,247 248 isGoToLineDialogValueValid : function(goToLineDialog, lineNumber)228 } 229 230 isGoToLineDialogValueValid(goToLineDialog, lineNumber) 249 231 { 250 232 return !isNaN(lineNumber) && lineNumber > 0 && lineNumber <= this.lineCount; 251 } ,252 253 goToLineDialogValueWasValidated : function(goToLineDialog, lineNumber)233 } 234 235 goToLineDialogValueWasValidated(goToLineDialog, lineNumber) 254 236 { 255 237 var position = new WebInspector.SourceCodePosition(lineNumber - 1, 0); 256 238 var range = new WebInspector.TextRange(lineNumber - 1, 0, lineNumber, 0); 257 239 this.revealPosition(position, range, false, true); 258 } ,259 260 goToLineDialogWasDismissed : function()240 } 241 242 goToLineDialogWasDismissed() 261 243 { 262 244 this.focus(); 263 } ,264 265 contentDidChange : function(replacedRanges, newRanges)266 { 267 WebInspector.TextEditor.prototype.contentDidChange.call(this,replacedRanges, newRanges);245 } 246 247 contentDidChange(replacedRanges, newRanges) 248 { 249 super.contentDidChange(replacedRanges, newRanges); 268 250 269 251 if (this._ignoreContentDidChange > 0) … … 278 260 this._basicBlockAnnotator = null; 279 261 } 280 } ,281 282 toggleTypeAnnotations : function()262 } 263 264 toggleTypeAnnotations() 283 265 { 284 266 if (!this._typeTokenAnnotator) … … 291 273 this._setTypeTokenAnnotatorEnabledState(newActivatedState); 292 274 return newActivatedState; 293 } ,294 295 showPopoverForTypes : function(types, bounds, title)275 } 276 277 showPopoverForTypes(types, bounds, title) 296 278 { 297 279 var content = document.createElement("div"); … … 309 291 310 292 this._showPopover(content, bounds); 311 } ,293 } 312 294 313 295 // Protected 314 296 315 prettyPrint : function(pretty)297 prettyPrint(pretty) 316 298 { 317 299 // The annotators must be cleared before pretty printing takes place and resumed … … 323 305 this._setTypeTokenAnnotatorEnabledState(false); 324 306 325 WebInspector.TextEditor.prototype.prettyPrint.call(this,pretty);307 super.prettyPrint(pretty); 326 308 327 309 if (pretty || !this._isProbablyMinified) { … … 333 315 this._setTypeTokenAnnotatorEnabledState(false); 334 316 } 335 } ,317 } 336 318 337 319 // Private 338 320 339 _unformattedLineInfoForEditorLineInfo : function(lineInfo)321 _unformattedLineInfoForEditorLineInfo(lineInfo) 340 322 { 341 323 if (this.formatterSourceMap) 342 324 return this.formatterSourceMap.formattedToOriginal(lineInfo.lineNumber, lineInfo.columnNumber); 343 325 return lineInfo; 344 } ,345 346 _sourceCodeLocationForEditorPosition : function(position)326 } 327 328 _sourceCodeLocationForEditorPosition(position) 347 329 { 348 330 var lineInfo = {lineNumber: position.line, columnNumber: position.ch}; 349 331 var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(lineInfo); 350 332 return this.sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber); 351 } ,352 353 _editorLineInfoForSourceCodeLocation : function(sourceCodeLocation)333 } 334 335 _editorLineInfoForSourceCodeLocation(sourceCodeLocation) 354 336 { 355 337 if (this._sourceCode instanceof WebInspector.SourceMapResource) 356 338 return {lineNumber: sourceCodeLocation.displayLineNumber, columnNumber: sourceCodeLocation.displayColumnNumber}; 357 339 return {lineNumber: sourceCodeLocation.formattedLineNumber, columnNumber: sourceCodeLocation.formattedColumnNumber}; 358 } ,359 360 _breakpointForEditorLineInfo : function(lineInfo)340 } 341 342 _breakpointForEditorLineInfo(lineInfo) 361 343 { 362 344 if (!this._breakpointMap[lineInfo.lineNumber]) 363 345 return null; 364 346 return this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber]; 365 } ,366 367 _addBreakpointWithEditorLineInfo : function(breakpoint, lineInfo)347 } 348 349 _addBreakpointWithEditorLineInfo(breakpoint, lineInfo) 368 350 { 369 351 if (!this._breakpointMap[lineInfo.lineNumber]) … … 371 353 372 354 this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber] = breakpoint; 373 } ,374 375 _removeBreakpointWithEditorLineInfo : function(breakpoint, lineInfo)355 } 356 357 _removeBreakpointWithEditorLineInfo(breakpoint, lineInfo) 376 358 { 377 359 console.assert(breakpoint === this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber]); … … 381 363 if (isEmptyObject(this._breakpointMap[lineInfo.lineNumber])) 382 364 delete this._breakpointMap[lineInfo.lineNumber]; 383 } ,384 385 _contentWillPopulate : function(content)365 } 366 367 _contentWillPopulate(content) 386 368 { 387 369 this.dispatchEventToListeners(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate); … … 432 414 } 433 415 } 434 } ,435 436 _contentDidPopulate : function()416 } 417 418 _contentDidPopulate() 437 419 { 438 420 this._contentPopulated = true; … … 447 429 448 430 this._updateEditableMarkers(); 449 } ,450 451 _populateWithContent : function(content)431 } 432 433 _populateWithContent(content) 452 434 { 453 435 content = content || ""; … … 465 447 466 448 this._contentDidPopulate(); 467 } ,468 469 _contentAvailable : function(parameters)449 } 450 451 _contentAvailable(parameters) 470 452 { 471 453 // Return if resource is not available. … … 488 470 489 471 this._populateWithContent(content); 490 } ,491 492 _breakpointStatusDidChange : function(event)472 } 473 474 _breakpointStatusDidChange(event) 493 475 { 494 476 this._updateBreakpointStatus(event.target); 495 } ,496 497 _breakpointsEnabledDidChange : function()477 } 478 479 _breakpointsEnabledDidChange() 498 480 { 499 481 console.assert(this._supportsDebugging); … … 502 484 for (var breakpoint of breakpoints) 503 485 this._updateBreakpointStatus(breakpoint); 504 } ,505 506 _updateBreakpointStatus : function(breakpoint)486 } 487 488 _updateBreakpointStatus(breakpoint) 507 489 { 508 490 console.assert(this._supportsDebugging); … … 516 498 var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation); 517 499 this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint)); 518 } ,519 520 _updateBreakpointLocation : function(event)500 } 501 502 _updateBreakpointLocation(event) 521 503 { 522 504 console.assert(this._supportsDebugging); … … 562 544 this._removeBreakpointWithEditorLineInfo(breakpoint, oldLineInfo); 563 545 this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo); 564 } ,565 566 _breakpointAdded : function(event)546 } 547 548 _breakpointAdded(event) 567 549 { 568 550 console.assert(this._supportsDebugging); … … 581 563 this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo); 582 564 this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint)); 583 } ,584 585 _breakpointRemoved : function(event)565 } 566 567 _breakpointRemoved(event) 586 568 { 587 569 console.assert(this._supportsDebugging); … … 600 582 this._removeBreakpointWithEditorLineInfo(breakpoint, lineInfo); 601 583 this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, null); 602 } ,603 604 _activeCallFrameDidChange : function()584 } 585 586 _activeCallFrameDidChange() 605 587 { 606 588 console.assert(this._supportsDebugging); … … 643 625 else 644 626 this._populateWithScriptContent(); 645 } ,646 647 _activeCallFrameSourceCodeLocationChanged : function(event)627 } 628 629 _activeCallFrameSourceCodeLocationChanged(event) 648 630 { 649 631 console.assert(!isNaN(this.executionLineNumber)); … … 657 639 this.executionLineNumber = lineInfo.lineNumber; 658 640 this.executionColumnNumber = lineInfo.columnNumber; 659 } ,660 661 _populateWithInlineScriptContent : function()641 } 642 643 _populateWithInlineScriptContent() 662 644 { 663 645 console.assert(this._sourceCode instanceof WebInspector.Resource); … … 690 672 return; 691 673 692 constscriptOpenTag = "<script>";693 constscriptCloseTag = "</script>";674 var scriptOpenTag = "<script>"; 675 var scriptCloseTag = "</script>"; 694 676 695 677 var content = ""; … … 729 711 for (var i = 0; i < scripts.length; ++i) 730 712 scripts[i].requestContent().then(boundScriptContentAvailable); 731 } ,732 733 _populateWithScriptContent : function()713 } 714 715 _populateWithScriptContent() 734 716 { 735 717 console.assert(this._sourceCode instanceof WebInspector.Resource); … … 764 746 765 747 scripts[0].requestContent().then(scriptContentAvailable.bind(this)); 766 } ,767 768 _matchesSourceCodeLocation : function(sourceCodeLocation)748 } 749 750 _matchesSourceCodeLocation(sourceCodeLocation) 769 751 { 770 752 if (this._sourceCode instanceof WebInspector.SourceMapResource) … … 775 757 return sourceCodeLocation.sourceCode === this._sourceCode; 776 758 return false; 777 } ,778 779 _matchesBreakpoint : function(breakpoint)759 } 760 761 _matchesBreakpoint(breakpoint) 780 762 { 781 763 console.assert(this._supportsDebugging); … … 787 769 return breakpoint.url === this._sourceCode.url || breakpoint.scriptIdentifier === this._sourceCode.id; 788 770 return false; 789 } ,790 791 _matchesIssue : function(issue)771 } 772 773 _matchesIssue(issue) 792 774 { 793 775 if (this._sourceCode instanceof WebInspector.Resource) … … 797 779 return issue.url === this._sourceCode.url; 798 780 return false; 799 } ,800 801 _issueWasAdded : function(event)781 } 782 783 _issueWasAdded(event) 802 784 { 803 785 var issue = event.data.issue; … … 806 788 807 789 this._addIssue(issue); 808 } ,809 810 _addIssue : function(issue)790 } 791 792 _addIssue(issue) 811 793 { 812 794 // FIXME: Issue should have a SourceCodeLocation. … … 844 826 this._updateIssueWidgetForIssues(widget, lineNumberIssues); 845 827 } 846 } ,847 848 _issueWidgetForLine : function(lineNumber)828 } 829 830 _issueWidgetForLine(lineNumber) 849 831 { 850 832 var widget = this._widgetMap.get(lineNumber); … … 864 846 865 847 return widget; 866 } ,867 868 _iconClassNameForIssueLevel : function(level)848 } 849 850 _iconClassNameForIssueLevel(level) 869 851 { 870 852 if (level === WebInspector.IssueMessage.Level.Warning) … … 873 855 console.assert(level === WebInspector.IssueMessage.Level.Error); 874 856 return "icon-error"; 875 } ,876 877 _updateIssueWidgetForIssues : function(widget, issues)857 } 858 859 _updateIssueWidgetForIssues(widget, issues) 878 860 { 879 861 var widgetElement = widget.widgetElement; … … 931 913 932 914 widget.update(); 933 } ,934 935 _isWidgetToggleable : function(widget)915 } 916 917 _isWidgetToggleable(widget) 936 918 { 937 919 if (widget[WebInspector.SourceCodeTextEditor.WidgetContainsMultipleIssuesSymbol]) … … 946 928 947 929 return false; 948 } ,949 950 _handleWidgetClick : function(widget, lineNumber, event)930 } 931 932 _handleWidgetClick(widget, lineNumber, event) 951 933 { 952 934 if (!this._isWidgetToggleable(widget)) … … 957 939 var lineNumberIssues = this._issuesLineNumberMap.get(lineNumber); 958 940 this._updateIssueWidgetForIssues(widget, lineNumberIssues); 959 } ,960 961 _breakpointInfoForBreakpoint : function(breakpoint)941 } 942 943 _breakpointInfoForBreakpoint(breakpoint) 962 944 { 963 945 return {resolved: breakpoint.resolved, disabled: breakpoint.disabled, autoContinue: breakpoint.autoContinue}; 964 } ,946 } 965 947 966 948 get _supportsDebugging() … … 971 953 return true; 972 954 return false; 973 } ,955 } 974 956 975 957 // TextEditor Delegate 976 958 977 textEditorBaseURL : function(textEditor)959 textEditorBaseURL(textEditor) 978 960 { 979 961 return this._sourceCode.url; 980 } ,981 982 textEditorShouldHideLineNumber : function(textEditor, lineNumber)962 } 963 964 textEditorShouldHideLineNumber(textEditor, lineNumber) 983 965 { 984 966 return lineNumber in this._invalidLineNumbers; 985 } ,986 987 textEditorGutterContextMenu : function(textEditor, lineNumber, columnNumber, editorBreakpoints, event)967 } 968 969 textEditorGutterContextMenu(textEditor, lineNumber, columnNumber, editorBreakpoints, event) 988 970 { 989 971 if (!this._supportsDebugging) … … 991 973 992 974 event.preventDefault(); 975 976 function continueToLocation() 977 { 978 WebInspector.debuggerManager.continueToLocation(script.id, sourceCodeLocation.lineNumber, sourceCodeLocation.columnNumber); 979 } 980 981 function addBreakpoint() 982 { 983 var data = this.textEditorBreakpointAdded(this, lineNumber, columnNumber); 984 this.setBreakpointInfoForLineAndColumn(data.lineNumber, data.columnNumber, data.breakpointInfo); 985 } 986 987 function revealInSidebar() 988 { 989 WebInspector.debuggerSidebarPanel.show(); 990 var treeElement = WebInspector.debuggerSidebarPanel.treeElementForRepresentedObject(breakpoint); 991 if (treeElement) 992 treeElement.revealAndSelect(); 993 } 993 994 994 995 var contextMenu = new WebInspector.ContextMenu(event); … … 1006 1007 1007 1008 if (script) { 1008 function continueToLocation()1009 {1010 WebInspector.debuggerManager.continueToLocation(script.id, sourceCodeLocation.lineNumber, sourceCodeLocation.columnNumber);1011 }1012 1009 1013 1010 contextMenu.appendItem(WebInspector.UIString("Continue to Here"), continueToLocation); … … 1027 1024 // No breakpoints. 1028 1025 if (!breakpoints.length) { 1029 function addBreakpoint()1030 {1031 var data = this.textEditorBreakpointAdded(this, lineNumber, columnNumber);1032 this.setBreakpointInfoForLineAndColumn(data.lineNumber, data.columnNumber, data.breakpointInfo);1033 }1034 1026 1035 1027 contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), addBreakpoint.bind(this)); … … 1041 1033 if (breakpoints.length === 1) { 1042 1034 var breakpoint = breakpoints[0]; 1043 function revealInSidebar()1044 {1045 WebInspector.debuggerSidebarPanel.show();1046 var treeElement = WebInspector.debuggerSidebarPanel.treeElementForRepresentedObject(breakpoint);1047 if (treeElement)1048 treeElement.revealAndSelect();1049 }1050 1035 1051 1036 breakpoint.appendContextMenuItems(contextMenu, event.target); … … 1086 1071 contextMenu.appendItem(WebInspector.UIString("Delete Breakpoints"), removeBreakpoints.bind(this)); 1087 1072 contextMenu.show(); 1088 } ,1089 1090 textEditorBreakpointAdded : function(textEditor, lineNumber, columnNumber)1073 } 1074 1075 textEditorBreakpointAdded(textEditor, lineNumber, columnNumber) 1091 1076 { 1092 1077 if (!this._supportsDebugging) … … 1114 1099 columnNumber: lineInfo.columnNumber 1115 1100 }; 1116 } ,1117 1118 textEditorBreakpointRemoved : function(textEditor, lineNumber, columnNumber)1101 } 1102 1103 textEditorBreakpointRemoved(textEditor, lineNumber, columnNumber) 1119 1104 { 1120 1105 console.assert(this._supportsDebugging); … … 1133 1118 WebInspector.debuggerManager.removeBreakpoint(breakpoint); 1134 1119 delete this._ignoreBreakpointAddedBreakpoint; 1135 } ,1136 1137 textEditorBreakpointMoved : function(textEditor, oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)1120 } 1121 1122 textEditorBreakpointMoved(textEditor, oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber) 1138 1123 { 1139 1124 console.assert(this._supportsDebugging); … … 1160 1145 if (accurateNewLineInfo.lineNumber !== newLineInfo.lineNumber || accurateNewLineInfo.columnNumber !== newLineInfo.columnNumber) 1161 1146 this.updateBreakpointLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, accurateNewLineInfo.lineNumber, accurateNewLineInfo.columnNumber); 1162 } ,1163 1164 textEditorBreakpointClicked : function(textEditor, lineNumber, columnNumber)1147 } 1148 1149 textEditorBreakpointClicked(textEditor, lineNumber, columnNumber) 1165 1150 { 1166 1151 console.assert(this._supportsDebugging); … … 1174 1159 1175 1160 breakpoint.cycleToNextMode(); 1176 } ,1177 1178 textEditorUpdatedFormatting : function(textEditor)1161 } 1162 1163 textEditorUpdatedFormatting(textEditor) 1179 1164 { 1180 1165 this._ignoreAllBreakpointLocationUpdates = true; … … 1212 1197 1213 1198 this._reinsertAllIssues(); 1214 } ,1215 1216 _clearWidgets : function()1199 } 1200 1201 _clearWidgets() 1217 1202 { 1218 1203 for (var widget of this._widgetMap.values()) … … 1220 1205 1221 1206 this._widgetMap.clear(); 1222 } ,1223 1224 _reinsertAllIssues : function()1207 } 1208 1209 _reinsertAllIssues() 1225 1210 { 1226 1211 this._issuesLineNumberMap.clear(); … … 1232 1217 this._addIssue(issue); 1233 1218 } 1234 } ,1235 1236 _debuggerDidPause : function(event)1219 } 1220 1221 _debuggerDidPause(event) 1237 1222 { 1238 1223 this._updateTokenTrackingControllerState(); … … 1241 1226 if (this._basicBlockAnnotator && this._basicBlockAnnotator.isActive()) 1242 1227 this._basicBlockAnnotator.refresh(); 1243 } ,1244 1245 _debuggerDidResume : function(event)1228 } 1229 1230 _debuggerDidResume(event) 1246 1231 { 1247 1232 this._updateTokenTrackingControllerState(); … … 1251 1236 if (this._basicBlockAnnotator && this._basicBlockAnnotator.isActive()) 1252 1237 this._basicBlockAnnotator.refresh(); 1253 } ,1254 1255 _sourceCodeSourceMapAdded : function(event)1238 } 1239 1240 _sourceCodeSourceMapAdded(event) 1256 1241 { 1257 1242 WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this); … … 1259 1244 1260 1245 this._updateTokenTrackingControllerState(); 1261 } ,1262 1263 _updateTokenTrackingControllerState : function()1246 } 1247 1248 _updateTokenTrackingControllerState() 1264 1249 { 1265 1250 var mode = WebInspector.CodeMirrorTokenTrackingController.Mode.None; … … 1298 1283 1299 1284 this.tokenTrackingController.mode = mode; 1300 } ,1301 1302 _hasColorMarkers : function()1285 } 1286 1287 _hasColorMarkers() 1303 1288 { 1304 1289 for (var marker of this.markers) { … … 1307 1292 } 1308 1293 return false; 1309 } ,1294 } 1310 1295 1311 1296 // CodeMirrorTokenTrackingController Delegate 1312 1297 1313 tokenTrackingControllerCanReleaseHighlightedRange : function(tokenTrackingController, element)1298 tokenTrackingControllerCanReleaseHighlightedRange(tokenTrackingController, element) 1314 1299 { 1315 1300 if (!this._popover) … … 1320 1305 1321 1306 return true; 1322 } ,1323 1324 tokenTrackingControllerHighlightedRangeReleased : function(tokenTrackingController)1307 } 1308 1309 tokenTrackingControllerHighlightedRangeReleased(tokenTrackingController) 1325 1310 { 1326 1311 if (!this._mouseIsOverPopover) 1327 1312 this._dismissPopover(); 1328 } ,1329 1330 tokenTrackingControllerHighlightedRangeWasClicked : function(tokenTrackingController)1313 } 1314 1315 tokenTrackingControllerHighlightedRangeWasClicked(tokenTrackingController) 1331 1316 { 1332 1317 if (this.tokenTrackingController.mode !== WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens) … … 1342 1327 else 1343 1328 WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation); 1344 } ,1345 1346 tokenTrackingControllerNewHighlightCandidate : function(tokenTrackingController, candidate)1329 } 1330 1331 tokenTrackingControllerNewHighlightCandidate(tokenTrackingController, candidate) 1347 1332 { 1348 1333 if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens) { … … 1368 1353 this._dismissEditingController(); 1369 1354 } 1370 } ,1371 1372 tokenTrackingControllerMouseOutOfHoveredMarker : function(tokenTrackingController, hoveredMarker)1355 } 1356 1357 tokenTrackingControllerMouseOutOfHoveredMarker(tokenTrackingController, hoveredMarker) 1373 1358 { 1374 1359 this._dismissEditingController(); 1375 } ,1376 1377 _tokenTrackingControllerHighlightedJavaScriptExpression : function(candidate)1360 } 1361 1362 _tokenTrackingControllerHighlightedJavaScriptExpression(candidate) 1378 1363 { 1379 1364 console.assert(candidate.expression); … … 1415 1400 // No call frame available. Use the main page's context. 1416 1401 RuntimeAgent.evaluate.invoke({expression: candidate.expression, objectGroup: "popover", doNotPauseOnExceptionsAndMuteConsole: true}, populate.bind(this)); 1417 } ,1418 1419 _tokenTrackingControllerHighlightedJavaScriptTypeInformation : function(candidate)1402 } 1403 1404 _tokenTrackingControllerHighlightedJavaScriptTypeInformation(candidate) 1420 1405 { 1421 1406 console.assert(candidate.expression); … … 1450 1435 1451 1436 RuntimeAgent.getRuntimeTypesForVariablesAtOffsets(allRequests, handler.bind(this)); 1452 } ,1453 1454 _showPopover : function(content, bounds)1437 } 1438 1439 _showPopover(content, bounds) 1455 1440 { 1456 1441 console.assert(this.tokenTrackingController.candidate || bounds); … … 1478 1463 1479 1464 this._trackPopoverEvents(); 1480 } ,1481 1482 _showPopoverForFunction : function(data)1465 } 1466 1467 _showPopoverForFunction(data) 1483 1468 { 1484 1469 var candidate = this.tokenTrackingController.candidate; … … 1513 1498 } 1514 1499 DebuggerAgent.getFunctionDetails(data.objectId, didGetDetails.bind(this)); 1515 } ,1516 1517 _showPopoverForObject : function(data)1500 } 1501 1502 _showPopoverForObject(data) 1518 1503 { 1519 1504 var content = document.createElement("div"); … … 1535 1520 1536 1521 this._showPopover(content); 1537 } ,1538 1539 _showPopoverWithFormattedValue : function(remoteObject)1522 } 1523 1524 _showPopoverWithFormattedValue(remoteObject) 1540 1525 { 1541 1526 var content = WebInspector.FormattedValue.createElementForRemoteObject(remoteObject); 1542 1527 this._showPopover(content); 1543 } ,1544 1545 willDismissPopover : function(popover)1528 } 1529 1530 willDismissPopover(popover) 1546 1531 { 1547 1532 this.tokenTrackingController.removeHighlightedRange(); 1548 1533 1549 1534 RuntimeAgent.releaseObjectGroup("popover"); 1550 } ,1551 1552 _dismissPopover : function()1535 } 1536 1537 _dismissPopover() 1553 1538 { 1554 1539 if (!this._popover) … … 1561 1546 this._popoverEventListeners.unregister(); 1562 1547 } 1563 } ,1564 1565 _trackPopoverEvents : function()1548 } 1549 1550 _trackPopoverEvents() 1566 1551 { 1567 1552 if (!this._popoverEventListeners) … … 1573 1558 this._popoverEventListeners.install(); 1574 1559 } 1575 } ,1576 1577 _popoverMouseover : function(event)1560 } 1561 1562 _popoverMouseover(event) 1578 1563 { 1579 1564 this._mouseIsOverPopover = true; 1580 } ,1581 1582 _popoverMouseout : function(event)1565 } 1566 1567 _popoverMouseout(event) 1583 1568 { 1584 1569 this._mouseIsOverPopover = this._popover.element.contains(event.relatedTarget); 1585 } ,1586 1587 _updateEditableMarkers : function(range)1570 } 1571 1572 _updateEditableMarkers(range) 1588 1573 { 1589 1574 this.createColorMarkers(range); … … 1591 1576 1592 1577 this._updateTokenTrackingControllerState(); 1593 } ,1594 1595 _tokenTrackingControllerHighlightedMarkedExpression : function(candidate, markers)1578 } 1579 1580 _tokenTrackingControllerHighlightedMarkedExpression(candidate, markers) 1596 1581 { 1597 1582 // Look for the outermost editable marker. … … 1630 1615 this._editingController.delegate = this; 1631 1616 this._editingController.presentHoverMenu(); 1632 } ,1633 1634 _dismissEditingController : function(discrete)1617 } 1618 1619 _dismissEditingController(discrete) 1635 1620 { 1636 1621 if (this._editingController) … … 1639 1624 this.tokenTrackingController.hoveredMarker = null; 1640 1625 delete this._editingController; 1641 } ,1626 } 1642 1627 1643 1628 // CodeMirrorEditingController Delegate 1644 1629 1645 editingControllerDidStartEditing : function(editingController)1630 editingControllerDidStartEditing(editingController) 1646 1631 { 1647 1632 // We can pause the token tracking controller during editing, it will be reset … … 1655 1640 // We ignore content changes made as a result of color editing. 1656 1641 this._ignoreContentDidChange++; 1657 } ,1642 } 1658 1643 1659 editingControllerDidFinishEditing : function(editingController)1644 editingControllerDidFinishEditing(editingController) 1660 1645 { 1661 1646 this._updateEditableMarkers(editingController.range); … … 1664 1649 1665 1650 delete this._editingController; 1666 } ,1667 1668 _setTypeTokenAnnotatorEnabledState : function(shouldActivate)1651 } 1652 1653 _setTypeTokenAnnotatorEnabledState(shouldActivate) 1669 1654 { 1670 1655 console.assert(this._typeTokenAnnotator); … … 1701 1686 1702 1687 this._updateTokenTrackingControllerState(); 1703 } ,1704 1705 _getAssociatedScript : function()1688 } 1689 1690 _getAssociatedScript() 1706 1691 { 1707 1692 var script = null; … … 1712 1697 script = this._sourceCode.scripts[0]; 1713 1698 return script; 1714 } ,1715 1716 _makeTypeTokenAnnotator : function()1699 } 1700 1701 _makeTypeTokenAnnotator() 1717 1702 { 1718 1703 if (!RuntimeAgent.getRuntimeTypesForVariablesAtOffsets) … … 1724 1709 1725 1710 this._typeTokenAnnotator = new WebInspector.TypeTokenAnnotator(this, script); 1726 } ,1727 1728 _makeBasicBlockAnnotator : function()1711 } 1712 1713 _makeBasicBlockAnnotator() 1729 1714 { 1730 1715 if (!RuntimeAgent.getBasicBlocks) … … 1736 1721 1737 1722 this._basicBlockAnnotator = new WebInspector.BasicBlockAnnotator(this, script); 1738 } ,1739 1740 _enableScrollEventsForTypeTokenAnnotator : function()1723 } 1724 1725 _enableScrollEventsForTypeTokenAnnotator() 1741 1726 { 1742 1727 // Pause updating type tokens while scrolling to prevent frame loss. … … 1744 1729 this._typeTokenScrollHandler = this._makeTypeTokenScrollEventHandler(); 1745 1730 this.addScrollHandler(this._typeTokenScrollHandler); 1746 } ,1747 1748 _disableScrollEventsForTypeTokenAnnotator : function()1731 } 1732 1733 _disableScrollEventsForTypeTokenAnnotator() 1749 1734 { 1750 1735 console.assert(this._typeTokenScrollHandler); 1751 1736 this.removeScrollHandler(this._typeTokenScrollHandler); 1752 1737 this._typeTokenScrollHandler = null; 1753 } ,1754 1755 _makeTypeTokenScrollEventHandler : function()1738 } 1739 1740 _makeTypeTokenScrollEventHandler() 1756 1741 { 1757 1742 var timeoutIdentifier = null; … … 1780 1765 }; 1781 1766 1782 WebInspector.SourceCodeTextEditor.prototype.__proto__ = WebInspector.TextEditor.prototype; 1767 WebInspector.SourceCodeTextEditor.LineErrorStyleClassName = "error"; 1768 WebInspector.SourceCodeTextEditor.LineWarningStyleClassName = "warning"; 1769 WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName = "debugger-popover-content"; 1770 WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName = "hovered-expression-highlight"; 1771 WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken = 500; 1772 WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease = 1000; 1773 WebInspector.SourceCodeTextEditor.DurationToUpdateTypeTokensAfterScrolling = 100; 1774 WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength = 500; 1775 WebInspector.SourceCodeTextEditor.WidgetContainsMultipleIssuesSymbol = Symbol("source-code-widget-contains-multiple-issues"); 1776 1777 WebInspector.SourceCodeTextEditor.Event = { 1778 ContentWillPopulate: "source-code-text-editor-content-will-populate", 1779 ContentDidPopulate: "source-code-text-editor-content-did-populate" 1780 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js
r181769 r182054 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 WebInspector.TextEditor = function(element, mimeType, delegate)26 WebInspector.TextEditor = class TextEditor extends WebInspector.Object 27 27 { 28 // FIXME: Convert this to a WebInspector.Object subclass, and call super(). 29 // WebInspector.Object.call(this); 30 31 var text = (element ? element.textContent : ""); 32 this._element = element || document.createElement("div"); 33 this._element.classList.add(WebInspector.TextEditor.StyleClassName); 34 this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName); 35 36 this._codeMirror = CodeMirror(this.element, { 37 readOnly: true, 38 indentWithTabs: true, 39 indentUnit: 4, 40 lineNumbers: true, 41 lineWrapping: true, 42 matchBrackets: true, 43 autoCloseBrackets: true 44 }); 45 46 this._codeMirror.on("change", this._contentChanged.bind(this)); 47 this._codeMirror.on("gutterClick", this._gutterMouseDown.bind(this)); 48 this._codeMirror.on("gutterContextMenu", this._gutterContextMenu.bind(this)); 49 this._codeMirror.getScrollerElement().addEventListener("click", this._openClickedLinks.bind(this), true); 50 51 this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this); 52 this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this); 53 54 this._initialStringNotSet = true; 55 56 this.mimeType = mimeType; 57 58 this._breakpoints = {}; 59 this._executionLineNumber = NaN; 60 this._executionColumnNumber = NaN; 61 62 this._searchQuery = null; 63 this._searchResults = []; 64 this._currentSearchResultIndex = -1; 65 this._ignoreCodeMirrorContentDidChangeEvent = 0; 66 67 this._formatted = false; 68 this._formatterSourceMap = null; 69 70 this._delegate = delegate || null; 71 }; 72 73 // FIXME: Move to a WebInspector.Object subclass and we can remove this. 74 WebInspector.Object.deprecatedAddConstructorFunctions(WebInspector.TextEditor); 75 76 WebInspector.TextEditor.StyleClassName = "text-editor"; 77 WebInspector.TextEditor.HighlightedStyleClassName = "highlighted"; 78 WebInspector.TextEditor.SearchResultStyleClassName = "search-result"; 79 WebInspector.TextEditor.HasBreakpointStyleClassName = "has-breakpoint"; 80 WebInspector.TextEditor.BreakpointResolvedStyleClassName = "breakpoint-resolved"; 81 WebInspector.TextEditor.BreakpointAutoContinueStyleClassName = "breakpoint-auto-continue"; 82 WebInspector.TextEditor.BreakpointDisabledStyleClassName = "breakpoint-disabled"; 83 WebInspector.TextEditor.MultipleBreakpointsStyleClassName = "multiple-breakpoints"; 84 WebInspector.TextEditor.ExecutionLineStyleClassName = "execution-line"; 85 WebInspector.TextEditor.BouncyHighlightStyleClassName = "bouncy-highlight"; 86 WebInspector.TextEditor.NumberOfFindsPerSearchBatch = 10; 87 WebInspector.TextEditor.HighlightAnimationDuration = 2000; 88 89 WebInspector.TextEditor.Event = { 90 ExecutionLineNumberDidChange: "text-editor-execution-line-number-did-change", 91 NumberOfSearchResultsDidChange: "text-editor-number-of-search-results-did-change", 92 ContentDidChange: "text-editor-content-did-change", 93 FormattingDidChange: "text-editor-formatting-did-change" 94 }; 95 96 WebInspector.TextEditor.prototype = { 97 constructor: WebInspector.TextEditor, 28 constructor(element, mimeType, delegate) 29 { 30 super(); 31 32 var text = (element ? element.textContent : ""); 33 this._element = element || document.createElement("div"); 34 this._element.classList.add("text-editor"); 35 this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName); 36 37 this._codeMirror = CodeMirror(this.element, { 38 readOnly: true, 39 indentWithTabs: true, 40 indentUnit: 4, 41 lineNumbers: true, 42 lineWrapping: true, 43 matchBrackets: true, 44 autoCloseBrackets: true 45 }); 46 47 this._codeMirror.on("change", this._contentChanged.bind(this)); 48 this._codeMirror.on("gutterClick", this._gutterMouseDown.bind(this)); 49 this._codeMirror.on("gutterContextMenu", this._gutterContextMenu.bind(this)); 50 this._codeMirror.getScrollerElement().addEventListener("click", this._openClickedLinks.bind(this), true); 51 52 this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this); 53 this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this); 54 55 this._initialStringNotSet = true; 56 57 this.mimeType = mimeType; 58 59 this._breakpoints = {}; 60 this._executionLineNumber = NaN; 61 this._executionColumnNumber = NaN; 62 63 this._searchQuery = null; 64 this._searchResults = []; 65 this._currentSearchResultIndex = -1; 66 this._ignoreCodeMirrorContentDidChangeEvent = 0; 67 68 this._formatted = false; 69 this._formatterSourceMap = null; 70 71 this._delegate = delegate || null; 72 } 98 73 99 74 // Public … … 102 77 { 103 78 return this._element; 104 } ,79 } 105 80 106 81 get string() 107 82 { 108 83 return this._codeMirror.getValue(); 109 } ,84 } 110 85 111 86 set string(newString) … … 147 122 this._ignoreCodeMirrorContentDidChangeEvent--; 148 123 console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0); 149 } ,124 } 150 125 151 126 get readOnly() 152 127 { 153 128 return this._codeMirror.getOption("readOnly") || false; 154 } ,129 } 155 130 156 131 set readOnly(readOnly) 157 132 { 158 133 this._codeMirror.setOption("readOnly", readOnly); 159 } ,134 } 160 135 161 136 get formatted() 162 137 { 163 138 return this._formatted; 164 } ,139 } 165 140 166 141 set formatted(formatted) … … 181 156 182 157 this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange); 183 } ,158 } 184 159 185 160 set autoFormat(auto) 186 161 { 187 162 this._autoFormat = auto; 188 } ,189 190 hasFormatter : function()191 { 192 constsupportedModes = {163 } 164 165 hasFormatter() 166 { 167 var supportedModes = { 193 168 "javascript": true, 194 169 "css": true, … … 197 172 var mode = this._codeMirror.getMode(); 198 173 return mode.name in supportedModes; 199 } ,200 201 canBeFormatted : function()174 } 175 176 canBeFormatted() 202 177 { 203 178 // Can be overriden by subclasses. 204 179 return this.hasFormatter(); 205 } ,206 207 canShowTypeAnnotations : function()180 } 181 182 canShowTypeAnnotations() 208 183 { 209 184 return false; 210 } ,185 } 211 186 212 187 get selectedTextRange() … … 215 190 var end = this._codeMirror.getCursor(false); 216 191 return this._textRangeFromCodeMirrorPosition(start, end); 217 } ,192 } 218 193 219 194 set selectedTextRange(textRange) … … 221 196 var position = this._codeMirrorPositionFromTextRange(textRange); 222 197 this._codeMirror.setSelection(position.start, position.end); 223 } ,198 } 224 199 225 200 get mimeType() 226 201 { 227 202 return this._mimeType; 228 } ,203 } 229 204 230 205 set mimeType(newMIMEType) … … 234 209 this._mimeType = newMIMEType; 235 210 this._codeMirror.setOption("mode", newMIMEType); 236 } ,211 } 237 212 238 213 get executionLineNumber() 239 214 { 240 215 return this._executionLineNumber; 241 } ,216 } 242 217 243 218 set executionLineNumber(lineNumber) … … 253 228 // could have changed (e.g. continuing in a loop with a breakpoint inside). 254 229 this.dispatchEventToListeners(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange); 255 } ,230 } 256 231 257 232 get executionColumnNumber() 258 233 { 259 234 return this._executionColumnNumber; 260 } ,235 } 261 236 262 237 set executionColumnNumber(columnNumber) 263 238 { 264 239 this._executionColumnNumber = columnNumber; 265 } ,240 } 266 241 267 242 get formatterSourceMap() 268 243 { 269 244 return this._formatterSourceMap; 270 } ,245 } 271 246 272 247 get tokenTrackingController() 273 248 { 274 249 return this._tokenTrackingController; 275 } ,250 } 276 251 277 252 get delegate() 278 253 { 279 254 return this._delegate; 280 } ,255 } 281 256 282 257 set delegate(newDelegate) 283 258 { 284 259 this._delegate = newDelegate || null; 285 } ,260 } 286 261 287 262 get numberOfSearchResults() 288 263 { 289 264 return this._searchResults.length; 290 } ,265 } 291 266 292 267 get currentSearchQuery() 293 268 { 294 269 return this._searchQuery; 295 } ,270 } 296 271 297 272 set automaticallyRevealFirstSearchResult(reveal) … … 304 279 this._revealFirstSearchResultAfterCursor(); 305 280 } 306 } ,307 308 performSearch : function(query)281 } 282 283 performSearch(query) 309 284 { 310 285 if (this._searchQuery === query) … … 368 343 // Start the search. 369 344 boundBatchSearch(); 370 } ,371 372 addSearchResults : function(textRanges)345 } 346 347 addSearchResults(textRanges) 373 348 { 374 349 console.assert(textRanges); … … 392 367 393 368 this._codeMirror.operation(markRanges.bind(this)); 394 } ,395 396 searchCleared : function()369 } 370 371 searchCleared() 397 372 { 398 373 function clearResults() { … … 406 381 this._searchResults = []; 407 382 this._currentSearchResultIndex = -1; 408 } ,409 410 searchQueryWithSelection : function()383 } 384 385 searchQueryWithSelection() 411 386 { 412 387 if (!this._codeMirror.somethingSelected()) … … 414 389 415 390 return this._codeMirror.getSelection(); 416 } ,417 418 revealPreviousSearchResult : function(changeFocus)391 } 392 393 revealPreviousSearchResult(changeFocus) 419 394 { 420 395 if (!this._searchResults.length) … … 432 407 433 408 this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, -1); 434 } ,435 436 revealNextSearchResult : function(changeFocus)409 } 410 411 revealNextSearchResult(changeFocus) 437 412 { 438 413 if (!this._searchResults.length) … … 450 425 451 426 this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, 1); 452 } ,453 454 line : function(lineNumber)427 } 428 429 line(lineNumber) 455 430 { 456 431 return this._codeMirror.getLine(lineNumber); 457 } ,458 459 getTextInRange : function(startPosition, endPosition)432 } 433 434 getTextInRange(startPosition, endPosition) 460 435 { 461 436 return this._codeMirror.getRange(startPosition, endPosition); 462 } ,463 464 addStyleToTextRange : function(startPosition, endPosition, styleClassName)437 } 438 439 addStyleToTextRange(startPosition, endPosition, styleClassName) 465 440 { 466 441 endPosition.ch += 1; 467 442 return this._codeMirror.getDoc().markText(startPosition, endPosition, {className: styleClassName, inclusiveLeft: true, inclusiveRight: true}); 468 } ,469 470 revealPosition : function(position, textRangeToSelect, forceUnformatted, noHighlight)443 } 444 445 revealPosition(position, textRangeToSelect, forceUnformatted, noHighlight) 471 446 { 472 447 console.assert(position === undefined || position instanceof WebInspector.SourceCodePosition, "revealPosition called without a SourceCodePosition"); … … 525 500 526 501 this._codeMirror.operation(revealAndHighlightLine.bind(this)); 527 } ,528 529 updateLayout : function(force)502 } 503 504 updateLayout(force) 530 505 { 531 506 this._codeMirror.refresh(); 532 } ,533 534 shown : function()507 } 508 509 shown() 535 510 { 536 511 this._visible = true; … … 543 518 // so that the scrollInfo coordinates are correct. 544 519 this._revealPendingPositionIfPossible(); 545 } ,546 547 hidden : function()520 } 521 522 hidden() 548 523 { 549 524 this._visible = false; 550 } ,551 552 setBreakpointInfoForLineAndColumn : function(lineNumber, columnNumber, breakpointInfo)525 } 526 527 setBreakpointInfoForLineAndColumn(lineNumber, columnNumber, breakpointInfo) 553 528 { 554 529 if (this._ignoreSetBreakpointInfoCalls) … … 559 534 else 560 535 this._removeBreakpointFromLineAndColumn(lineNumber, columnNumber); 561 } ,562 563 updateBreakpointLineAndColumn : function(oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)536 } 537 538 updateBreakpointLineAndColumn(oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber) 564 539 { 565 540 console.assert(this._breakpoints[oldLineNumber]); … … 574 549 this._removeBreakpointFromLineAndColumn(oldLineNumber, oldColumnNumber); 575 550 this._addBreakpointToLineAndColumnWithInfo(newLineNumber, newColumnNumber, breakpointInfo); 576 } ,577 578 addStyleClassToLine : function(lineNumber, styleClassName)551 } 552 553 addStyleClassToLine(lineNumber, styleClassName) 579 554 { 580 555 var lineHandle = this._codeMirror.getLineHandle(lineNumber); … … 583 558 584 559 return this._codeMirror.addLineClass(lineHandle, "wrap", styleClassName); 585 } ,586 587 removeStyleClassFromLine : function(lineNumber, styleClassName)560 } 561 562 removeStyleClassFromLine(lineNumber, styleClassName) 588 563 { 589 564 var lineHandle = this._codeMirror.getLineHandle(lineNumber); … … 593 568 594 569 return this._codeMirror.removeLineClass(lineHandle, "wrap", styleClassName); 595 } ,596 597 toggleStyleClassForLine : function(lineNumber, styleClassName)570 } 571 572 toggleStyleClassForLine(lineNumber, styleClassName) 598 573 { 599 574 var lineHandle = this._codeMirror.getLineHandle(lineNumber); … … 603 578 604 579 return this._codeMirror.toggleLineClass(lineHandle, "wrap", styleClassName); 605 } ,606 607 createWidgetForLine : function(lineNumber)580 } 581 582 createWidgetForLine(lineNumber) 608 583 { 609 584 var lineHandle = this._codeMirror.getLineHandle(lineNumber); … … 614 589 var lineWidget = this._codeMirror.addLineWidget(lineHandle, widgetElement, {coverGutter: false, noHScroll: true, handleMouseEvents: true}); 615 590 return new WebInspector.LineWidget(lineWidget, widgetElement); 616 } ,591 } 617 592 618 593 get lineCount() 619 594 { 620 595 return this._codeMirror.lineCount(); 621 } ,622 623 focus : function()596 } 597 598 focus() 624 599 { 625 600 this._codeMirror.focus(); 626 } ,627 628 contentDidChange : function(replacedRanges, newRanges)601 } 602 603 contentDidChange(replacedRanges, newRanges) 629 604 { 630 605 // Implemented by subclasses. 631 } ,632 633 rectsForRange : function(range)606 } 607 608 rectsForRange(range) 634 609 { 635 610 return this._codeMirror.rectsForRange(range); 636 } ,611 } 637 612 638 613 get markers() … … 641 616 return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker); 642 617 }); 643 } ,644 645 markersAtPosition : function(position)618 } 619 620 markersAtPosition(position) 646 621 { 647 622 return this._codeMirror.findMarksAt(position).map(function(codeMirrorTextMarker) { 648 623 return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker); 649 624 }); 650 } ,651 652 createColorMarkers : function(range)625 } 626 627 createColorMarkers(range) 653 628 { 654 629 return this._codeMirror.createColorMarkers(range); 655 } ,656 657 createGradientMarkers : function(range)630 } 631 632 createGradientMarkers(range) 658 633 { 659 634 return this._codeMirror.createGradientMarkers(range); 660 } ,661 662 editingControllerForMarker : function(editableMarker)635 } 636 637 editingControllerForMarker(editableMarker) 663 638 { 664 639 switch (editableMarker.type) { … … 670 645 return new WebInspector.CodeMirrorEditingController(this._codeMirror, editableMarker); 671 646 } 672 } ,673 674 visibleRangeOffsets : function()647 } 648 649 visibleRangeOffsets() 675 650 { 676 651 var startOffset = null; … … 687 662 688 663 return {startOffset, endOffset}; 689 } ,690 691 originalOffsetToCurrentPosition : function(offset)664 } 665 666 originalOffsetToCurrentPosition(offset) 692 667 { 693 668 var position = null; … … 699 674 700 675 return position; 701 } ,702 703 currentOffsetToCurrentPosition : function(offset)676 } 677 678 currentOffsetToCurrentPosition(offset) 704 679 { 705 680 return this._codeMirror.getDoc().posFromIndex(offset); 706 } ,707 708 currentPositionToOriginalOffset : function(position)681 } 682 683 currentPositionToOriginalOffset(position) 709 684 { 710 685 var offset = null; … … 715 690 716 691 return offset; 717 } ,718 719 currentPositionToCurrentOffset : function(position)692 } 693 694 currentPositionToCurrentOffset(position) 720 695 { 721 696 return this._codeMirror.getDoc().indexFromPos(position); 722 } ,723 724 setInlineWidget : function(position, inlineElement)697 } 698 699 setInlineWidget(position, inlineElement) 725 700 { 726 701 return this._codeMirror.setUniqueBookmark(position, {widget: inlineElement}); 727 } ,728 729 addScrollHandler : function(handler)702 } 703 704 addScrollHandler(handler) 730 705 { 731 706 this._codeMirror.on("scroll", handler); 732 } ,733 734 removeScrollHandler : function(handler)707 } 708 709 removeScrollHandler(handler) 735 710 { 736 711 this._codeMirror.off("scroll", handler); 737 } ,712 } 738 713 739 714 // Protected 740 715 741 prettyPrint : function(pretty)716 prettyPrint(pretty) 742 717 { 743 718 function prettyPrintAndUpdateEditor() 744 719 { 745 conststart = {line: 0, ch: 0};746 constend = {line: this._codeMirror.lineCount() - 1};720 var start = {line: 0, ch: 0}; 721 var end = {line: this._codeMirror.lineCount() - 1}; 747 722 748 723 var oldSelectionAnchor = this._codeMirror.getCursor("anchor"); … … 753 728 if (pretty) { 754 729 // <rdar://problem/10593948> Provide a way to change the tab width in the Web Inspector 755 constindentString = " ";730 var indentString = " "; 756 731 var originalLineEndings = []; 757 732 var formattedLineEndings = []; … … 837 812 838 813 this._codeMirror.operation(prettyPrintAndUpdateEditor.bind(this)); 839 } ,814 } 840 815 841 816 // Private 842 817 843 hasEdits : function()818 hasEdits() 844 819 { 845 820 return !this._codeMirror.isClean(); 846 } ,847 848 _contentChanged : function(codeMirror, change)821 } 822 823 _contentChanged(codeMirror, change) 849 824 { 850 825 if (this._ignoreCodeMirrorContentDidChangeEvent > 0) … … 881 856 882 857 this.dispatchEventToListeners(WebInspector.TextEditor.Event.ContentDidChange); 883 } ,884 885 _textRangeFromCodeMirrorPosition : function(start, end)858 } 859 860 _textRangeFromCodeMirrorPosition(start, end) 886 861 { 887 862 console.assert(start); … … 889 864 890 865 return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch); 891 } ,892 893 _codeMirrorPositionFromTextRange : function(textRange)866 } 867 868 _codeMirrorPositionFromTextRange(textRange) 894 869 { 895 870 console.assert(textRange); … … 898 873 var end = {line: textRange.endLine, ch: textRange.endColumn}; 899 874 return {start, end}; 900 } ,901 902 _revealPendingPositionIfPossible : function()875 } 876 877 _revealPendingPositionIfPossible() 903 878 { 904 879 // Nothing to do if we don't have a pending position. … … 911 886 912 887 this.revealPosition(this._positionToReveal, this._textRangeToSelect, this._forceUnformatted); 913 } ,914 915 _revealSearchResult : function(result, changeFocus, directionInCaseOfRevalidation)888 } 889 890 _revealSearchResult(result, changeFocus, directionInCaseOfRevalidation) 916 891 { 917 892 var position = result.find(); … … 973 948 // Listen for the end of the animation so we can remove the element. 974 949 this._bouncyHighlightElement.addEventListener("webkitAnimationEnd", animationEnded.bind(this)); 975 } ,976 977 _binarySearchInsertionIndexInSearchResults : function(object, comparator)950 } 951 952 _binarySearchInsertionIndexInSearchResults(object, comparator) 978 953 { 979 954 // It is possible that markers in the search results array may have been deleted. … … 999 974 1000 975 return first - 1; 1001 } ,1002 1003 _revealFirstSearchResultBeforeCursor : function(changeFocus)976 } 977 978 _revealFirstSearchResultBeforeCursor(changeFocus) 1004 979 { 1005 980 console.assert(this._searchResults.length); … … 1026 1001 this._currentSearchResultIndex = index; 1027 1002 this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus); 1028 } ,1029 1030 _revealFirstSearchResultAfterCursor : function(changeFocus)1003 } 1004 1005 _revealFirstSearchResultAfterCursor(changeFocus) 1031 1006 { 1032 1007 console.assert(this._searchResults.length); … … 1058 1033 this._currentSearchResultIndex = index; 1059 1034 this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus); 1060 } ,1061 1062 _cursorDoesNotMatchLastRevealedSearchResult : function()1035 } 1036 1037 _cursorDoesNotMatchLastRevealedSearchResult() 1063 1038 { 1064 1039 console.assert(this._currentSearchResultIndex !== -1); … … 1073 1048 1074 1049 return WebInspector.compareCodeMirrorPositions(currentCursorPosition, lastRevealedSearchResultPosition) !== 0; 1075 } ,1076 1077 _revalidateSearchResults : function(direction)1050 } 1051 1052 _revalidateSearchResults(direction) 1078 1053 { 1079 1054 console.assert(direction !== undefined); … … 1098 1073 this._revealFirstSearchResultBeforeCursor(); 1099 1074 } 1100 } ,1101 1102 _updateExecutionLine : function()1075 } 1076 1077 _updateExecutionLine() 1103 1078 { 1104 1079 function update() … … 1114 1089 1115 1090 this._codeMirror.operation(update.bind(this)); 1116 } ,1117 1118 _setBreakpointStylesOnLine : function(lineNumber)1091 } 1092 1093 _setBreakpointStylesOnLine(lineNumber) 1119 1094 { 1120 1095 var columnBreakpoints = this._breakpoints[lineNumber]; … … 1171 1146 1172 1147 this._codeMirror.operation(updateStyles.bind(this)); 1173 } ,1174 1175 _addBreakpointToLineAndColumnWithInfo : function(lineNumber, columnNumber, breakpointInfo)1148 } 1149 1150 _addBreakpointToLineAndColumnWithInfo(lineNumber, columnNumber, breakpointInfo) 1176 1151 { 1177 1152 if (!this._breakpoints[lineNumber]) … … 1180 1155 1181 1156 this._setBreakpointStylesOnLine(lineNumber); 1182 } ,1183 1184 _removeBreakpointFromLineAndColumn : function(lineNumber, columnNumber)1157 } 1158 1159 _removeBreakpointFromLineAndColumn(lineNumber, columnNumber) 1185 1160 { 1186 1161 console.assert(columnNumber in this._breakpoints[lineNumber]); … … 1209 1184 1210 1185 this._codeMirror.operation(updateStyles.bind(this)); 1211 } ,1212 1213 _allColumnBreakpointInfoForLine : function(lineNumber)1186 } 1187 1188 _allColumnBreakpointInfoForLine(lineNumber) 1214 1189 { 1215 1190 return this._breakpoints[lineNumber]; 1216 } ,1217 1218 _setColumnBreakpointInfoForLine : function(lineNumber, columnBreakpointInfo)1191 } 1192 1193 _setColumnBreakpointInfoForLine(lineNumber, columnBreakpointInfo) 1219 1194 { 1220 1195 console.assert(columnBreakpointInfo); 1221 1196 this._breakpoints[lineNumber] = columnBreakpointInfo; 1222 1197 this._setBreakpointStylesOnLine(lineNumber); 1223 } ,1224 1225 _gutterMouseDown : function(codeMirror, lineNumber, gutterElement, event)1198 } 1199 1200 _gutterMouseDown(codeMirror, lineNumber, gutterElement, event) 1226 1201 { 1227 1202 if (event.button !== 0 || event.ctrlKey) … … 1266 1241 document.addEventListener("mousemove", this._documentMouseMovedEventListener, true); 1267 1242 document.addEventListener("mouseup", this._documentMouseUpEventListener, true); 1268 } ,1269 1270 _gutterContextMenu : function(codeMirror, lineNumber, gutterElement, event)1243 } 1244 1245 _gutterContextMenu(codeMirror, lineNumber, gutterElement, event) 1271 1246 { 1272 1247 if (this._delegate && typeof this._delegate.textEditorGutterContextMenu === "function") { … … 1277 1252 this._delegate.textEditorGutterContextMenu(this, lineNumber, 0, breakpoints, event); 1278 1253 } 1279 } ,1280 1281 _documentMouseMoved : function(event)1254 } 1255 1256 _documentMouseMoved(event) 1282 1257 { 1283 1258 console.assert("_lineNumberWithMousedDownBreakpoint" in this); … … 1333 1308 this._columnNumberWithDraggedBreakpoint = columnNumber; 1334 1309 } 1335 } ,1336 1337 _documentMouseUp : function(event)1310 } 1311 1312 _documentMouseUp(event) 1338 1313 { 1339 1314 console.assert("_lineNumberWithMousedDownBreakpoint" in this); … … 1346 1321 document.removeEventListener("mouseup", this._documentMouseUpEventListener, true); 1347 1322 1348 constdelegateImplementsBreakpointClicked = this._delegate && typeof this._delegate.textEditorBreakpointClicked === "function";1349 constdelegateImplementsBreakpointRemoved = this._delegate && typeof this._delegate.textEditorBreakpointRemoved === "function";1350 constdelegateImplementsBreakpointMoved = this._delegate && typeof this._delegate.textEditorBreakpointMoved === "function";1323 var delegateImplementsBreakpointClicked = this._delegate && typeof this._delegate.textEditorBreakpointClicked === "function"; 1324 var delegateImplementsBreakpointRemoved = this._delegate && typeof this._delegate.textEditorBreakpointRemoved === "function"; 1325 var delegateImplementsBreakpointMoved = this._delegate && typeof this._delegate.textEditorBreakpointMoved === "function"; 1351 1326 1352 1327 if (this._mouseDragged) { … … 1394 1369 delete this._previousColumnBreakpointInfo; 1395 1370 delete this._mouseDragged; 1396 } ,1397 1398 _openClickedLinks : function(event)1371 } 1372 1373 _openClickedLinks(event) 1399 1374 { 1400 1375 // Get the position in the text and the token at that position. … … 1422 1397 event.preventDefault(); 1423 1398 event.stopPropagation(); 1424 } ,1425 1426 _isPositionVisible : function(position)1399 } 1400 1401 _isPositionVisible(position) 1427 1402 { 1428 1403 var scrollInfo = this._codeMirror.getScrollInfo(); … … 1432 1407 1433 1408 return coords.top >= visibleRangeStart && coords.bottom <= visibleRangeEnd; 1434 } ,1435 1436 _scrollIntoViewCentered : function(position)1409 } 1410 1411 _scrollIntoViewCentered(position) 1437 1412 { 1438 1413 var scrollInfo = this._codeMirror.getScrollInfo(); … … 1443 1418 }; 1444 1419 1445 WebInspector.TextEditor.prototype.__proto__ = WebInspector.Object.prototype; 1420 WebInspector.TextEditor.HighlightedStyleClassName = "highlighted"; 1421 WebInspector.TextEditor.SearchResultStyleClassName = "search-result"; 1422 WebInspector.TextEditor.HasBreakpointStyleClassName = "has-breakpoint"; 1423 WebInspector.TextEditor.BreakpointResolvedStyleClassName = "breakpoint-resolved"; 1424 WebInspector.TextEditor.BreakpointAutoContinueStyleClassName = "breakpoint-auto-continue"; 1425 WebInspector.TextEditor.BreakpointDisabledStyleClassName = "breakpoint-disabled"; 1426 WebInspector.TextEditor.MultipleBreakpointsStyleClassName = "multiple-breakpoints"; 1427 WebInspector.TextEditor.ExecutionLineStyleClassName = "execution-line"; 1428 WebInspector.TextEditor.BouncyHighlightStyleClassName = "bouncy-highlight"; 1429 WebInspector.TextEditor.NumberOfFindsPerSearchBatch = 10; 1430 WebInspector.TextEditor.HighlightAnimationDuration = 2000; 1431 1432 WebInspector.TextEditor.Event = { 1433 ExecutionLineNumberDidChange: "text-editor-execution-line-number-did-change", 1434 NumberOfSearchResultsDidChange: "text-editor-number-of-search-results-did-change", 1435 ContentDidChange: "text-editor-content-did-change", 1436 FormattingDidChange: "text-editor-formatting-did-change" 1437 };
Note: See TracChangeset
for help on using the changeset viewer.