Skip to content

Commit

Permalink
DevTools: do not re-create icons for CommandResult messages
Browse files Browse the repository at this point in the history
The contentElement() call of the CommandResult should be idempotent.
However, it is not, since it re-creates icon continuesly.

This, however, doesn't have any visual impact since icons are perfectly
overlayed over each other.

BUG=none
R=dgozman

Review-Url: https://codereview.chromium.org/2654743002
Cr-Commit-Position: refs/heads/master@{#445670}
  • Loading branch information
aslushnikov authored and Commit bot committed Jan 24, 2017
1 parent e699bfe commit f0d5392
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions front_end/console/ConsoleView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1256,10 +1256,12 @@ Console.ConsoleCommandResult = class extends Console.ConsoleViewMessage {
*/
contentElement() {
var element = super.contentElement();
element.classList.add('console-user-command-result');
if (this.consoleMessage().level === SDK.ConsoleMessage.MessageLevel.Info) {
var icon = UI.Icon.create('smallicon-command-result', 'command-result-icon');
element.insertBefore(icon, element.firstChild);
if (!element.classList.contains('console-user-command-result')) {
element.classList.add('console-user-command-result');
if (this.consoleMessage().level === SDK.ConsoleMessage.MessageLevel.Info) {
var icon = UI.Icon.create('smallicon-command-result', 'command-result-icon');
element.insertBefore(icon, element.firstChild);
}
}
this.updateTimestamp(false);
return element;
Expand Down

0 comments on commit f0d5392

Please sign in to comment.