Commit 00295460 authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Reuse _showSourceLocation for execution line changes handling in sources panel.

R=lushnikov@chromium.org, lushnikov, pfeldman

Review URL: https://codereview.chromium.org/203433002

git-svn-id: svn://svn.chromium.org/blink/trunk@169555 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bf045cf1
...@@ -759,12 +759,16 @@ WebInspector.CodeMirrorTextEditor.prototype = { ...@@ -759,12 +759,16 @@ WebInspector.CodeMirrorTextEditor.prototype = {
*/ */
setExecutionLine: function(lineNumber) setExecutionLine: function(lineNumber)
{ {
this.clearPositionHighlight();
this._executionLine = this._codeMirror.getLineHandle(lineNumber); this._executionLine = this._codeMirror.getLineHandle(lineNumber);
if (!this._executionLine)
return;
this._codeMirror.addLineClass(this._executionLine, "wrap", "cm-execution-line"); this._codeMirror.addLineClass(this._executionLine, "wrap", "cm-execution-line");
}, },
clearExecutionLine: function() clearExecutionLine: function()
{ {
this.clearPositionHighlight();
if (this._executionLine) if (this._executionLine)
this._codeMirror.removeLineClass(this._executionLine, "wrap", "cm-execution-line"); this._codeMirror.removeLineClass(this._executionLine, "wrap", "cm-execution-line");
delete this._executionLine; delete this._executionLine;
...@@ -821,7 +825,7 @@ WebInspector.CodeMirrorTextEditor.prototype = { ...@@ -821,7 +825,7 @@ WebInspector.CodeMirrorTextEditor.prototype = {
clearTimeout(this._clearHighlightTimeout); clearTimeout(this._clearHighlightTimeout);
delete this._clearHighlightTimeout; delete this._clearHighlightTimeout;
if (this._highlightedLine) if (this._highlightedLine)
this._codeMirror.removeLineClass(this._highlightedLine, null, "cm-highlight"); this._codeMirror.removeLineClass(this._highlightedLine, null, "cm-highlight");
delete this._highlightedLine; delete this._highlightedLine;
}, },
......
...@@ -542,14 +542,15 @@ WebInspector.SourcesPanel.prototype = { ...@@ -542,14 +542,15 @@ WebInspector.SourcesPanel.prototype = {
* @param {number=} columnNumber * @param {number=} columnNumber
* @param {boolean=} forceShowInPanel * @param {boolean=} forceShowInPanel
* @param {boolean=} omitFocus * @param {boolean=} omitFocus
* @param {boolean=} omitHighlight
*/ */
_showSourceLocation: function(uiSourceCode, lineNumber, columnNumber, forceShowInPanel, omitFocus) _showSourceLocation: function(uiSourceCode, lineNumber, columnNumber, forceShowInPanel, omitFocus, omitHighlight)
{ {
this._showEditor(forceShowInPanel); this._showEditor(forceShowInPanel);
this._historyManager.updateCurrentState(); this._historyManager.updateCurrentState();
var sourceFrame = this._showFile(uiSourceCode); var sourceFrame = this._showFile(uiSourceCode);
if (typeof lineNumber === "number") if (typeof lineNumber === "number")
sourceFrame.highlightPosition(lineNumber, columnNumber); sourceFrame.revealPosition(lineNumber, columnNumber, !omitHighlight);
this._historyManager.pushNewState(); this._historyManager.pushNewState();
if (!omitFocus) if (!omitFocus)
sourceFrame.focus(); sourceFrame.focus();
...@@ -714,14 +715,7 @@ WebInspector.SourcesPanel.prototype = { ...@@ -714,14 +715,7 @@ WebInspector.SourcesPanel.prototype = {
if (this._skipExecutionLineRevealing) if (this._skipExecutionLineRevealing)
return; return;
this._skipExecutionLineRevealing = true; this._skipExecutionLineRevealing = true;
this._showSourceLocation(uiSourceCode, uiLocation.lineNumber, 0, undefined, undefined, true);
var sourceFrame = this._showFile(uiSourceCode);
sourceFrame.revealPosition(uiLocation.lineNumber);
this._historyManager.pushNewState();
if (sourceFrame.canEditSource())
sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(uiLocation.lineNumber, 0));
sourceFrame.focus();
}, },
_callFrameSelected: function(event) _callFrameSelected: function(event)
......
...@@ -49,6 +49,14 @@ ...@@ -49,6 +49,14 @@
to { background-color: white; } to { background-color: white; }
} }
.cm-highlight.cm-execution-line {
-webkit-animation: "fadeout-execution-line" 1s 0s;
}
@-webkit-keyframes fadeout-execution-line {
from {background-color: rgb(121, 141, 254); }
to { background-color: rgb(171, 191, 254); }
}
.cm-breakpoint .CodeMirror-linenumber { .cm-breakpoint .CodeMirror-linenumber {
color: white; color: white;
border-width: 1px 4px 1px 1px !important; border-width: 1px 4px 1px 1px !important;
...@@ -120,7 +128,7 @@ ...@@ -120,7 +128,7 @@
} }
.cm-execution-line { .cm-execution-line {
background-color: rgb(171, 191, 254) !important; background-color: rgb(171, 191, 254);
outline: 1px solid rgb(64, 115, 244); outline: 1px solid rgb(64, 115, 244);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment