Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 667163002: DevTools: Do not toggle line styles unless necessary in script editor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 _onSourceMappingChanged: function(event) 767 _onSourceMappingChanged: function(event)
768 { 768 {
769 var data = /** @type {{target: !WebInspector.Target}} */ (event.data); 769 var data = /** @type {{target: !WebInspector.Target}} */ (event.data);
770 this._updateScriptFile(data.target); 770 this._updateScriptFile(data.target);
771 this._updateLinesWithoutMappingHighlight(); 771 this._updateLinesWithoutMappingHighlight();
772 }, 772 },
773 773
774 _updateLinesWithoutMappingHighlight: function() 774 _updateLinesWithoutMappingHighlight: function()
775 { 775 {
776 var linesCount = this.textEditor.linesCount; 776 var linesCount = this.textEditor.linesCount;
777 for (var i = 0; i < linesCount; ++i) 777 for (var i = 0; i < linesCount; ++i) {
778 this.textEditor.toggleLineClass(i, "cm-line-without-source-mapping", !WebInspector.debuggerWorkspaceBinding.uiLineHasMapping(this._uiSourceCode, i)) ; 778 var lineHasMapping = WebInspector.debuggerWorkspaceBinding.uiLineHas Mapping(this._uiSourceCode, i);
779 if (!lineHasMapping)
780 this._hasLineWithoutMapping = true;
781 if (this._hasLineWithoutMapping)
782 this.textEditor.toggleLineClass(i, "cm-line-without-source-mappi ng", !lineHasMapping);
783 }
779 }, 784 },
780 785
781 /** 786 /**
782 * @param {!WebInspector.Target} target 787 * @param {!WebInspector.Target} target
783 */ 788 */
784 _updateScriptFile: function(target) 789 _updateScriptFile: function(target)
785 { 790 {
786 var oldScriptFile = this._scriptFileForTarget.get(target); 791 var oldScriptFile = this._scriptFileForTarget.get(target);
787 var newScriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(thi s._uiSourceCode, target); 792 var newScriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(thi s._uiSourceCode, target);
788 this._scriptFileForTarget.remove(target); 793 this._scriptFileForTarget.remove(target);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 922 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
918 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 923 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
919 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this); 924 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this);
920 WebInspector.settings.skipStackFramesPattern.removeChangeListener(this._ showBlackboxInfobarIfNeeded, this); 925 WebInspector.settings.skipStackFramesPattern.removeChangeListener(this._ showBlackboxInfobarIfNeeded, this);
921 WebInspector.settings.skipContentScripts.removeChangeListener(this._show BlackboxInfobarIfNeeded, this); 926 WebInspector.settings.skipContentScripts.removeChangeListener(this._show BlackboxInfobarIfNeeded, this);
922 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 927 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
923 }, 928 },
924 929
925 __proto__: WebInspector.UISourceCodeFrame.prototype 930 __proto__: WebInspector.UISourceCodeFrame.prototype
926 } 931 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698